From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6CD59D2F033 for ; Tue, 27 Jan 2026 15:07:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:To:Subject :MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=l4IA7bQ/Xb6V31/kvvDbltJz/U3IdIydhc7X00SWdok=; b=BPfHEHqgewa7ZG gGuTsfVygeZtjVCDfoaYgR0R+rPeLdjZAzUgMlplNbtBadVKkhFvOBi0sBfNO7cVxrkq27TVXv2TH IqEWvJP2OGo2iTVI5y0JOZc8IUJ3mVhWsB3JOsHa3hJzgZJkkcMN68vOQt7rrmhuTUT0HyZiM87Hy +Dxzrpap8q4ncJLjH5YuiINfVHl5EHHxTdJtgeviNObsCcm9Zc0ogsZKtAGpi8d8QCxqqC0JHoXlR uAIlmGbuanOtcTsVulKv1up16Vv2Y0pjJY6bEt8Jb93Y8TTYf67UziiGVZx1e/unGSxRDtX04agEE lqs/Eb+kmHlyeT4n7WmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vkkew-0000000EV9V-22dN; Tue, 27 Jan 2026 15:07:14 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vkkes-0000000EV8o-3GP5 for linux-arm-kernel@lists.infradead.org; Tue, 27 Jan 2026 15:07:12 +0000 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 E29FB1595; Tue, 27 Jan 2026 07:07:01 -0800 (PST) Received: from [10.57.52.3] (unknown [10.57.52.3]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 869BF3F632; Tue, 27 Jan 2026 07:07:00 -0800 (PST) Message-ID: <0f6212c1-7034-42f4-ba77-10e9ec52a4f5@arm.com> Date: Tue, 27 Jan 2026 16:06:58 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v10 05/16] arm64: ptrace: Move rseq_syscall() before audit_syscall_exit() To: Jinjie Ruan , Will Deacon References: <20251222114737.1334364-1-ruanjinjie@huawei.com> <20251222114737.1334364-6-ruanjinjie@huawei.com> <28e54f74-9b3d-4c3c-9172-ceb429e7fcbe@arm.com> <4891191c-d1c3-6985-c2ea-1b29deb8abe1@huawei.com> From: Kevin Brodsky Content-Language: en-GB In-Reply-To: <4891191c-d1c3-6985-c2ea-1b29deb8abe1@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260127_070711_664301_5650B06A X-CRM114-Status: UNSURE ( 9.34 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, peterz@infradead.org, catalin.marinas@arm.com, ldv@strace.io, song@kernel.org, linux-kselftest@vger.kernel.org, shuah@kernel.org, kees@kernel.org, linux-arm-kernel@lists.infradead.org, kmal@cock.li, thuth@redhat.com, ryan.roberts@arm.com, anshuman.khandual@arm.com, charlie@rivosinc.com, pengcan@kylinos.cn, broonie@kernel.org, luto@kernel.org, tglx@linutronix.de, richard.weiyang@gmail.com, dvyukov@google.com, wad@chromium.org, oleg@redhat.com, linux-kernel@vger.kernel.org, liqiang01@kylinos.cn, akpm@linux-foundation.org, reddybalavignesh9979@gmail.com, macro@orcam.me.uk Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 27/01/2026 12:34, Jinjie Ruan wrote: >> [...] >> >>> I'm also concerned that rseq_debug_update_user_cs() >>> operates on instruction_pointer(regs) which is something that can be >>> chaned by ptrace. >> Isn't that true regardless of where rseq_syscall() is called on the >> syscall exit path, though? > My understanding is that if instruction_pointer(regs) is hijacked and > modified via ptrace at the syscall exit (ptrace_report_syscall_exit()), > this modification will not be observed by rseq. Specifically, in the > generic entry syscall exit path, rseq_syscall() is unable to detect such > a PC modification. Good point. So concretely that means that currently on arm64, one could make the rseq debug check pass/fail by using the syscall exit trap to modify PC. OTOH this is impossible with generic entry because the rseq check is performed first. I'm not sure this is a feature anyone has even noticed, but it is a user-visible change indeed. - Kevin