xfs: fix over-copying of getbmap parameters from userspace
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 3 Apr 2017 22:17:57 +0000 (15:17 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 3 Apr 2017 22:18:16 +0000 (15:18 -0700)
commitbe6324c00c4d1e0e665f03ed1fc18863a88da119
tree276214b108e95e5bec99e26e7087c384b8f590d2
parent422e5b53ed83dd71c1eac276c6ec7f7c6e81ce8d
xfs: fix over-copying of getbmap parameters from userspace

In xfs_ioc_getbmap, we should only copy the fields of struct getbmap
from userspace, or else we end up copying random stack contents into the
kernel.  struct getbmap is a strict subset of getbmapx, so a partial
structure copy should work fine.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_ioctl.c