Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp70392img; Tue, 19 Mar 2019 16:00:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgu3WisBBeztEQj+0mMUDNq99lZVi6WSaCSKsiZF5t1vFmCER3yxg2ZbzmBxKzcqEaGSuy X-Received: by 2002:a65:6241:: with SMTP id q1mr4196856pgv.340.1553036414770; Tue, 19 Mar 2019 16:00:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553036414; cv=none; d=google.com; s=arc-20160816; b=QtK3hhlVUm6/3OpmfeTcJB7Yh3lJAn0ZHIHXsvu4zZHZjXAH5URSOf3wn7lniZY4ez l2v963hBG1ONiYNiIwbmQkUMFJkt+S7HuEQY78A2kitvBJH24FRs58svZYY4/RXQSOgD csQZCCZ0zeSwclYvIM2uctT2n+RDAkfQcG/5Tvwwi/F07IDOgyHsWegMS+vrvF7KzzSg uTyOyLbTGuvuH62uP/kPtcMsOfhkBSJxiuN/IBqwzWMt8OWqpOMDaj1hC0RN5mb97m8l k02q4N4/jvIVn48EtS0itchBsXw1/Aow+RNTpPjzDrGT4biJr48HjnwSbCpoqTSHWk6T xSrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=xsPK5x1QgitHsoJzTqH1CLyz36Wu+ErFKJSeWybGhUQ=; b=vay2MyT4VJp6aWA76Ze1/6DY2Whog+8rOvZ/GbRp8ya1zTbWeIzqBejU05VWMuLrHe iGjUNN05CtpkN4sqcBs/w49fMDLFxokb+mcB9NsAgXKa71jIpXSS1SzG24eMFLbZL+Mc BcXyeyQMcf9oo571lB+p8euf0Gs9wluAO1BVc0ccaaXY5EeNueGOllXdHyfCZ8dnSejm VoelbK9jlRqWGPja7PBmLwRm+QelyLA/fiCvlr8lo4a0D2cnUl03VGF6iZ0g/ESmW8jO S+N6gYQlrpm/7e924StCePPYcP0OMWwymPM5iBU95zQwOy/c8gHaf0WYeIpHJpETnTpJ 2T1w== 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 p10si90157pgl.186.2019.03.19.15.59.59; Tue, 19 Mar 2019 16:00:14 -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 S1727068AbfCSW6H (ORCPT + 99 others); Tue, 19 Mar 2019 18:58:07 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55822 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725913AbfCSW6G (ORCPT ); Tue, 19 Mar 2019 18:58:06 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D0C383DB9; Tue, 19 Mar 2019 22:58:05 +0000 (UTC) Date: Tue, 19 Mar 2019 15:58:04 -0700 From: Andrew Morton To: "Dmitry V. Levin" Cc: Andrei Vagin , 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: <20190319155804.277fec5dba6a93ad2ab3edbc@linux-foundation.org> In-Reply-To: <20190319223252.GA19424@altlinux.org> References: <20190319191957.27156-1-avagin@gmail.com> <20190319223252.GA19424@altlinux.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 20 Mar 2019 01:32:53 +0300 "Dmitry V. Levin" wrote: > 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 > > > > When a task calls one of these syscalls, the kernel saves a current > > sigmask in task->saved_sigmask and sets a syscall sigmask. > > > > 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. > > > > 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? I made those changes to my copy.