From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BD1683A1CEA; Tue, 18 Nov 2025 17:12:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763485952; cv=none; b=i3tM9vBR/1XreMde53UnwUqlgzUJmKSeHDj0Y4U1jR+F72PKDh6yoMyoCl6W4rUhCbBrvBqVWQLhY/N9s6NQEgvuhBmgAL15vAzYpTLcoWKnuAoxRunK8+SNnrQPe7TCaT6tZffsRIgabseR248sL/UO5rd7g1figXm7L7nvhZg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763485952; c=relaxed/simple; bh=o1eaAHnccFUQBLgOt0rZXAaiezfVjexzEGuBcVhkFAM=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=MeblHLnacx7W1isSKSKs8Kn6Uat6BIebjJzxSdv33ECuBfRomp2tv0JYkubokE2riwIaeq4d0eKStIAMpWnAbe9m2vW6MFVOiJ9wrKLEoeYSKJAqWujHLBLiLVwg+4fkfkFoxuYVrTfoFUThomzF+Oyh+WT3ErFVQXN3DRAUtG0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7A10615A1; Tue, 18 Nov 2025 09:12:22 -0800 (PST) Received: from [10.57.39.196] (unknown [10.57.39.196]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C72273F66E; Tue, 18 Nov 2025 09:12:24 -0800 (PST) Message-ID: Date: Tue, 18 Nov 2025 18:12:22 +0100 Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 06/11] arm64/ptrace: Expand secure_computing() in place To: Jinjie Ruan , catalin.marinas@arm.com, will@kernel.org, oleg@redhat.com, tglx@linutronix.de, peterz@infradead.org, luto@kernel.org, shuah@kernel.org, kees@kernel.org, wad@chromium.org, akpm@linux-foundation.org, ldv@strace.io, macro@orcam.me.uk, deller@gmx.de, mark.rutland@arm.com, song@kernel.org, mbenes@suse.cz, ryan.roberts@arm.com, ada.coupriediaz@arm.com, anshuman.khandual@arm.com, broonie@kernel.org, pengcan@kylinos.cn, dvyukov@google.com, kmal@cock.li, lihongbo22@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org References: <20251117133048.53182-1-ruanjinjie@huawei.com> <20251117133048.53182-7-ruanjinjie@huawei.com> From: Kevin Brodsky Content-Language: en-GB In-Reply-To: <20251117133048.53182-7-ruanjinjie@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 17/11/2025 14:30, Jinjie Ruan wrote: > 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. > > Signed-off-by: Jinjie Ruan > --- > arch/arm64/kernel/ptrace.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c > index 707951ad5d24..9af3046a2ce9 100644 > --- a/arch/arm64/kernel/ptrace.c > +++ b/arch/arm64/kernel/ptrace.c > @@ -2387,8 +2387,11 @@ int syscall_trace_enter(struct pt_regs *regs, long syscall, 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(NULL); No argument was passed to __secure_computing() in v6, as expected since it was removed in v6.15. Not sure why this NULL reappeared. > + if (ret == -1L) ret is an int, so should be -1, not -1L. - Kevin > + return NO_SYSCALL; > + } > > /* Either of the above might have changed the syscall number */ > syscall = syscall_get_nr(current, regs);