]> git.hungrycats.org Git - linux/commitdiff
drm/xe/rtp: Add RING_FORCE_TO_NONPRIV_DENY to OA whitelists
authorAshutosh Dixit <ashutosh.dixit@intel.com>
Mon, 15 Jun 2026 22:42:19 +0000 (15:42 -0700)
committerAshutosh Dixit <ashutosh.dixit@intel.com>
Mon, 22 Jun 2026 19:28:33 +0000 (12:28 -0700)
Unconditionally whitelisting OA registers is a security violation. Set
RING_FORCE_TO_NONPRIV_DENY bit in OA nonpriv slots, so that OA registers
don't get whitelisted by default after probe, gt reset, resume and engine
reset.

Fixes: 828a8eaf37c3 ("drm/xe/oa: Add MMIO trigger support")
Cc: stable@vger.kernel.org # v6.12+
Suggested-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Link: https://patch.msgid.link/20260615224227.34880-2-ashutosh.dixit@intel.com
drivers/gpu/drm/xe/xe_reg_whitelist.c

index 2e84b1c49f3749a0ccfea5c752fc2c82ae3a9c6e..2d8ddb57412c258fe5b303ec41c2890ad59c7182 100644 (file)
@@ -104,10 +104,12 @@ static const struct xe_rtp_table_sr register_whitelist = XE_RTP_TABLE_SR(
                                   RING_FORCE_TO_NONPRIV_ACCESS_RW))
        },
 
+#define WHITELIST_DENY(r, f) WHITELIST(r, (f) | RING_FORCE_TO_NONPRIV_DENY)
+
 #define WHITELIST_OA_MMIO_TRG(trg, status, head) \
-       WHITELIST(trg, RING_FORCE_TO_NONPRIV_ACCESS_RW), \
-       WHITELIST(status, RING_FORCE_TO_NONPRIV_ACCESS_RD), \
-       WHITELIST(head, RING_FORCE_TO_NONPRIV_ACCESS_RD | RING_FORCE_TO_NONPRIV_RANGE_4)
+       WHITELIST_DENY(trg, RING_FORCE_TO_NONPRIV_ACCESS_RW), \
+       WHITELIST_DENY(status, RING_FORCE_TO_NONPRIV_ACCESS_RD), \
+       WHITELIST_DENY(head, RING_FORCE_TO_NONPRIV_ACCESS_RD | RING_FORCE_TO_NONPRIV_RANGE_4)
 
 #define WHITELIST_OAG_MMIO_TRG \
        WHITELIST_OA_MMIO_TRG(OAG_MMIOTRIGGER, OAG_OASTATUS, OAG_OAHEADPTR)