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)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 23 Jul 2017 02:53:24 +0000 (02:53 +0000)
commit55420fa4d96651d2edf9e04e6cc5c583bce0b366
tree2990672e8c4033a839d06edfc9f4446f2ad9c8ad
parent0422a61cc786a113f4a42f2e8dd749f84999bd33
xfs: fix over-copying of getbmap parameters from userspace

commit be6324c00c4d1e0e665f03ed1fc18863a88da119 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_ioctl.c