Blame SOURCES/CVE-2022-4139.patch

cf3d8e
From 23b83d20ee925f9c6fd81e24e56081f35fec4c7c Mon Sep 17 00:00:00 2001
cf3d8e
From: Yannick Cote <ycote@redhat.com>
cf3d8e
Date: Mon, 12 Dec 2022 18:57:27 -0500
cf3d8e
Subject: [KPATCH CVE-2022-4139] kpatch fixes for CVE-2022-4139
cf3d8e
cf3d8e
Kernels:
cf3d8e
5.14.0-162.6.1.el9_1
cf3d8e
cf3d8e
cf3d8e
Kpatch-MR: https://gitlab.com/redhat/prdsc/rhel/src/kpatch/rhel-9/-/merge_requests/13
cf3d8e
Approved-by: Joe Lawrence (@joe.lawrence)
cf3d8e
Changes since last build:
cf3d8e
[x86_64]:
cf3d8e
ax88179_178a.o: changed function: ax88179_rx_fixup
cf3d8e
callback_xdr.o: changed function: nfs_callback_dispatch
cf3d8e
intel_gt.o: changed function: intel_gt_invalidate_tlbs
cf3d8e
nfs3proc.o: changed function: nfsd3_init_dirlist_pages
cf3d8e
nfs3proc.o: changed function: nfsd3_proc_read
cf3d8e
nfsproc.o: changed function: nfsd_proc_read
cf3d8e
nfsproc.o: changed function: nfsd_proc_readdir
cf3d8e
nfssvc.o: changed function: nfsd_dispatch
cf3d8e
pipe.o: changed function: pipe_resize_ring
cf3d8e
svc.o: changed function: nlmsvc_dispatch
cf3d8e
cf3d8e
[ppc64le]:
cf3d8e
ax88179_178a.o: changed function: ax88179_rx_fixup
cf3d8e
callback_xdr.o: changed function: nfs_callback_dispatch
cf3d8e
nfs3proc.o: changed function: nfsd3_init_dirlist_pages
cf3d8e
nfs3proc.o: changed function: nfsd3_proc_read
cf3d8e
nfsproc.o: changed function: nfsd_proc_read
cf3d8e
nfsproc.o: changed function: nfsd_proc_readdir
cf3d8e
nfssvc.o: changed function: nfsd_dispatch
cf3d8e
pipe.o: changed function: pipe_resize_ring
cf3d8e
svc.o: changed function: nlmsvc_dispatch
cf3d8e
cf3d8e
---------------------------
cf3d8e
cf3d8e
Modifications: none
cf3d8e
cf3d8e
commit 77eddcf995483fabb6d7c81bef19dc69c697b16e
cf3d8e
Author: Wander Lairson Costa <wander@redhat.com>
cf3d8e
Date:   Thu Dec 1 10:24:37 2022 -0300
cf3d8e
cf3d8e
    drm/i915: fix TLB invalidation for Gen12 video and compute engines
cf3d8e
cf3d8e
    Bugzilla: https://bugzilla.redhat.com/2148152
cf3d8e
    CVE: CVE-2022-4139
cf3d8e
    Y-Commit: 98336d51bfacb10fd4b73432beac0fe95d73bf7c
cf3d8e
cf3d8e
    O-Bugzilla: https://bugzilla.redhat.com/2148153
cf3d8e
    O-CVE: CVE-2022-4139
cf3d8e
cf3d8e
    commit 04aa64375f48a5d430b5550d9271f8428883e550
cf3d8e
    Author: Andrzej Hajda <andrzej.hajda@intel.com>
cf3d8e
    Date:   Mon Nov 14 11:38:24 2022 +0100
cf3d8e
cf3d8e
        drm/i915: fix TLB invalidation for Gen12 video and compute engines
cf3d8e
cf3d8e
        In case of Gen12 video and compute engines, TLB_INV registers are masked -
cf3d8e
        to modify one bit, corresponding bit in upper half of the register must
cf3d8e
        be enabled, otherwise nothing happens.
cf3d8e
cf3d8e
        CVE: CVE-2022-4139
cf3d8e
        Suggested-by: Chris Wilson <chris.p.wilson@intel.com>
cf3d8e
        Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
cf3d8e
        Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
cf3d8e
        Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store")
cf3d8e
        Cc: stable@vger.kernel.org
cf3d8e
        Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
cf3d8e
cf3d8e
    Signed-off-by: Wander Lairson Costa <wander@redhat.com>
cf3d8e
    Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
cf3d8e
cf3d8e
Signed-off-by: Yannick Cote <ycote@redhat.com>
cf3d8e
---
cf3d8e
 drivers/gpu/drm/i915/gt/intel_gt.c | 5 +++++
cf3d8e
 1 file changed, 5 insertions(+)
cf3d8e
cf3d8e
diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
cf3d8e
index f4375479e6f0..1cb9971759d2 100644
cf3d8e
--- a/drivers/gpu/drm/i915/gt/intel_gt.c
cf3d8e
+++ b/drivers/gpu/drm/i915/gt/intel_gt.c
cf3d8e
@@ -1021,6 +1021,11 @@ void intel_gt_invalidate_tlbs(struct intel_gt *gt)
cf3d8e
 		if (!i915_mmio_reg_offset(rb.reg))
cf3d8e
 			continue;
cf3d8e
 
cf3d8e
+		if (GRAPHICS_VER(i915) == 12 && (engine->class == VIDEO_DECODE_CLASS ||
cf3d8e
+		    engine->class == VIDEO_ENHANCEMENT_CLASS ||
cf3d8e
+		    engine->class == COMPUTE_CLASS))
cf3d8e
+			rb.bit = _MASKED_BIT_ENABLE(rb.bit);
cf3d8e
+
cf3d8e
 		intel_uncore_write_fw(uncore, rb.reg, rb.bit);
cf3d8e
 	}
cf3d8e
 
cf3d8e
-- 
cf3d8e
2.39.0
cf3d8e
cf3d8e