Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp691169imm; Thu, 26 Jul 2018 10:16:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdTuvhJSMHm8m5QTHomTJMig8ZGp9r1Zj8vcTxlNiwebh+ARUE0T+DgsCDonSWZvmeoIOzO X-Received: by 2002:a63:fa48:: with SMTP id g8-v6mr2787858pgk.224.1532625404875; Thu, 26 Jul 2018 10:16:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532625404; cv=none; d=google.com; s=arc-20160816; b=kZnC0gUVHyguBGBR27ivacYHhdFQy6pqKFZdYb9UX4vJSvy2nTGaZ0UFTyOKpCrGCS GzZfIioyQZ5c9Zi4d5IySgtO2UvLwZzWJxkzBJIwA2fux/ANZBPeKr+4PZumK9BrKxS4 ESsPvVvIx2tssrT3VN7SMvsNPbiy8SHJUck4yUQ7mIz9lONnjjUzlMICYbYcoFr25dEi nSad9+uiXUzGBbGFCB//P7g6wvgtuLpHVOHrpXf5yF+goWSdSQah6FxJYjWiHiWXOxKm 2CWnB4WznPin7yCYShYkO50iIEYHbv8iE7PiDWfLo3775nJ48Cy9JN5fU8v4vg2tfPfA 9YsQ== 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:arc-authentication-results; bh=BkZSB68BWFXZXSwOEbRy1VTE97PM/dnmGWAAnnqquvg=; b=yZPlOcB3ZfpGRPSePLNtnbLvZAdNGhI4B9T0/Yo2ZLtvWBku/ZAck4LclqMG3AgrqV 4FifDti2fdhtmpiKewca8wkNI2VdV1V4/JGFkwp4rwfXK6WV6k4d2jinOum8bF4h4aDf Q2n2fxCDwmUrTy1JoH4xV0gPvJoXZ9bs2BBWwO0mBk44+sEez90fF7w/G3c28rhyfDV/ 8CnvcGLgVuNoDzPFfRwJI2a1Clfe10W8uKHh7uZJWz+yLauULNj5S4jBJv6gFAVueDFB vmxUIT/Q8286YPy5KyXprEY7nnqXEC75UaHwMJFGir8OV6YDuLzK/bPBbyPtdUkp5XDP OQEw== 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 64-v6si1807000pgd.509.2018.07.26.10.16.29; Thu, 26 Jul 2018 10:16:44 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732072AbeGZRjU (ORCPT + 99 others); Thu, 26 Jul 2018 13:39:20 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38182 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730781AbeGZRjT (ORCPT ); Thu, 26 Jul 2018 13:39:19 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DC86E40216EB; Thu, 26 Jul 2018 16:21:46 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.34.27.30]) by smtp.corp.redhat.com (Postfix) with SMTP id 8D1DE2026D68; Thu, 26 Jul 2018 16:21:45 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 26 Jul 2018 18:21:46 +0200 (CEST) Date: Thu, 26 Jul 2018 18:21:44 +0200 From: Oleg Nesterov To: "Eric W. Biederman" Cc: Linus Torvalds , Andrew Morton , Linux Kernel Mailing List , Wen Yang , majiang Subject: Re: [PATCH v3 20/20] signal: Don't restart fork when signals come in. Message-ID: <20180726162144.GC32718@redhat.com> References: <20180724032419.20231-20-ebiederm@xmission.com> <874lgo5xdg.fsf@xmission.com> <87fu084cxj.fsf@xmission.com> <87a7qg4bb3.fsf_-_@xmission.com> <87pnzc2upf.fsf@xmission.com> <87k1pk2cj9.fsf_-_@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87k1pk2cj9.fsf_-_@xmission.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 26 Jul 2018 16:21:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 26 Jul 2018 16:21:46 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'oleg@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/24, Eric W. Biederman wrote: > > Similarly the current code will also miss blocked > signals that are delivered to multiple process, as those signals will > not appear pending during fork. Well, I still think this needs a separate change and discussion... Let me repeat, I simply do not know if this is good or not, I don't know if the current behaviour is by design or it is mistake. OK, I won't argue but note that your patch doesn't really fix the problem, > + spin_lock_irq(¤t->sighand->siglock); > + if (!(clone_flags & CLONE_THREAD)) > + hlist_add_head(&delayed.node, ¤t->signal->multiprocess); > + recalc_sigpending(); > + spin_unlock_irq(¤t->sighand->siglock); > + retval = -ERESTARTNOINTR; > + if (signal_pending(current)) > + goto fork_out; because recalc_sigpending() will not notice the blocked multiprocess signal if it is already pending. Oleg.