drm/amdgpu: Gate debugfs MMIO access on kernel lockdown
Subsystems (2)
PATCH v3 1/1 drm/amdgpu: Gate debugfs MMIO access on kernel lockdown
amdgpu_regs, amdgpu_regs2, and related debugfs nodes allow arbitrary MMIO read/write via RREG32/WREG32 without checking security_locked_down(). On kernel_lockdown=integrity systems this bypasses the same restrictions as /dev/mem and PCI config space sysfs.
Check LOCKDOWN_PCI_ACCESS (matching pci-sysfs) at the entry of every debugfs handler that performs direct register access.
v2: Use consistent check as per previous check to use LOCKDOWN_DEBUGFS(Lijo)
v3: Do not create any entry from amdgpu_debugfs_regs_init() if LOCKDOWN_PCI_ACCESS is active and log once. (Lijo)
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +7 -0
@@ -26,6 +26,7 @@#include <linux/kthread.h> #include <linux/pci.h> #include <linux/uaccess.h> +#include <linux/security.h> #include <linux/pm_runtime.h> #include "amdgpu.h"
@@ -1739,6 +1740,12 @@ int amdgpu_debugfs_regs_init(struct amdgpu_device *adev)struct dentry *ent, *root = minor->debugfs_root;unsigned int i; +if (security_locked_down (LOCKDOWN_PCI_ACCESS )) { +drm_info (adev_to_drm (adev), +"amdgpu: HW debugfs nodes disabled (kernel lockdown)\n" ); +return 0 ; + } +for (i =0 ; i <ARRAY_SIZE (debugfs_regs); i++) { ent = debugfs_create_file(debugfs_regs_names[i], S_IFREG | 0400, root,
Signature · 1 line
2.46.0
HI Asad,
This should be fine for umr. UMR detects when the lockdown mode isn't "none" and warns the user that the tool might not work.
So the net effect of this patch is the debugfs files are just not created at all? That'll likely cause umr discovery to fail (after it prints he warning) which is still fine.
Tom
________________________________________
From: Kamal, Asad <[email protected]>
Sent: Wednesday, June 3, 2026 07:44
To: [email protected]
Cc: Lazar, Lijo; Zhang, Hawking; Ma, Le; Zhang, Morris; Deucher, Alexander; Wang, Yang(Kevin); Kamal, Asad; StDenis, Tom
Subject: [PATCH v3] drm/amdgpu: Gate debugfs MMIO access on kernel lockdown
amdgpu_regs, amdgpu_regs2, and related debugfs nodes allow arbitrary MMIO read/write via RREG32/WREG32 without checking security_locked_down(). On kernel_lockdown=integrity systems this bypasses the same restrictions as /dev/mem and PCI config space sysfs.
Check LOCKDOWN_PCI_ACCESS (matching pci-sysfs) at the entry of every debugfs handler that performs direct register access.
v2: Use consistent check as per previous check to use LOCKDOWN_DEBUGFS(Lijo)
v3: Do not create any entry from amdgpu_debugfs_regs_init() if LOCKDOWN_PCI_ACCESS is active and log once. (Lijo)
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +7 -0
@@ -26,6 +26,7 @@#include <linux/kthread.h> #include <linux/pci.h> #include <linux/uaccess.h> +#include <linux/security.h> #include <linux/pm_runtime.h> #include "amdgpu.h"
@@ -1739,6 +1740,12 @@ int amdgpu_debugfs_regs_init(struct amdgpu_device *adev)struct dentry *ent, *root = minor->debugfs_root;unsigned int i; +if (security_locked_down (LOCKDOWN_PCI_ACCESS )) { +drm_info (adev_to_drm (adev), +"amdgpu: HW debugfs nodes disabled (kernel lockdown)\n" ); +return 0 ; + } +for (i =0 ; i <ARRAY_SIZE (debugfs_regs); i++) { ent = debugfs_create_file(debugfs_regs_names[i], S_IFREG | 0400, root,
--
2.46.0
AMD General
Hi Dennis,
Yes, debugfs file(amdgpu_regs) wont be created when lockdown mode is not "none".
Thanks & Regards
Asad
-----Original Message-----
From: StDenis, Tom <[email protected]>
Sent: Wednesday, June 3, 2026 6:00 PM
To: Kamal, Asad <[email protected]>; [email protected]
Cc: Lazar, Lijo <[email protected]>; Zhang, Hawking <[email protected]>; Ma, Le <[email protected]>; Zhang, Morris <[email protected]>; Deucher, Alexander <[email protected]>; Wang, Yang(Kevin) <[email protected]>
Subject: Re: [PATCH v3] drm/amdgpu: Gate debugfs MMIO access on kernel lockdown
HI Asad,
This should be fine for umr. UMR detects when the lockdown mode isn't "none" and warns the user that the tool might not work.
So the net effect of this patch is the debugfs files are just not created at all? That'll likely cause umr discovery to fail (after it prints he warning) which is still fine.
Tom
________________________________________
From: Kamal, Asad <[email protected]>
Sent: Wednesday, June 3, 2026 07:44
To: [email protected]
Cc: Lazar, Lijo; Zhang, Hawking; Ma, Le; Zhang, Morris; Deucher, Alexander; Wang, Yang(Kevin); Kamal, Asad; StDenis, Tom
Subject: [PATCH v3] drm/amdgpu: Gate debugfs MMIO access on kernel lockdown
amdgpu_regs, amdgpu_regs2, and related debugfs nodes allow arbitrary MMIO read/write via RREG32/WREG32 without checking security_locked_down(). On kernel_lockdown=integrity systems this bypasses the same restrictions as /dev/mem and PCI config space sysfs.
Check LOCKDOWN_PCI_ACCESS (matching pci-sysfs) at the entry of every debugfs handler that performs direct register access.
v2: Use consistent check as per previous check to use LOCKDOWN_DEBUGFS(Lijo)
v3: Do not create any entry from amdgpu_debugfs_regs_init() if LOCKDOWN_PCI_ACCESS is active and log once. (Lijo)
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +7 -0
@@ -26,6 +26,7 @@#include <linux/kthread.h> #include <linux/pci.h> #include <linux/uaccess.h> +#include <linux/security.h> #include <linux/pm_runtime.h> #include "amdgpu.h"
@@ -1739,6 +1740,12 @@ int amdgpu_debugfs_regs_init(struct amdgpu_device *adev)struct dentry *ent, *root = minor->debugfs_root;unsigned int i; +if (security_locked_down (LOCKDOWN_PCI_ACCESS )) { +drm_info (adev_to_drm (adev), +"amdgpu: HW debugfs nodes disabled (kernel lockdown)\n" ); +return 0 ; + } +for (i =0 ; i <ARRAY_SIZE (debugfs_regs); i++) { ent = debugfs_create_file(debugfs_regs_names[i], S_IFREG | 0400, root,
--
2.46.0
Lazar, Lijo
Reviewed-byThanks, Tom.
The patch looks good to me -
Hi Alex/Hawking,
Any concerns on shutting down the interfaces in lockdown mode?
Thanks,
Lijo
Quoted 64 lines · Tom
HI Asad,
This should be fine for umr. UMR detects when the lockdown mode isn't "none" and warns the user that the tool might not work.
So the net effect of this patch is the debugfs files are just not created at all? That'll likely cause umr discovery to fail (after it prints he warning) which is still fine.
Tom
________________________________________
From: Kamal, Asad <[email protected]>
Sent: Wednesday, June 3, 2026 07:44
To: [email protected]
Cc: Lazar, Lijo; Zhang, Hawking; Ma, Le; Zhang, Morris; Deucher, Alexander; Wang, Yang(Kevin); Kamal, Asad; StDenis, Tom
Subject: [PATCH v3] drm/amdgpu: Gate debugfs MMIO access on kernel lockdown
amdgpu_regs,amdgpu_regs2, and related debugfs nodes allow arbitrary MMIO read/write via RREG32/WREG32 without checkingsecurity_locked_down(). On kernel_lockdown=integrity systems this bypasses the same restrictions as/dev/memand PCI config space sysfs.Check
LOCKDOWN_PCI_ACCESS(matching pci-sysfs) at the entry of every debugfs handler that performs direct register access.v2: Use consistent check as per previous check to use
LOCKDOWN_DEBUGFS(Lijo)v3: Do not create any entry from
amdgpu_debugfs_regs_init()ifLOCKDOWN_PCI_ACCESSis active and log once. (Lijo)Signed-off-by Asad Kamal <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +7
-1@@ -26,6 +26,7 @@#include <linux/kthread.h> #include <linux/pci.h> #include <linux/uaccess.h> +#include <linux/security.h> #include <linux/pm_runtime.h> #include "amdgpu.h" @@ -1739,6 +1740,12 @@ int amdgpu_debugfs_regs_init(struct amdgpu_device *adev)struct dentry *ent, *root = minor->debugfs_root;unsigned int i; +if (security_locked_down (LOCKDOWN_PCI_ACCESS )) { +drm_info (adev_to_drm (adev), +"amdgpu: HW debugfs nodes disabled (kernel lockdown)\n" ); +return 0 ; + } +for (i =0 ; i <ARRAY_SIZE (debugfs_regs); i++) { ent = debugfs_create_file(debugfs_regs_names[i], S_IFREG | 0400, root, --2.46.0
Quoted 48 lines · Asad Kamal
amdgpu_regs,amdgpu_regs2, and related debugfs nodes allow arbitrary MMIO read/write via RREG32/WREG32 without checkingsecurity_locked_down(). On kernel_lockdown=integrity systems this bypasses the same restrictions as/dev/memand PCI config space sysfs.Check
LOCKDOWN_PCI_ACCESS(matching pci-sysfs) at the entry of every debugfs handler that performs direct register access.v2: Use consistent check as per previous check to use
LOCKDOWN_DEBUGFS(Lijo)v3: Do not create any entry from
amdgpu_debugfs_regs_init()ifLOCKDOWN_PCI_ACCESSis active and log once. (Lijo)Signed-off-by Asad Kamal <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +7
-0@@ -26,6 +26,7 @@#include <linux/kthread.h> #include <linux/pci.h> #include <linux/uaccess.h> +#include <linux/security.h> #include <linux/pm_runtime.h> #include "amdgpu.h" @@ -1739,6 +1740,12 @@ int amdgpu_debugfs_regs_init(struct amdgpu_device *adev)struct dentry *ent, *root = minor->debugfs_root;unsigned int i; +if (security_locked_down (LOCKDOWN_PCI_ACCESS )) { +drm_info (adev_to_drm (adev), +"amdgpu: HW debugfs nodes disabled (kernel lockdown)\n" ); +return 0 ; + } +for (i =0 ; i <ARRAY_SIZE (debugfs_regs); i++) { ent = debugfs_create_file(debugfs_regs_names[i], S_IFREG | 0400, root,Signature · 1 line
2.46.0
Hi,
Lockdown denies opening of debugfs files but those with the following conditions :
- The file must only be opened for reading.
- The file must have mode 00444.
- The file must not have ioctl methods fops.
- The file must not have mmap fops.
I might be missing something, but how are you able to write in those ?
Best regards,
Nicolas
AMD General
Hi @Nicolas Bouchinet
Thank you for the review.
The commit message references v1 behavior and is no longer accurate. Writes are already blocked, the existing debugfs_locked_down() in fs/debugfs/file.c handles writes when FMODE_WRITE is set, the early-return guard fails and security_locked_down(LOCKDOWN_DEBUGFS) blocks the open under [integrity].
The patch addresses only the read path. Here is why reads are not blocked by debugfs_locked_down():
static int debugfs_locked_down(struct inode *inode,
struct file *filp,
const struct file_operations *real_fops)
{
if ((inode->i_mode & 07777 & ~0444) == 0 &&
!(filp->f_mode & FMODE_WRITE) &&
(!real_fops || (!real_fops->unlocked_ioctl &&
!real_fops->compat_ioctl &&
!real_fops->mmap)))
return 0;
if (security_locked_down(LOCKDOWN_DEBUGFS))
return -EPERM;
return 0;
}For a read-only open of amdgpu_regs (mode 0400, no ioctl, no mmap):
1) (0400 & 07777 & ~0444) == 0 → true - any mode with no bits set outside the 0444 mask (e.g. 0400, 0440, 0444) 0400 satisfies that.
2) !(filp->f_mode & FMODE_WRITE) → true for a read-only open.
3) No unlocked_ioctl, compat_ioctl, or mmap in amdgpu_debugfs_regs_fops → true.
All three conditions hold, so debugfs_locked_down() returns 0 and the read open proceeds. The read handler then calls RREG32, a direct hardware MMIO read, with no further lockdown check. That is the gap which this patch is addressing.
Thanks & Regards
Asad
-----Original Message-----
From: Nicolas Bouchinet <[email protected]>
Sent: Monday, June 8, 2026 2:34 PM
To: Kamal, Asad <[email protected]>
Cc: [email protected]; Lazar, Lijo <[email protected]>; Zhang, Hawking <[email protected]>; Ma, Le <[email protected]>; Zhang, Morris <[email protected]>; Deucher, Alexander <[email protected]>; Wang, Yang(Kevin) <[email protected]>; StDenis, Tom <[email protected]>
Subject: Re: [PATCH v3] drm/amdgpu: Gate debugfs MMIO access on kernel lockdown
[Some people who received this message don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Quoted 46 lines · Asad Kamal
amdgpu_regs,amdgpu_regs2, and related debugfs nodes allow arbitrary MMIO read/write via RREG32/WREG32 without checkingsecurity_locked_down(). On kernel_lockdown=integrity systems this bypasses the same restrictions as/dev/memand PCI config space sysfs.Check
LOCKDOWN_PCI_ACCESS(matching pci-sysfs) at the entry of every debugfs handler that performs direct register access.v2: Use consistent check as per previous check to use
LOCKDOWN_DEBUGFS(Lijo)v3: Do not create any entry from
amdgpu_debugfs_regs_init()ifLOCKDOWN_PCI_ACCESSis active and log once. (Lijo)Signed-off-by Asad Kamal <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +7
-1@@ -26,6 +26,7 @@#include <linux/kthread.h> #include <linux/pci.h> #include <linux/uaccess.h> +#include <linux/security.h> #include <linux/pm_runtime.h> #include "amdgpu.h" @@ -1739,6 +1740,12 @@ int amdgpu_debugfs_regs_init(struct amdgpu_device *adev)struct dentry *ent, *root = minor->debugfs_root;unsigned int i; +if (security_locked_down (LOCKDOWN_PCI_ACCESS )) { +drm_info (adev_to_drm (adev), +"amdgpu: HW debugfs nodes disabled (kernel lockdown)\n" ); +return 0 ; + } +for (i =0 ; i <ARRAY_SIZE (debugfs_regs); i++) { ent = debugfs_create_file(debugfs_regs_names[i], S_IFREG | 0400, root, --
Quoted 2 lines
2.46.0
Hi,
Lockdown denies opening of debugfs files but those with the following conditions :
- The file must only be opened for reading.
- The file must have mode 00444.
- The file must not have ioctl methods fops.
- The file must not have mmap fops.
I might be missing something, but how are you able to write in those ?
Best regards,
Nicolas
Quoted 27 lines · Asad
AMD General
Hi @Nicolas Bouchinet
Thank you for the review.
The commit message references v1 behavior and is no longer accurate. Writes are already blocked, the existing
debugfs_locked_down()infs/debugfs/file.chandles writes whenFMODE_WRITEis set, the early-return guard fails andsecurity_locked_down(LOCKDOWN_DEBUGFS)blocks the open under [integrity].The patch addresses only the read path. Here is why reads are not blocked by
debugfs_locked_down():static int debugfs_locked_down(struct inode *inode,
struct file *filp,
const structfile_operations*real_fops){ if ((inode->i_mode & 07777 & ~0444) == 0 && !(filp->f_mode & FMODE_WRITE) && (!real_fops || (!real_fops->unlocked_ioctl && !real_fops->compat_ioctl && !real_fops->mmap))) return 0; if (security_locked_down(LOCKDOWN_DEBUGFS)) return -EPERM; return 0; }For a read-only open of
amdgpu_regs(mode 0400, no ioctl, no mmap):
Quoted 8 lines
1) (0400 & 07777 & ~0444) == 0 → true - any mode with no bits set outside the 0444 mask (e.g. 0400, 0440, 0444) 0400 satisfies that.
2) !(filp->f_mode &FMODE_WRITE) → true for a read-only open.
3) Nounlocked_ioctl,compat_ioctl, or mmap inamdgpu_debugfs_regs_fops→ true.All three conditions hold, so
debugfs_locked_down()returns 0 and the read open proceeds. The read handler then calls RREG32, a direct hardware MMIO read, with no further lockdown check. That is the gap which this patch is addressing.Thanks & Regards
Asad
Thanks Asad for your explaination !
LOCKDOWN_PCI_ACCESS is used in the integrity mode of Lockdown and should be used to protect against Kernel integrity tampering.
IIUC your issue, the access is read-only and thus, you should use one of the existing confidentiality lockdown_reasons. You are free to add a new one if none of the existing one covers your use case.
Best regards,
Nicolas
AMD General
Hi Nicolas,
Agreed that pci_read_config() has no lockdown check, standardized PCI config space reads are not blocked under [integrity]. But amdgpu_regs is not equivalent to config space reads. It provides arbitrary read access to the full GPU MMIO register space via RREG32, which is the same class of access as pci_mmap_resource(), a user-space mapping of the PCI BAR. That function is explicitly blocked at integrity with LOCKDOWN_PCI_ACCESS:
/* drivers/pci/pci-sysfs.c */
static int pci_mmap_resource(struct kobject *kobj, ...)
{
ret = security_locked_down(LOCKDOWN_PCI_ACCESS);
if (ret)
return ret;
...
}pci_mmap_resource() is blocked not only because the mapping enables writes, but because it grants direct, unmediated access to the BAR, the same unmediated hardware access that amdgpu_regs provides through a serial interface. The distinction is not read vs. write, it is mediated (config space via kernel abstractions) vs. unmediated (direct BAR/MMIO access).
The /dev/mem precedent reinforces this. open_port() checks LOCKDOWN_DEV_MEM (which is before LOCKDOWN_INTEGRITY_MAX) on open, blocking both reads and writes unconditionally, because raw hardware memory access of any kind bypasses the kernel's protection model:
/* drivers/char/mem.c */
static int open_port(struct inode *inode, struct file *filp)
{
rc = security_locked_down(LOCKDOWN_DEV_MEM);
if (rc)
return rc;
...
}RREG32 on an arbitrary register offset is the GPU equivalent of a /dev/mem read of a BAR-mapped region. Blocking it at integrity with LOCKDOWN_PCI_ACCESS is consistent with both of these existing kernel precedents.
We prefer to keep the current approach.
Thanks & Regards
Asad
-----Original Message-----
From: Nicolas Bouchinet <[email protected]>
Sent: Monday, June 8, 2026 4:58 PM
To: Kamal, Asad <[email protected]>
Cc: [email protected]; Lazar, Lijo <[email protected]>; Zhang, Hawking <[email protected]>; Ma, Le <[email protected]>; Zhang, Morris <[email protected]>; Deucher, Alexander <[email protected]>; Wang, Yang(Kevin) <[email protected]>; StDenis, Tom <[email protected]>
Subject: Re: [PATCH v3] drm/amdgpu: Gate debugfs MMIO access on kernel lockdown
[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Quoted 27 lines · Asad
AMD General
Hi @Nicolas Bouchinet
Thank you for the review.
The commit message references v1 behavior and is no longer accurate. Writes are already blocked, the existing
debugfs_locked_down()infs/debugfs/file.chandles writes whenFMODE_WRITEis set, the early-return guard fails andsecurity_locked_down(LOCKDOWN_DEBUGFS)blocks the open under [integrity].The patch addresses only the read path. Here is why reads are not blocked by
debugfs_locked_down():static int debugfs_locked_down(struct inode *inode,
struct file *filp, const structfile_operations*real_fops) { if ((inode->i_mode & 07777 & ~0444) == 0 && !(filp->f_mode & FMODE_WRITE) && (!real_fops || (!real_fops->unlocked_ioctl && !real_fops->compat_ioctl && !real_fops->mmap))) return 0; if (security_locked_down(LOCKDOWN_DEBUGFS)) return -EPERM; return 0; }For a read-only open of
amdgpu_regs(mode 0400, no ioctl, no mmap):
Quoted 8 lines
1) (0400 & 07777 & ~0444) == 0 → true - any mode with no bits set outside the 0444 mask (e.g. 0400, 0440, 0444) 0400 satisfies that.
2) !(filp->f_mode &FMODE_WRITE) → true for a read-only open.
3) Nounlocked_ioctl,compat_ioctl, or mmap inamdgpu_debugfs_regs_fops→ true.All three conditions hold, so
debugfs_locked_down()returns 0 and the read open proceeds. The read handler then calls RREG32, a direct hardware MMIO read, with no further lockdown check. That is the gap which this patch is addressing.Thanks & Regards
Asad
Thanks Asad for your explaination !
LOCKDOWN_PCI_ACCESS is used in the integrity mode of Lockdown and should be used to protect against Kernel integrity tampering.
IIUC your issue, the access is read-only and thus, you should use one of the existing confidentiality lockdown_reasons. You are free to add a new one if none of the existing one covers your use case.
Best regards,
Nicolas
Quoted 48 lines · Asad
AMD General
Hi Nicolas,
Agreed that
pci_read_config()has no lockdown check, standardized PCI config space reads are not blocked under [integrity]. Butamdgpu_regsis not equivalent to config space reads. It provides arbitrary read access to the full GPU MMIO register space via RREG32, which is the same class of access aspci_mmap_resource(), a user-space mapping of the PCI BAR. That function is explicitly blocked at integrity withLOCKDOWN_PCI_ACCESS:/*
drivers/pci/pci-sysfs.c*/
static intpci_mmap_resource(struct kobject *kobj, ...){ ret = security_locked_down(LOCKDOWN_PCI_ACCESS); if (ret) return ret; ... }
pci_mmap_resource()is blocked not only because the mapping enables writes, but because it grants direct, unmediated access to the BAR, the same unmediated hardware access thatamdgpu_regsprovides through a serial interface. The distinction is not read vs. write, it is mediated (config space via kernel abstractions) vs. unmediated (direct BAR/MMIO access).The
/dev/memprecedent reinforces this.open_port()checksLOCKDOWN_DEV_MEM(which is beforeLOCKDOWN_INTEGRITY_MAX) on open, blocking both reads and writes unconditionally, because raw hardware memory access of any kind bypasses the kernel's protection model:/*
drivers/char/mem.c*/
static intopen_port(struct inode *inode, struct file *filp){ rc = security_locked_down(LOCKDOWN_DEV_MEM); if (rc) return rc; ... }RREG32 on an arbitrary register offset is the GPU equivalent of a
/dev/memread of a BAR-mapped region. Blocking it at integrity withLOCKDOWN_PCI_ACCESSis consistent with both of these existing kernel precedents.We prefer to keep the current approach.
Thanks & Regards
Asad-----Original Message-----
From: Nicolas Bouchinet <[email protected]>
Sent: Monday, June 8, 2026 4:58 PM
To: Kamal, Asad <[email protected]>
Cc: [email protected]; Lazar, Lijo <[email protected]>; Zhang, Hawking <[email protected]>; Ma, Le <[email protected]>; Zhang, Morris <[email protected]>; Deucher, Alexander <[email protected]>; Wang, Yang(Kevin) <[email protected]>; StDenis, Tom <[email protected]>
Subject: Re: [PATCH v3] drm/amdgpu: Gate debugfs MMIO access on kernel lockdown
Quoted 10 lines
[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Quoted 7 lines · Asad
AMD General
Hi @Nicolas Bouchinet
Thank you for the review.
The commit message references v1 behavior and is no longer accurate. Writes are already blocked, the existing
debugfs_locked_down()infs/debugfs/file.chandles writes whenFMODE_WRITEis set, the early-return guard fails andsecurity_locked_down(LOCKDOWN_DEBUGFS)blocks the open under [integrity].
I didn't saw that your patch changed that much, sorry for that. With the v3 version of your patch, since the debugfs regs files are not even created it is indeed correct to use an integrity lockdown_reason like LOCKDOWN_PCI_ACCESS.
Nicolas