diff options
author | Vasiliy Kulikov <segooon@gmail.com> | 2010-10-30 18:22:49 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-09 13:26:43 -0800 |
commit | b84f1092385101cc432d2afce0bd52ce4d643018 (patch) | |
tree | e3f2f2cfa7b98e63ea9072d5c7664d8aa0cb72b0 /ipc/shm.c | |
parent | 6606de00cc2053b821d7db0ab22aaa8af2ea6143 (diff) |
ipc: shm: fix information leak to userland
commit 3af54c9bd9e6f14f896aac1bb0e8405ae0bc7a44 upstream.
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 <segooon@gmail.com>
Acked-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'ipc/shm.c')
-rw-r--r-- | ipc/shm.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ipc/shm.c b/ipc/shm.c index e9b039f7412..d30732c9759 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -474,6 +474,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; |