Blame SOURCES/CVE-2022-4139.patch

6e64c9
From 1b00ec2d7916551eda170e687eb351d40fe346aa Mon Sep 17 00:00:00 2001
6e64c9
From: Joe Lawrence <joe.lawrence@redhat.com>
6e64c9
Date: Tue, 3 Jan 2023 11:02:47 -0500
6e64c9
Subject: [KPATCH CVE-2022-4139] kpatch fixes for CVE-2022-4139
6e64c9
Content-type: text/plain
6e64c9
6e64c9
Kernels:
6e64c9
4.18.0-425.3.1.el8
6e64c9
6e64c9
Changes since last build:
6e64c9
arches: x86_64
6e64c9
intel_gt.o: changed function: intel_gt_invalidate_tlbs
6e64c9
---------------------------
6e64c9
6e64c9
Kpatch-MR: https://gitlab.com/redhat/prdsc/rhel/src/kpatch/rhel-8/-/merge_requests/66
6e64c9
Approved-by: Julia Denham (@jdenham)
6e64c9
Modifications: none
6e64c9
6e64c9
commit 54c6de5154c319e30fddef4fc82a67661525b76e
6e64c9
Author: Wander Lairson Costa <wander@redhat.com>
6e64c9
Date:   Thu Dec 1 10:30:34 2022 -0300
6e64c9
6e64c9
    drm/i915: fix TLB invalidation for Gen12 video and compute engines
6e64c9
6e64c9
    Bugzilla: https://bugzilla.redhat.com/2148149
6e64c9
    CVE: CVE-2022-4139
6e64c9
    Y-Commit: 03abd2e51e4b208b873f7fd749d1af0ebef6658f
6e64c9
6e64c9
    O-Bugzilla: https://bugzilla.redhat.com/2148150
6e64c9
    O-CVE: CVE-2022-4139
6e64c9
6e64c9
    commit 04aa64375f48a5d430b5550d9271f8428883e550
6e64c9
    Author: Andrzej Hajda <andrzej.hajda@intel.com>
6e64c9
    Date:   Mon Nov 14 11:38:24 2022 +0100
6e64c9
6e64c9
        drm/i915: fix TLB invalidation for Gen12 video and compute engines
6e64c9
6e64c9
        In case of Gen12 video and compute engines, TLB_INV registers are masked -
6e64c9
        to modify one bit, corresponding bit in upper half of the register must
6e64c9
        be enabled, otherwise nothing happens.
6e64c9
6e64c9
        CVE: CVE-2022-4139
6e64c9
        Suggested-by: Chris Wilson <chris.p.wilson@intel.com>
6e64c9
        Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
6e64c9
        Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
6e64c9
        Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store")
6e64c9
        Cc: stable@vger.kernel.org
6e64c9
        Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
6e64c9
6e64c9
    Signed-off-by: Wander Lairson Costa <wander@redhat.com>
6e64c9
    Signed-off-by: Jarod Wilson <jarod@redhat.com>
6e64c9
6e64c9
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
6e64c9
---
6e64c9
 drivers/gpu/drm/i915/gt/intel_gt.c | 5 +++++
6e64c9
 1 file changed, 5 insertions(+)
6e64c9
6e64c9
diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
6e64c9
index f4375479e6f0..1cb9971759d2 100644
6e64c9
--- a/drivers/gpu/drm/i915/gt/intel_gt.c
6e64c9
+++ b/drivers/gpu/drm/i915/gt/intel_gt.c
6e64c9
@@ -1021,6 +1021,11 @@ void intel_gt_invalidate_tlbs(struct intel_gt *gt)
6e64c9
 		if (!i915_mmio_reg_offset(rb.reg))
6e64c9
 			continue;
6e64c9
 
6e64c9
+		if (GRAPHICS_VER(i915) == 12 && (engine->class == VIDEO_DECODE_CLASS ||
6e64c9
+		    engine->class == VIDEO_ENHANCEMENT_CLASS ||
6e64c9
+		    engine->class == COMPUTE_CLASS))
6e64c9
+			rb.bit = _MASKED_BIT_ENABLE(rb.bit);
6e64c9
+
6e64c9
 		intel_uncore_write_fw(uncore, rb.reg, rb.bit);
6e64c9
 	}
6e64c9
 
6e64c9
-- 
6e64c9
2.39.0
6e64c9
6e64c9