diff options
Diffstat (limited to 'fs/ecryptfs/messaging.c')
-rw-r--r-- | fs/ecryptfs/messaging.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/ecryptfs/messaging.c b/fs/ecryptfs/messaging.c index c22b32fc8e8c..e8ba6278ad2c 100644 --- a/fs/ecryptfs/messaging.c +++ b/fs/ecryptfs/messaging.c | |||
@@ -243,7 +243,8 @@ unlock: | |||
243 | * userspace. Returns zero upon delivery to desired context element; | 243 | * userspace. Returns zero upon delivery to desired context element; |
244 | * non-zero upon delivery failure or error. | 244 | * non-zero upon delivery failure or error. |
245 | */ | 245 | */ |
246 | int ecryptfs_process_response(struct ecryptfs_message *msg, pid_t pid, u32 seq) | 246 | int ecryptfs_process_response(struct ecryptfs_message *msg, uid_t uid, |
247 | pid_t pid, u32 seq) | ||
247 | { | 248 | { |
248 | struct ecryptfs_daemon_id *id; | 249 | struct ecryptfs_daemon_id *id; |
249 | struct ecryptfs_msg_ctx *msg_ctx; | 250 | struct ecryptfs_msg_ctx *msg_ctx; |
@@ -268,6 +269,13 @@ int ecryptfs_process_response(struct ecryptfs_message *msg, pid_t pid, u32 seq) | |||
268 | msg_ctx->task->euid, pid); | 269 | msg_ctx->task->euid, pid); |
269 | goto wake_up; | 270 | goto wake_up; |
270 | } | 271 | } |
272 | if (msg_ctx->task->euid != uid) { | ||
273 | rc = -EBADMSG; | ||
274 | ecryptfs_printk(KERN_WARNING, "Received message from user " | ||
275 | "[%d]; expected message from user [%d]\n", | ||
276 | uid, msg_ctx->task->euid); | ||
277 | goto unlock; | ||
278 | } | ||
271 | if (id->pid != pid) { | 279 | if (id->pid != pid) { |
272 | rc = -EBADMSG; | 280 | rc = -EBADMSG; |
273 | ecryptfs_printk(KERN_ERR, "User [%d] received a " | 281 | ecryptfs_printk(KERN_ERR, "User [%d] received a " |