]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xfs: set format back to extents if xfs_bmap_extents_to_btree
authorEric Sandeen <sandeen@redhat.com>
Tue, 17 Apr 2018 06:07:27 +0000 (23:07 -0700)
committerBrian Maly <brian.maly@oracle.com>
Mon, 21 May 2018 20:51:40 +0000 (16:51 -0400)
commit5ea6087558f2c82119e1d1694c6484c1ed75dfd9
treea207541b897cd18219f855498e5caeb0ce33ed7b
parent6b37dea0a07c0e98fb4e4e26713a0cfc7f77a2ba
xfs: set format back to extents if xfs_bmap_extents_to_btree

If xfs_bmap_extents_to_btree fails in a mode where we call
xfs_iroot_realloc(-1) to de-allocate the root, set the
format back to extents.

Otherwise we can assume we can dereference ifp->if_broot
based on the XFS_DINODE_FMT_BTREE format, and crash.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199423
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
(cherry picked from commit 2c4306f719b083d17df2963bc761777576b8ad1b)

Orabug: 27963576
CVE: CVE-2018-10323
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
fs/xfs/libxfs/xfs_bmap.c
Drop a part of the patch which is inapplicable to the current kernel.
The WARN_ON_ONCE in the dropped part is introduced in the upstream
commit 2fcc319d2467 as a debugging facility since v4.11 kernel.

Signed-off-by: Shan Hai <shan.hai@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
fs/xfs/libxfs/xfs_bmap.c