[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260128031934.3906955-8-ruanjinjie@huawei.com>
Date: Wed, 28 Jan 2026 11:19:27 +0800
From: Jinjie Ruan <ruanjinjie@...wei.com>
To: <catalin.marinas@....com>, <will@...nel.org>, <oleg@...hat.com>,
<tglx@...utronix.de>, <peterz@...radead.org>, <luto@...nel.org>,
<shuah@...nel.org>, <kees@...nel.org>, <wad@...omium.org>,
<kevin.brodsky@....com>, <deller@....de>, <akpm@...ux-foundation.org>,
<charlie@...osinc.com>, <ldv@...ace.io>, <mark.rutland@....com>,
<anshuman.khandual@....com>, <song@...nel.org>, <ryan.roberts@....com>,
<thuth@...hat.com>, <ada.coupriediaz@....com>, <broonie@...nel.org>,
<pengcan@...inos.cn>, <liqiang01@...inos.cn>, <kmal@...k.li>,
<dvyukov@...gle.com>, <reddybalavignesh9979@...il.com>,
<richard.weiyang@...il.com>, <linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <linux-kselftest@...r.kernel.org>
CC: <ruanjinjie@...wei.com>
Subject: [PATCH v11 07/14] arm64/ptrace: Expand secure_computing() in place
The generic entry expand secure_computing() in place and call
__secure_computing() directly.
In order to switch to the generic entry for arm64, refactor
secure_computing() for syscall_trace_enter().
No functional changes.
Reviewed-by: Kevin Brodsky <kevin.brodsky@....com>
Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
---
arch/arm64/kernel/ptrace.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index cc2bac9c95d6..57ea0e4aaf82 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -2419,8 +2419,11 @@ int syscall_trace_enter(struct pt_regs *regs, unsigned long flags)
}
/* Do the secure computing after ptrace; failures should be fast. */
- if (secure_computing() == -1)
- return NO_SYSCALL;
+ if (flags & _TIF_SECCOMP) {
+ ret = __secure_computing();
+ if (ret == -1)
+ return NO_SYSCALL;
+ }
/* Either of the above might have changed the syscall number */
syscall = syscall_get_nr(current, regs);
@@ -2438,7 +2441,7 @@ int syscall_trace_enter(struct pt_regs *regs, unsigned long flags)
audit_syscall_entry(syscall, regs->orig_x0, regs->regs[1],
regs->regs[2], regs->regs[3]);
- return syscall;
+ return ret ? : syscall;
}
static inline bool report_single_step(unsigned long flags)
--
2.34.1
Powered by blists - more mailing lists