projects/linux·commit 3af54c9b

ipc: shm: fix information leak to userland

3af54c9b · Vasiliy Kulikov <[email protected]> · 2010-10-30 18:22:49 +04:00

The shmid_ds structure is copied to userland with shm_unused{,2,3}
fields unitialized.  It leads to leaking of contents of kernel stack
memory.

Signed-off-by: Vasiliy Kulikov <[email protected]>
Acked-by: Al Viro <[email protected]>
Cc: [email protected]
Signed-off-by: Linus Torvalds <[email protected]>
Commit
3af54c9bd9e6f14f896aac1bb0e8405ae0bc7a44
Parents
504b701b

Changes

1 files changed · +1 −0

FileStatusAddDelContent
ipc/shm.cmodified+1−0View file

ipc/shm.c

View file
diff --git a/ipc/shm.c b/ipc/shm.c
index fd658a1..7d3bb22 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -479,6 +479,7 @@ static inline unsigned long copy_shmid_to_user(void __user *buf, struct shmid64_
{
struct shmid_ds out;
+ memset(&out, 0, sizeof(out));
ipc64_perm_to_ipc_perm(&in->shm_perm, &out.shm_perm);
out.shm_segsz = in->shm_segsz;
out.shm_atime = in->shm_atime;