video: tegra: host: check if offset is u32 aligned
authorDeepak Nibade <dnibade@nvidia.com>
Fri, 11 Mar 2016 08:29:20 +0000 (13:29 +0530)
committerManish Tuteja <mtuteja@nvidia.com>
Wed, 16 Mar 2016 08:28:18 +0000 (01:28 -0700)
commit035c794304c65296a0ee303d31ee4a275fb1fbeb
treea2656542c9289410d4926ba5e38467583598fc5d
parentf45ae9497494ba18fca6238a5adebafb69a6738c
video: tegra: host: check if offset is u32 aligned

In nvhost_ioctl_ctrl_module_regrdwr(), we copy offset
to read/write from user space but we do not have
any check on it

So it is possible for user space to add unaligned
offset and request read/write which would crash the
system

Fix this by explicitly checking alignment of the
offset passed by user space

Bug 1739935

Change-Id: Iea2a07c60500af876b732a0e9d9d08535aa53b5c
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1029405
(cherry picked from commit 422baa09a17a6a17f4e572aa5441ca174634de0d)
Reviewed-on: http://git-master/r/1111328
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Manish Tuteja <mtuteja@nvidia.com>
Tested-by: Manish Tuteja <mtuteja@nvidia.com>
drivers/video/tegra/host/bus_client.c