Browse files

ipc: shm: fix information leak to userland

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

Signed-off-by: Vasiliy Kulikov <>
Acked-by: Al Viro <>
Signed-off-by: Linus Torvalds <>
  • Loading branch information...
segoon authored and torvalds committed Oct 30, 2010
1 parent 504b701 commit 3af54c9bd9e6f14f896aac1bb0e8405ae0bc7a44
Showing with 1 addition and 0 deletions.
  1. +1 −0 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;

0 comments on commit 3af54c9

Please sign in to comment.