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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C75DAC64ED8 for ; Mon, 27 Feb 2023 15:34:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229563AbjB0PeE (ORCPT ); Mon, 27 Feb 2023 10:34:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229903AbjB0Pdp (ORCPT ); Mon, 27 Feb 2023 10:33:45 -0500 Received: from vmicros1.altlinux.org (vmicros1.altlinux.org [194.107.17.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7F337EF8A for ; Mon, 27 Feb 2023 07:33:41 -0800 (PST) Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 9C12E72C97F; Mon, 27 Feb 2023 18:33:40 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 820027CFE37; Mon, 27 Feb 2023 17:33:40 +0200 (IST) Date: Mon, 27 Feb 2023 17:33:40 +0200 From: "Dmitry V. Levin" To: Alejandro Colomar Cc: =?utf-8?B?zqbPjs+EzrfPgiDOks6xzrvOsc+DzrnOrM60zrfPgg==?= , linux-man@vger.kernel.org, mtk.manpages@gmail.com, lineprinter0@gmail.com Subject: Re: [PATCH] ptrace.2: Add details about usage of PTRACE_GET_SYSCALL_INFO Message-ID: <20230227153340.GA9755@altlinux.org> References: <20230225105601.6079-1-fvalasiad@gmail.com> <20230226232201.4237-1-fvalasiad@gmail.com> <34ef0c13-5673-68c5-a998-8ff36979b672@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-man@vger.kernel.org Hi, On Mon, Feb 27, 2023 at 02:28:45PM +0100, Alejandro Colomar wrote: [...] > Ahh, sorry, I forgot about that. I reworded it to the following: > > ptrace.2: Add details about usage of PTRACE_GET_SYSCALL_INFO > > Document the role of PTRACE_O_TRACESYSGOOD option in connection with > PTRACE_GET_SYSCALL_INFO. > > Came upon this after writing a test program using PTRACE_O_TRACESYSGOOD. Just otherwise, PTRACE_O_TRACESYSGOOD was not used in that test, otherwise there wouldn't be any question in the first place. Did you mean PTRACE_GET_SYSCALL_INFO? > After failing to find what's wrong I posted a StackOverflow question > which you can find right here: > > > Nate Eldredge found out what happens by looking into the kernel's source > code, here is a link to the relevant part > > > In the code it can be seen that the union is filled if and only if the > signal matches "SIGTRAP | 0x80", a signal which is only sent if the > PTRACE_O_TRACESYSGOOD option is set. You can read about that in the > PTRACE_O_TRACESYSGOOD section of ptrace(2)'s manual. Once again, this "if and only if" is confusing, as PTRACE_EVENT_SECCOMP event that can happen when PTRACE_O_TRACESECCOMP option is enabled fills the union with the data of type PTRACE_SYSCALL_INFO_SECCOMP. PTRACE_EVENT_SECCOMP stop is similar to system call enter stop, but it's not exactly the same kind of stop. The note we're adding to the manual page is more correct in this regards. -- ldv