]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
xfs: don't call xfs_da_shrink_inode with NULL bp
authorEric Sandeen <sandeen@sandeen.net>
Mon, 16 Jul 2018 04:44:49 +0000 (12:44 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:30:18 +0000 (12:30 +0200)
commitd48617610a12a2a80799db7c466f041aba275e29
tree9d5e3f4ab15f9fbef41b5f5629dabd11c7433d0a
parentebd8ccf840103e2d3e32b10520fd510a68ca825c
xfs: don't call xfs_da_shrink_inode with NULL bp

CVE-2018-13094

xfs_attr3_leaf_create may have errored out before instantiating a buffer,
for example if the blkno is out of range.  In that case there is no work
to do to remove it, and in fact xfs_da_shrink_inode will lead to an oops
if we try.

This also seems to fix a flaw where the original error from
xfs_attr3_leaf_create gets overwritten in the cleanup case, and it
removes a pointless assignment to bp which isn't used after this.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199969
Reported-by: Xu, Wen <wen.xu@gatech.edu>
Tested-by: Xu, Wen <wen.xu@gatech.edu>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
(cherry picked from commit bb3d48dcf86a97dc25fe9fc2c11938e19cb4399a)
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Aaron Ma <aaron.ma@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/xfs/libxfs/xfs_attr_leaf.c