Skip to content

Commit

Permalink
ipc: shm: fix information leak to userland
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
segoon authored and torvalds committed Oct 30, 2010
1 parent 504b701 commit 3af54c9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ipc/shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3af54c9

Please sign in to comment.