Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1102776imu; Wed, 28 Nov 2018 04:46:22 -0800 (PST) X-Google-Smtp-Source: AFSGD/VUVQlZITbXJCFpjZn5PZFumB0+KFcq1U8g+W627WiRkqKt+Yg6E2FI0mQ2B7eGFZCZT8jZ X-Received: by 2002:a63:ed15:: with SMTP id d21mr32903957pgi.305.1543409182566; Wed, 28 Nov 2018 04:46:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543409182; cv=none; d=google.com; s=arc-20160816; b=Km4igXV59TcPb1B1Y8KIBonOr1EeJbOO74rruFRwvoyCvSuHw8ApekMVPl9s+IHb1B bsFuxKn+e+kVbyMGlH7yWYA/rsgE0VFFigwPN9J1UWtKJyFMuO2FvZHU5++YlBdIqqEN 49sry7x+J2YDAOSvAaa8SsHuKyo2oA1E1mf2JFbAixX8UPuxf0zxm834wcQ5rgRTWP1o 8+aPESy8rb3IjtPfiwq5vfz7Mo/N6Nx95joxcoBTRw5ZcuYID9HkbxTIVyqZ4ywtwErZ EoUiacNeI8lOeikksan7g4byfTMvAwZHOeHPq5RZePJAfZYv7vDBz+5eGUflSwCiOUm0 2y8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=+1xtVR9SonFxPGdMFbLAJYpwKfYTbtAMg0ZzIqVxXqU=; b=TAhYyxiYbZs4UdsN+pFaItP/RwtsssPIFIHwN8j6k8eQuF9eoCABrLNRxfHoRBMAXR mvzMtYAN4li5JVLntGwQYh0fRD1dxzrTaDEhgWSqE1xLxXTDQ+IbVLqWWRqoiQUTCg7f m/jsEIMMptHE6awWs5Y8YlsQtwH+y52WUTJX3i9a4AApzpjahaHayj4ADm8LCBFhlPbR QEH/sOn2fDZaAkedtZb7978l2+eYAwVfB93pPUP0fxMX11LuFcVmL4HzA/BsWfSQ2Ns8 n3sCFhGYO+LNrkzS+JqW6ALHGa+5XQlD4SlhLBM+13ZBbqlaPbIcYqAAlJgiHw7K4Z20 eY5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i11si7161988pgh.406.2018.11.28.04.46.07; Wed, 28 Nov 2018 04:46:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728102AbeK1Xpr (ORCPT + 99 others); Wed, 28 Nov 2018 18:45:47 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:51818 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727829AbeK1Xpq (ORCPT ); Wed, 28 Nov 2018 18:45:46 -0500 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 632DB72CC59; Wed, 28 Nov 2018 15:44:11 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 578567CD0D7; Wed, 28 Nov 2018 15:44:11 +0300 (MSK) Date: Wed, 28 Nov 2018 15:44:11 +0300 From: "Dmitry V. Levin" To: Oleg Nesterov Cc: Elvira Khabirova , Eugene Syromyatnikov , Steven Rostedt , Andy Lutomirski , Ingo Molnar , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, strace-devel@lists.strace.io Subject: Re: [RFC PATCH RESEND v3 3/3] ptrace: add PTRACE_EVENT_SECCOMP support to PTRACE_GET_SYSCALL_INFO Message-ID: <20181128124411.GA28206@altlinux.org> References: <20181125022150.46258a20@akathisia> <20181125022340.5703400f@akathisia> <20181126143524.GB1660@redhat.com> <20181127040732.1c9f7965@akathisia> <20181127123116.GA13284@redhat.com> <20181127232753.GA18755@altlinux.org> <20181128123545.GA30395@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ZPt4rx8FFjLCG7dd" Content-Disposition: inline In-Reply-To: <20181128123545.GA30395@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --ZPt4rx8FFjLCG7dd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 28, 2018 at 01:35:46PM +0100, Oleg Nesterov wrote: > On 11/28, Dmitry V. Levin wrote: > > > > > Just like ptrace_request(PTRACE_LISTEN) > > > does but you can do this lockless (no need to lock_task_sighand()). > > > > Why this can be done lockless? All other places in that file do > > the locking, >=20 > PTRACE_LISTEN too doesn't need lock_task_sighand() to access ->last_sigin= fo, > this code predates ptrace_freeze_traced() which ensures that the tracee c= an't > go away and clear ->last_siginfo. >=20 > However, unlike ptrace_get_syscall(), PTRACE_LISTEN needs spin_lock_irq(s= iglock), > it modifies ->jobctl and calls signal_wake_up(). What about PTRACE_GETSIGINFO? Can it also be done lockless because ptrace_check_attach() has already called ptrace_freeze_traced()? > > > Of course, debugger can do PTRACE_SETSIGINFO and confuse itself but p= robably we > > > do not care? > > > > The only potential issue I could think of is whether PTRACE_SETSIGINFO > > could be used this way to cause an information leak by making > > PTRACE_GET_SYSCALL_INFO access some unrelated data. >=20 > Well, afaics ptrace_get_syscall() does nothing "special", debugger can us= e other > PTRACE_ requests to get the same info? I agree. --=20 ldv --ZPt4rx8FFjLCG7dd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJb/o2bAAoJEAVFT+BVnCUIhvUQAIITUiL87+l7B5purj2mbkde iOE/2Upl2PG1jlb+aKB1rQTknLKRPXkprZud8j6327ts1xhKyxkkzHJwiEODo1Eg DjYSysvUYMKHkZ2erWw4rUD21u3g100pnVKe/nx55ePOgq8HVFHjjuW+1yFCS7AQ YWPQmnlhCjIRAZjH3N7Qapcp/DdjDPhobziUeKE9lyTQU+Ea7NgH1imDz2yTG3MZ n+ntMSaFFFz9exMbW3IbEnYSP+0wboJpmUXKLurXYuLF+jXcjWPH1SjDHo2KmNm2 necxBlcveAl8f8IYTOzRwelHG0I/GdHFdLoN7Bcw1gZLPLWYa16zZpdAhrp5xZ5x zU3+2ABICMEsa3kG17g574F0hotpu2AIVxqkc1aY67O84WboiJaemwA3twoL8WeT FkxIctOP7qu6H1REgWkxoWrRTcHUfQAWRuh+ehonhCX/GrI1p0ibkKOJkYOJap4M vXADBKoZQ0kT/FSMRsfye9n+P7Gn3xTUrYCC74s/3X0bI9JhUiUxNCvF/zVlvmD5 dCMIkpGZUlnyyyUHXPPKZtdSghbsvkYSNdsxSPwZDrfgYda/dl1Pk7wCJiEvpOqa DQEOris9iGq3yhGp4KihLU2OvB6spqr1F0FRdLyyWLkPkr3fTeaFgyyFk1T6Nszf 36mOBoXMlGz/IOrToycg =4nL6 -----END PGP SIGNATURE----- --ZPt4rx8FFjLCG7dd--