]> git.ipfire.org Git - people/arne_f/kernel.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Jun 2017 10:07:51 +0000 (12:07 +0200)
commitde417ea6b0a607e79b765838d397c0eb0bcb62d9
treecf07884a3847d90cb5ab5704694fc38339265dd1
parentc2ad2dc3d2648d603e7ab7dff4c6b38122206673
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