[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20241001144306.1991001-2-mika.kuoppala@linux.intel.com>
Date: Tue, 1 Oct 2024 17:42:49 +0300
From: Mika Kuoppala <mika.kuoppala@...ux.intel.com>
To: intel-xe@...ts.freedesktop.org
Cc: Mika Kuoppala <mika.kuoppala@...ux.intel.com>,
Oleg Nesterov <oleg@...hat.com>,
linux-kernel@...r.kernel.org,
Dave Airlie <airlied@...hat.com>,
Lucas De Marchi <lucas.demarchi@...el.com>,
Matthew Brost <matthew.brost@...el.com>,
Andi Shyti <andi.shyti@...el.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Maciej Patelczyk <maciej.patelczyk@...ux.intel.com>,
Dominik Grzegorzek <dominik.grzegorzek@...el.com>,
Jonathan Cavitt <jonathan.cavitt@...el.com>,
Andi Shyti <andi.shyti@...ux.intel.com>
Subject: [PATCH 01/18] ptrace: export ptrace_may_access
xe driver would like to allow fine grained access control
for GDB debugger using ptrace. Without this export, the only
option would be to check for CAP_SYS_ADMIN.
The check intended for an ioctl to attach a GPU debugger
is similar to the ptrace use case: allow a calling process
to manipulate a target process if it has the necessary
capabilities or the same permissions, as described in
Documentation/process/adding-syscalls.rst.
Export ptrace_may_access function to allow GPU debugger to
have identical access control for debugger(s)
as a CPU debugger.
v2: proper commit message (Lucas)
Cc: Oleg Nesterov <oleg@...hat.com>
Cc: linux-kernel@...r.kernel.org
Cc: Dave Airlie <airlied@...hat.com>
CC: Lucas De Marchi <lucas.demarchi@...el.com>
Cc: Matthew Brost <matthew.brost@...el.com>
CC: Andi Shyti <andi.shyti@...el.com>
Cc: Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>
CC: Maciej Patelczyk <maciej.patelczyk@...ux.intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek@...el.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@...ux.intel.com>
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@...el.com>
Reviewed-by: Andi Shyti <andi.shyti@...ux.intel.com>
---
kernel/ptrace.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index d5f89f9ef29f..86be1805ebd8 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -354,6 +354,7 @@ bool ptrace_may_access(struct task_struct *task, unsigned int mode)
task_unlock(task);
return !err;
}
+EXPORT_SYMBOL_GPL(ptrace_may_access);
static int check_ptrace_options(unsigned long data)
{
--
2.34.1
Powered by blists - more mailing lists