Blame SOURCES/CVE-2021-4155.patch

b97a6b
From cec4ee812b7c642c552c64c488a299323d622638 Mon Sep 17 00:00:00 2001
b97a6b
From: Joe Lawrence <joe.lawrence@redhat.com>
b97a6b
Date: Fri, 7 Jan 2022 14:11:20 -0500
b97a6b
Subject: [KPATCH CVE-2021-4155] xfs: kpatch fixes for CVE-2021-4155
b97a6b
b97a6b
Kernels:
b97a6b
4.18.0-348.el8
b97a6b
4.18.0-348.2.1.el8_5
b97a6b
4.18.0-348.7.1.el8_5
b97a6b
b97a6b
Changes since last build:
b97a6b
arches: x86_64 ppc64le
b97a6b
xfs_ioctl.o: changed function: xfs_ioc_space
b97a6b
---------------------------
b97a6b
b97a6b
Kpatch-MR: https://gitlab.com/redhat/prdsc/rhel/src/kpatch/rhel-8/-/merge_requests/12
b97a6b
Approved-by: Artem Savkov (@artem.savkov)
b97a6b
Kernels:
b97a6b
4.18.0-348.el8
b97a6b
4.18.0-348.2.1.el8_5
b97a6b
4.18.0-348.7.1.el8_5
b97a6b
b97a6b
Modifications: none
b97a6b
b97a6b
Z-MR: https://gitlab.com/redhat/prdsc/rhel/src/kernel-private/rhel-8/-/merge_requests/28
b97a6b
b97a6b
KT0 test PASS: https://beaker.engineering.redhat.com/jobs/6173055
b97a6b
for kpatch-patch-4_18_0-348-1-2.el8 scratch build:
b97a6b
https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=42267085
b97a6b
b97a6b
commit 374251004418783ae2e1e191b957cf63e3796d5e
b97a6b
Author: Bruno Meneguele <bmeneg@redhat.com>
b97a6b
Date:   Thu Jan 6 17:19:24 2022 -0300
b97a6b
b97a6b
    xfs: map unwritten blocks in XFS_IOC_{ALLOC,FREE}SP just like fallocate
b97a6b
b97a6b
    Bugzilla: https://bugzilla.redhat.com/2034864
b97a6b
    CVE: CVE-2021-4155
b97a6b
b97a6b
    O-Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2034865
b97a6b
    O-CVE: CVE-2021-4155
b97a6b
    Tested: xfstests and specific reproducer
b97a6b
    Upstream status: Posted privately due to embargo
b97a6b
b97a6b
    The old ALLOCSP/FREESP ioctls in XFS can be used to preallocate space at
b97a6b
    the end of files, just like fallocate and RESVSP.  Make the behavior
b97a6b
    consistent with the other ioctls.
b97a6b
b97a6b
    Reported-by: Kirill Tkhai <ktkhai@virtuozzo.com>
b97a6b
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
b97a6b
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
b97a6b
    Reviewed-by: Dave Chinner <dchinner@redhat.com>
b97a6b
    Reviewed-by: Eric Sandeen <sandeen@redhat.com>
b97a6b
    (cherry picked from commit 983d8e60f50806f90534cc5373d0ce867e5aaf79)
b97a6b
b97a6b
    Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
b97a6b
    Signed-off-by: Bruno Meneguele <bmeneg@redhat.com>
b97a6b
b97a6b
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
b97a6b
---
b97a6b
 fs/xfs/xfs_ioctl.c | 3 ++-
b97a6b
 1 file changed, 2 insertions(+), 1 deletion(-)
b97a6b
b97a6b
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
b97a6b
index 2a68819e4fe5..7d9c76c5cfb0 100644
b97a6b
--- a/fs/xfs/xfs_ioctl.c
b97a6b
+++ b/fs/xfs/xfs_ioctl.c
b97a6b
@@ -686,7 +686,8 @@ xfs_ioc_space(
b97a6b
 
b97a6b
 	if (bf->l_start > XFS_ISIZE(ip)) {
b97a6b
 		error = xfs_alloc_file_space(ip, XFS_ISIZE(ip),
b97a6b
-				bf->l_start - XFS_ISIZE(ip), 0);
b97a6b
+				bf->l_start - XFS_ISIZE(ip),
b97a6b
+				XFS_BMAPI_PREALLOC);
b97a6b
 		if (error)
b97a6b
 			goto out_unlock;
b97a6b
 	}
b97a6b
-- 
b97a6b
2.26.3
b97a6b
b97a6b