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

Change-Id: I87d19147d3b8e0d0362b0a5775d99aebd2d72a5f
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/333834
Commit-Ready: Vince Hsu <vince.h@nvidia.com>
Tested-by: Vince Hsu <vince.h@nvidia.com>
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
(cherry picked from commit fa848cbb73d87c1c0f563c0a04d809cba2174808)
Reviewed-on: https://chromium-review.googlesource.com/337157
Commit-Queue: Andrew Bresticker <abrestic@chromium.org>
Tested-by: Andrew Bresticker <abrestic@chromium.org>
1 file changed