Skip to contentSkip to conversation

FAILED: patch "[PATCH] drm/i915: fix TLB invalidation for Gen12 video and compute" failed to apply to 5.15-stable tree

PATCH [email protected] 2 participants 5 messages Nov 30, 2022 – Dec 1, 2022

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

Possible dependencies:

04aa64375f48 ("drm/i915: fix TLB invalidation for Gen12 video and compute engines")
33da97894758 ("drm/i915/gt: Serialize TLB invalidates with GT resets")
7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store")
1176d15f0f6e ("Merge tag 'drm-intel-gt-next-2021-10-08' of git://anongit.freedesktop.org/drm/drm-intel into drm-next")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 04aa64375f48a5d430b5550d9271f8428883e550 Mon Sep 17 00:00:00 2001
From: Andrzej Hajda <[email protected]>
Date: Mon, 14 Nov 2022 11:38:24 +0100
Subject: [PATCH] drm/i915: fix TLB invalidation for Gen12 video and compute
engines

In case of Gen12 video and compute engines, TLB_INV registers are masked - to modify one bit, corresponding bit in upper half of the register must be enabled, otherwise nothing happens.

CVE: CVE-2022-4139

Fixes 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store")
drivers/gpu/drm/i915/gt/intel_gt.c +5 -0
index d0b03a928b9a..5c931b6696c3 100644
@@ -1017,6 +1017,11 @@ static void mmio_invalidate_full(struct intel_gt *gt)
 		if (!i915_mmio_reg_offset(rb.reg))
 			continue;
 
+		if (GRAPHICS_VER(i915) == 12 && (engine->class == VIDEO_DECODE_CLASS ||
+		    engine->class == VIDEO_ENHANCEMENT_CLASS ||
+		    engine->class == COMPUTE_CLASS))
+			rb.bit = _MASKED_BIT_ENABLE(rb.bit);
+
 		intel_uncore_write_fw(uncore, rb.reg, rb.bit);
 		awake |= engine->mask;
 	}
author maintainer
#1 lore raw
Quoted 6 lines · On Wed, Nov 30, 2022 at 06:59:57PM +0100, [email protected] wrote:

The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

Quoted 7 lines

Possible dependencies:

04aa64375f48 ("drm/i915: fix TLB invalidation for Gen12 video and compute engines")
33da97894758 ("drm/i915/gt: Serialize TLB invalidates with GT resets")
7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store")
1176d15f0f6e ("Merge tag 'drm-intel-gt-next-2021-10-08' of git://anongit.freedesktop.org/drm/drm-intel into drm-next")

Ah, wait, I found the tarball you sent for these, and have taken them for 5.4, 5.10, and 5.15 now (the original broke the build.) We still need them for older kernels though, that's still an issue.

thanks,

greg k-h

#2 lore raw
Quoted 8 lines · Greg KH
Quoted 7 lines · On Wed, Nov 30, 2022 at 06:59:57PM +0100, [email protected] wrote:

The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

Possible dependencies:

Quoted 8 lines
Quoted 5 lines

04aa64375f48 ("drm/i915: fix TLB invalidation for Gen12 video and compute engines")
33da97894758 ("drm/i915/gt: Serialize TLB invalidates with GT resets")
7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store")
1176d15f0f6e ("Merge tag 'drm-intel-gt-next-2021-10-08' of git://anongit.freedesktop.org/drm/drm-intel into drm-next")

Ah, wait, I found the tarball you sent for these, and have taken them for 5.4, 5.10, and 5.15 now (the original broke the build.) We still need them for older kernels though, that's still an issue.

Thanks for applying patches.
Older kernels ( < 5.4) do not have the patch to fix ("drm/i915: Flush TLBs before releasing backing store"), and they do not support Gen12 AFAIK, so it should be fine.

Regards
Andrzej

Quoted 4 lines

thanks,

greg k-h

author maintainer
#3 lore raw
Quoted 16 lines · Andrzej Hajda
Quoted 13 lines · Greg KH
Quoted 12 lines · On Wed, Nov 30, 2022 at 06:59:57PM +0100, [email protected] wrote:

The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

Possible dependencies:

04aa64375f48 ("drm/i915: fix TLB invalidation for Gen12 video and compute engines")
33da97894758 ("drm/i915/gt: Serialize TLB invalidates with GT resets")
7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store")
1176d15f0f6e ("Merge tag 'drm-intel-gt-next-2021-10-08' of git://anongit.freedesktop.org/drm/drm-intel into drm-next")

Quoted 8 lines
Quoted 3 lines

Ah, wait, I found the tarball you sent for these, and have taken them for 5.4, 5.10, and 5.15 now (the original broke the build.) We still need them for older kernels though, that's still an issue.

Thanks for applying patches.
Older kernels ( < 5.4) do not have the patch to fix ("drm/i915: Flush TLBs before releasing backing store"), and they do not support Gen12 AFAIK, so it should be fine.

The Fixes: tag in this commit references a commit that has been backported into a lot of older kernels:

git id: '7938d61591d33394a21bdd7797a245b65428f44c' is in: 4.4.301 4.9.299 4.14.264 4.19.227 5.4.175 5.10.95 5.15.18 5.16.4 5.17

So is the Fixes tag incorrect?

thanks,

greg k-h

#4 lore raw
Quoted 23 lines · Greg KH
Quoted 15 lines · Andrzej Hajda
Quoted 13 lines · Greg KH
Quoted 12 lines · On Wed, Nov 30, 2022 at 06:59:57PM +0100, [email protected] wrote:

The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

Possible dependencies:

04aa64375f48 ("drm/i915: fix TLB invalidation for Gen12 video and compute engines")
33da97894758 ("drm/i915/gt: Serialize TLB invalidates with GT resets")
7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store")
1176d15f0f6e ("Merge tag 'drm-intel-gt-next-2021-10-08' of git://anongit.freedesktop.org/drm/drm-intel into drm-next")

Quoted 7 lines
Quoted 3 lines

Ah, wait, I found the tarball you sent for these, and have taken them for 5.4, 5.10, and 5.15 now (the original broke the build.) We still need them for older kernels though, that's still an issue.

Thanks for applying patches.
Older kernels ( < 5.4) do not have the patch to fix ("drm/i915: Flush TLBs before releasing backing store"), and they do not support Gen12 AFAIK, so it should be fine.

Quoted 6 lines

The Fixes: tag in this commit references a commit that has been backported into a lot of older kernels:

git id: '7938d61591d33394a21bdd7797a245b65428f44c' is in: 4.4.301 4.9.299 4.14.264 4.19.227 5.4.175 5.10.95 5.15.18 5.16.4 5.17

So is the Fixes tag incorrect?

My fault, they do contain the patch, and I was just looking by code path.
Anyway backports for kernel below 5.4 do not contain gen12 part so they are fine - the bug was only in gen12.

Regards
Andrzej

Quoted 4 lines

thanks,

greg k-h