From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF450379EF0 for ; Fri, 17 Jul 2026 17:54:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784310863; cv=none; b=Kzebils69CUueeyrkGmh00DngxI0cwsRO5dn24jA69QiDN5Cbcg10maiFBxVF0Rj990plSv/Dv544Lfn8TIA2LvFaM4ZxlHDoUidTKLUnObHuCZDuMAOsS0/rYJ1HgZQCMsYwR8tWey4teHUBFh6gcHdO69zzZYfYQVY0STAJ+k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784310863; c=relaxed/simple; bh=0prA2HZDew1VBKUSHUzlMMkkPBZS13IUmS/aVXXdqQY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VJLI/LvljDi7AoWXdRN/5H7j0tMFwJXl259zn+BigEoMNCncwNwnu2P7dyx9G6BzsKozdbhuTFMxSovynwHMeeoTnJVy39RVr21EWhb8yb6P9519Zez8uC3NiJTkP0kDqVc38T+OiWqhVObI1MP06af2I+fq1Sm0wvHs4t1Qj60= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=B7848+37; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="B7848+37" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4EC91F000E9; Fri, 17 Jul 2026 17:54:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784310862; bh=M7UU8I9REpQpSgsvF2mEsjgGrjH9OWnIsIWxfgfvteM=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=B7848+37HZJnPYVQhtr3V/8J7xCRJmicwb3gQEaRWadSFLpSslub6h4BZtdePT1/G h9PVMxb78mP8gqhgEUPamf/kB4jDzu5ZYGnGtRxN1VAfBGGhkfrYPhYR6b7kcoBo25 j2QiRhjleoubLNMJ07TAdl3GsjbLjC9UvUgTtiOg5iCauVA/58w0oYGUYZjxCsUWVF u2h/d0lId9H93mLMsmMu2LDmuQd1BLsolZifxMJsJgs/QA35si4PYF4A5B52Ichs6S DEWT8cxQhYrIaFZ0qv133/+MZr8uj85CBk9JecHdbKPgBqfK7kUarU4LwZgE3BDPE4 2re7uMi/yQLHA== Date: Fri, 17 Jul 2026 18:54:17 +0100 From: Will Deacon To: linux-arm-kernel@lists.infradead.org Cc: catalin.marinas@arm.com, kernel-team@android.com, linux-kernel@vger.kernel.org, Kees Cook , Jinjie Ruan , Mark Rutland , Yiqi Sun Subject: Re: [PATCH v2] arm64: syscall: Ensure saved x0 is kept in-sync with tracer updates Message-ID: References: <20260716120640.6590-1-will@kernel.org> <178420908877.33796.2351583216856259313.b4-ty@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <178420908877.33796.2351583216856259313.b4-ty@kernel.org> On Thu, Jul 16, 2026 at 05:48:01PM +0100, Will Deacon wrote: > On Thu, 16 Jul 2026 13:06:39 +0100, Will Deacon wrote: > > When seccomp support was originally added to arm64 in a1ae65b21941 > > ("arm64: add seccomp support"), seccomp was erroneously called _before_ > > the ptrace syscall-enter-stop and therefore the tracer could trivially > > manipulate the syscall register state after the seccomp check had > > passed. This was subsequently fixed in a5cd110cb836 ("arm64/ptrace: run > > seccomp after ptrace") by moving the seccomp check after the tracer has > > run. Unfortunately, a decade later, that fix has been reported to be > > incomplete. > > > > [...] > > Applied to arm64 (for-next/fixes), thanks! > > [1/1] arm64: syscall: Ensure saved x0 is kept in-sync with tracer updates > https://git.kernel.org/arm64/c/e057b9477232 Bah, I've had to revert this. I think Sashiko makes a good point here that the seccomp interaction is still broken when the filter is re-evaluated after the tracer stop, because that all happens inside secure_computing() so we don't get a chance to update 'orig_x0': https://sashiko.dev/#/patchset/20260716120640.6590-1-will@kernel.org I've got a v3 that takes a different approach, so I'll send that out shortly. Jinjie, thanks for sending the selftests, but maybe we can extend them to cover the loophole above as wel? Will