media: v4l2-compat-ioctl32.c: avoid sizeof(type) 81/175681/1
authorHans Verkuil <hans.verkuil@cisco.com>
Wed, 28 Mar 2018 18:12:25 +0000 (15:12 -0300)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 11 Apr 2018 11:56:41 +0000 (20:56 +0900)
commitf50e9a274996c0bea9f47c10643e905798c2321e
tree5af01deb9e3eeda65a0b0086db37ac5940fed5bd
parent70328a94857ff03f9eb986ca092511135c8046df
media: v4l2-compat-ioctl32.c: avoid sizeof(type)

commit 333b1e9f96ce05f7498b581509bb30cde03018bf upstream.

Instead of doing sizeof(struct foo) use sizeof(*up). There even were
cases where 4 * sizeof(__u32) was used instead of sizeof(kp->reserved),
which is very dangerous when the size of the reserved array changes.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[sw0312.kim: cherry-pick from linux-3.18.y to apply CVE patch]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I66c5ebf8cdf0a7fbd15c236804f85f7fc77422b3
drivers/media/v4l2-core/v4l2-compat-ioctl32.c