Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2204249imu; Fri, 23 Nov 2018 06:04:30 -0800 (PST) X-Google-Smtp-Source: AJdET5dDB/tCH7qSejc4T+EyQV7cTsvj+zspamkstHXXR2CtDE7Qbh3YdmhlXzOGHRpsNQCA6Uqs X-Received: by 2002:aa7:8497:: with SMTP id u23mr16006759pfn.220.1542981869906; Fri, 23 Nov 2018 06:04:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542981869; cv=none; d=google.com; s=arc-20160816; b=MtisZoxLim72ZML3BwYUzrCRd0lCP3pLWM15eSADqimElmBwYsc+9sEYcAOeZFvw/7 XnMORK/07d4HwXlJVH/uqQuL8Z7rt4iN+z10XpXQVfHDY9Fmv5Emju/fFusiST/BETkU Ufr/Ozr6NICThm/D5YQPzKMKgBj57xgjF2DBXL1upQiIDeWD3joJ02YquEbOckzHdCAb oYRmkbRkCXEY/BUSE6BB6wjnoo7WgZEwrDofXk5pkjAx6athk42FES6r9x6syblNIx9O A6SqfKgdMEn6U8V6P9To2Tu56Dkhhb81dzwQ5ZpS4ONxngm7QDtFcOhydAdEin0gWB6z BupQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=s/LihdQ9FBCMUYKK6G4sr4UeutBqk68GBLhp4VD/iok=; b=cUGNT1KMYvWbl/fGN5AuVeOtVzj6jiQ0rZKlvoJie0ea3XUkOhQTVPohfZDuH6lkHX GsrPL4PinzDtM2cAi4SJk2eHfAL90o/scur1GwOqYXYxW/iz4rtUNSyb4m9OFayyiRmh 1OS8ExMM868hkb4utRSjgckrtZHKHOxGGYCTTU0F7fITOAfy5s/344p0jM2npoEYKbci RJ54ODW0FeOpd7bUOIhj+tE3QnglT2gokRuUXe3miIjI6+TM3O8AFLlcG0v2XpgRsu88 SNHrsO2/GqburhOXyPFTLNM9kD2el8t/wfqcrPwpwMMB8jh5CvF1GSlV+oGr7b+vL0Ab X8wA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a195si38945707pfd.143.2018.11.23.06.04.01; Fri, 23 Nov 2018 06:04:29 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391246AbeKVW04 (ORCPT + 99 others); Thu, 22 Nov 2018 17:26:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:11949 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726671AbeKVW04 (ORCPT ); Thu, 22 Nov 2018 17:26:56 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5301C394D30; Thu, 22 Nov 2018 11:47:54 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.142]) by smtp.corp.redhat.com (Postfix) with SMTP id 3CB34103BAB7; Thu, 22 Nov 2018 11:47:53 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 22 Nov 2018 12:47:54 +0100 (CET) Date: Thu, 22 Nov 2018 12:47:52 +0100 From: Oleg Nesterov To: Andrei Vagin Cc: linux-kernel@vger.kernel.org, "Eric W. Biederman" , Andrew Morton Subject: Re: [PATCH] ptrace: take into account saved_sigmask in PTRACE_{GET,SET}SIGMASK Message-ID: <20181122114751.GA28270@redhat.com> References: <20181120060616.6043-1-avagin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181120060616.6043-1-avagin@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 22 Nov 2018 11:47:54 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/19, Andrei Vagin wrote: > > case PTRACE_SETSIGMASK: { > sigset_t new_set; > @@ -962,6 +971,8 @@ int ptrace_request(struct task_struct *child, long request, > child->blocked = new_set; > spin_unlock_irq(&child->sighand->siglock); > > + clear_tsk_restore_sigmask(child); > + I am not sure I understand this change... I forgot everything I knew about criu, but iiuc PTRACE_SETSIGMASK is used at "restore" time, doesn't this mean that TIF_RESTORE_SIGMASK/restore_sigmask can not be set? IOW, could you please explain how PTRACE_SETSIGMASK should be used, and why it doesn't do something like if (test_tsk_restore_sigmask(child)) child->saved_sigmask = new_set; else child->blocked = new_set; which looks symmetrical to PTRACE_GETSIGMASK? Oleg.