From: Kees Cook <[email protected]> Subject: fs/compat_ioctl.c: VIDEO_SET_SPU_PALETTE missing error check
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]> --- fs/compat_ioctl.c | 2 ++ 1 file changed, 2 insertions(+) diff -puN fs/compat_ioctl.c~fs-compat_ioctlc-video_set_spu_palette-missing-error-check fs/compat_ioctl.c --- a/fs/compat_ioctl.c~fs-compat_ioctlc-video_set_spu_palette-missing-error-check +++ a/fs/compat_ioctl.c @@ -210,6 +210,8 @@ static int do_video_set_spu_palette(unsi 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); _ -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
