Skip to content

Commit

Permalink
fs/compat_ioctl.c: VIDEO_SET_SPU_PALETTE missing error check
Browse files Browse the repository at this point in the history
The compat ioctl for VIDEO_SET_SPU_PALETTE was missing an error check
while converting ioctl arguments.  This could lead to leaking kernel
stack contents into userspace.

Patch extracted from existing fix in grsecurity.

Signed-off-by: Kees Cook <[email protected]>
Cc: David Miller <[email protected]>
Cc: Brad Spengler <[email protected]>
Cc: PaX Team <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
kees authored and torvalds committed Oct 25, 2012
1 parent 20f1de6 commit 1217650
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/compat_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ static int do_video_set_spu_palette(unsigned int fd, unsigned int cmd,

err = get_user(palp, &up->palette);
err |= get_user(length, &up->length);
if (err)
return -EFAULT;

up_native = compat_alloc_user_space(sizeof(struct video_spu_palette));
err = put_user(compat_ptr(palp), &up_native->palette);
Expand Down

0 comments on commit 1217650

Please sign in to comment.