diff --git a/debian/changelog b/debian/changelog index 2197768c6..1ca557ab1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,6 +21,8 @@ linux (4.16.4-1) UNRELEASED; urgency=medium * Revert "ext4: add validity checks for bitmap block numbers", which caused a regression * xfs: enhance dinode verifier (CVE-2018-10322) + * xfs: set format back to extents if xfs_bmap_extents_to_btree + (CVE-2018-10323) [ Vagrant Cascadian ] * [arm64] Add patches to support SATA on Tegra210/Jetson-TX1. diff --git a/debian/patches/bugfix/all/xfs-set-format-back-to-extents-if-xfs_bmap_extents_t.patch b/debian/patches/bugfix/all/xfs-set-format-back-to-extents-if-xfs_bmap_extents_t.patch new file mode 100644 index 000000000..dc206006e --- /dev/null +++ b/debian/patches/bugfix/all/xfs-set-format-back-to-extents-if-xfs_bmap_extents_t.patch @@ -0,0 +1,43 @@ +From: Eric Sandeen +Date: Mon, 16 Apr 2018 23:07:27 -0700 +Subject: xfs: set format back to extents if xfs_bmap_extents_to_btree +Origin: https://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git/commit?id=2c4306f719b083d17df2963bc761777576b8ad1b +Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2018-10323 + +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 +Reviewed-by: Christoph Hellwig +Reviewed-by: Darrick J. Wong +Signed-off-by: Darrick J. Wong +--- + fs/xfs/libxfs/xfs_bmap.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c +index 6a7c2f03ea11..040eeda8426f 100644 +--- a/fs/xfs/libxfs/xfs_bmap.c ++++ b/fs/xfs/libxfs/xfs_bmap.c +@@ -725,12 +725,16 @@ xfs_bmap_extents_to_btree( + *logflagsp = 0; + if ((error = xfs_alloc_vextent(&args))) { + xfs_iroot_realloc(ip, -1, whichfork); ++ ASSERT(ifp->if_broot == NULL); ++ XFS_IFORK_FMT_SET(ip, whichfork, XFS_DINODE_FMT_EXTENTS); + xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); + return error; + } + + if (WARN_ON_ONCE(args.fsbno == NULLFSBLOCK)) { + xfs_iroot_realloc(ip, -1, whichfork); ++ ASSERT(ifp->if_broot == NULL); ++ XFS_IFORK_FMT_SET(ip, whichfork, XFS_DINODE_FMT_EXTENTS); + xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); + return -ENOSPC; + } diff --git a/debian/patches/series b/debian/patches/series index 0cb520984..b4e988379 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -140,6 +140,7 @@ features/all/lockdown/arm64-add-kernel-config-option-to-lock-down-when.patch # Security fixes debian/i386-686-pae-pci-set-pci-nobios-by-default.patch bugfix/all/xfs-enhance-dinode-verifier.patch +bugfix/all/xfs-set-format-back-to-extents-if-xfs_bmap_extents_t.patch # Fix exported symbol versions bugfix/all/module-disable-matching-missing-version-crc.patch