Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp55834img; Tue, 19 Mar 2019 15:33:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzcqdylD9TiAumZTAW05cdKODQPCPvSYrex7W2IFC7/iHfPFv4WyTjIWV6MGC2mZttK3l56 X-Received: by 2002:a62:5e46:: with SMTP id s67mr4321784pfb.126.1553034835464; Tue, 19 Mar 2019 15:33:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553034835; cv=none; d=google.com; s=arc-20160816; b=NvK0ia9EJjbJNUXvFhA4Bcd8EgOP95yZJfvgLuJPVpwPWgWL+McCVfq5YQfYyHu6dI Kj6ONbZRBvFr5XVVLv5tLz6dU/42/+9Bjw1s4w76aKaASok9f9QagYi/xbvf3F8elxW5 1r00k6G8Dnug0dOZmGkzOp0ee8/AcD0UUHjFEZYsMeeWYlqWppMa76jmzlGf1TH+LOxF zE+IM3Y9IDMkAHEmPPFMAwnkKp13JaFtiMNr3HOK/HaCQdObt6TlTPfH3Ul5m+Ky1057 FyL8hn3pisQHWKXqOlBSp63+mFpbl4ZL1TO08gBpjvN6KK+fnDmmXIJPPet4DB0qci7O Hstw== 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=/zFHuql6pNpUI+6Shws2+nUNBsUCmD/8PnzaBDy70m8=; b=iBNtWuBuIytv8t6CeEPC75FxIye2BbjnxjZSpBoiZgvDEedx/oIxHlG5rWFjFYxoCS aUZX91RRR27eAtrLW9wZjvb4jVNPWO0zTXJXI3wRyWY93a+BJMhWnlZMQSuOVtkCfuVK hdEd0+lpbNiHmU7+0GUTeLfJO3TTyzbS2JWD7SW+L3gKgMRGmOQv2fGKj42bculaRLxC lU85sSMOeUjYMRzV478z+SUrt3wZ+Uu+OX0vX5jhEzIFHbaMmfw3vXgz+tbWNec4p77g +Q/iKavhLixT1h6L3nT8idoejuXZou9EObc7TZ0n7QawW61Oat5uI6NCBHNE02MXRbcV yCxw== 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 c13si33231pgj.301.2019.03.19.15.33.39; Tue, 19 Mar 2019 15:33:55 -0700 (PDT) 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 S1727050AbfCSWc4 (ORCPT + 99 others); Tue, 19 Mar 2019 18:32:56 -0400 Received: from vmicros1.altlinux.org ([194.107.17.57]:47046 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726686AbfCSWc4 (ORCPT ); Tue, 19 Mar 2019 18:32:56 -0400 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 1BDF872CCAC; Wed, 20 Mar 2019 01:32:53 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 0E1F27CC74C; Wed, 20 Mar 2019 01:32:53 +0300 (MSK) Date: Wed, 20 Mar 2019 01:32:53 +0300 From: "Dmitry V. Levin" To: Andrei Vagin Cc: Andrew Morton , Oleg Nesterov , linux-kernel@vger.kernel.org, "Eric W. Biederman" , Stephen Rothwell Subject: Re: [RESEND PATCH] ptrace: take into account saved_sigmask in PTRACE_{GET,SET}SIGMASK Message-ID: <20190319223252.GA19424@altlinux.org> References: <20190319191957.27156-1-avagin@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UlVJffcvxoiEqYs2" Content-Disposition: inline In-Reply-To: <20190319191957.27156-1-avagin@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --UlVJffcvxoiEqYs2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 19, 2019 at 12:19:57PM -0700, Andrei Vagin wrote: > There are a few system calls (pselect, ppoll, etc) which replace a task > sigmask while they are running in a kernel-space >=20 > When a task calls one of these syscalls, the kernel saves a current > sigmask in task->saved_sigmask and sets a syscall sigmask. >=20 > On syscall-exit-stop, ptrace traps a task before restoring the > saved_sigmask, so PTRACE_GETSIGMASK returns the syscall sigmask and > PTRACE_SETSIGMASK does nothing, because its sigmask is replaced by > saved_sigmask, when the task returns to user-space. >=20 > This patch fixes this problem. PTRACE_GET_SIGMASK returns saved_sigmask > is it's set. PTRACE_SETSIGMASK drops the TIF_RESTORE_SIGMASK flag. If it's not too late, could somebody tweak the commit message so that PTRACE_GET_SIGMASK becomes PTRACE_GETSIGMASK and "is it's set" is changed to "if it's set", please? --=20 ldv --UlVJffcvxoiEqYs2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJckW4UAAoJEAVFT+BVnCUItfsP/R6/j0iRF6lVA67Vlb3yafBM w5nk7j1eV0Pm/gKALaGVrB6rwJC7ghD05S64uqca9vX8oKJLSTayP6e3Xy1WqP1c EymLkosU9869M95+3EN/zfKyRUzrVOdvSdMNgl1WGMRSs3txCub3PuWJ8QHq6EBi bCzLbK5V15tJs3yOn/yqR3AXKLvt+/ZVWhHUHkbf/DcMMYs3Ycjt6BSM27pExvg9 rDxPoxtEC63bzgDSSY3fbaFbRScGS1X2Pl+PNiCaTCuyP+oULXLDPPXExZDHZTP2 hsS7ID5FIXhYAzLfvrN9tRQmqHC+fQdDMIDf15zUKl8XaoCwnf43gyNZPWIxTe+H k7/UIoOBHYPD50HX9+al7S1QfGX2E7fyinmBl0mT+X9eMORxNoWFMbI3WmmJZkDE ZR/weOis2GpeDtev+aBOTS9k0csY6/hhVFtC8/OULHExr01EdImA37NKlkQbwXEq HKW7b60sPqSVeYAoF5o00UjfzTL/eAHxSJWI/2/6XfHhbde6XzDfuPEwuBU6bC+O XIRLV1EShd64cgfaskThMMivjB3gnJpaukC01MfzUJi+xZWAzdnJme56kJ5xS12j OtgL3Zv9V18Nq/SIOlE2bIIQKYFMZopM/b4Y70tKA4R2swNFSzmcxRli7YgxY09i umENVJldGMUEyoVrGYTV =29F8 -----END PGP SIGNATURE----- --UlVJffcvxoiEqYs2--