Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp18283imu; Tue, 27 Nov 2018 08:27:01 -0800 (PST) X-Google-Smtp-Source: AFSGD/XpuYwE2IH0oMAMlyPRXledjs2AAuVs3OIzY9RePdtko7wkISODub1QwRC17qdiC7iWmF4l X-Received: by 2002:a17:902:9a07:: with SMTP id v7mr14256929plp.247.1543336021806; Tue, 27 Nov 2018 08:27:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543336021; cv=none; d=google.com; s=arc-20160816; b=UAba6IDgh5j8J06/SRm3La66dPX2d4njIusH7PTBb0temjthS9cuuyNdZQvWHRt6cU RjlUuAnAZoZb2HkVoX0seDzRpX7xx+oKBurV/zD/v504uaGFLbxUqHkPZlhEUbM3ayEc zUie/ohPYqlfeZpHVT2gUJqQdhX6TyyCLt6hNZjjcsdMtHJTtGEDU7Te2GlCMsfCHr+O qkVVLh6b9Nq/tkmy4PfsWpIMUpXoV7Mqmrlc5UO+p4BIwObb9fz9TKPGC4zbctO5h66q TxIcm0gM9kmSLTNywHVk8+FZwA2xOL5Ww9eVMc56tB7yFJBQqjJRMJSI66i18Crx2/5H X6Mw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=43HtaEFblOa8KXWppfWm9w6QCQG17R2XRhd5QmA0GIM=; b=NJzRUSpDahbZ4MopYZCXAxVvYs13adxrudmmdyE/6Qbube5lscfyrQ4MZ/iUZWpmek SmGasMO7CkRTdPCtnTQO2FgMX8e7HksIHdwVSejZLkYzhexTflk7WAy1KBDOQMa9zz5A eLQ7QlCXrqxZtJk+ZSCeu3bTpTdR6AB3aw2hGalRgCYl0FNM2XzJeMYH8ekSdRQntInS 8/yg8dbBOhvplvF+JP68sHBRmGKqobSgJEhY7SFgdmLKTcZao7SoYsZYQVrOCb+CDqNG YUADFpFVE8rwSnqL3SlnJO1qzKxeHSSThKIkklN8cDnRFnLwYghqtPiLSQ5hTjJqJtdd R3ig== 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 ay7si3755643plb.410.2018.11.27.08.26.23; Tue, 27 Nov 2018 08:27:01 -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 S1730872AbeK1DVy (ORCPT + 99 others); Tue, 27 Nov 2018 22:21:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34856 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726510AbeK1DVx (ORCPT ); Tue, 27 Nov 2018 22:21:53 -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 30C1D3001FFB; Tue, 27 Nov 2018 16:23:29 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.12]) by smtp.corp.redhat.com (Postfix) with SMTP id 2D9DE105705A; Tue, 27 Nov 2018 16:23:28 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 27 Nov 2018 17:23:28 +0100 (CET) Date: Tue, 27 Nov 2018 17:23:27 +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: <20181127162326.GB13284@redhat.com> References: <20181120060616.6043-1-avagin@gmail.com> <20181122114751.GA28270@redhat.com> <20181127063758.GA10422@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181127063758.GA10422@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.45]); Tue, 27 Nov 2018 16:23:29 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/26, Andrei Vagin wrote: > > > IOW, could you please explain how PTRACE_SETSIGMASK should be used, and why > > it doesn't do something like > > > > CRIU uses PTRACE_SETSIGMASK?when it injects a parasite code into a > target process. In this case, we have to be sure that when the process > is resumed by PTRACE_CONT, it will not start handling signals and > executing signal handlers. So iiuc CRUI uses PTRACE_SETSIGMASK to block all signals, run the parasite code, then restore the original sigmask. Assuming that CRIU also turns ERESTARTNOHAND into syscall-restart (I think it does ;) everything looks correct... OK, I think the patch is fine. Oleg.