Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3319517imj; Tue, 19 Feb 2019 01:07:58 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib/m3QpJvuqj5g6+PI4zGFT/X8MtmCIlTsWLTmodHBGZxq1TKC5xwEh9ko4VLlGhN+fxtLO X-Received: by 2002:a17:902:14b:: with SMTP id 69mr29005433plb.120.1550567278134; Tue, 19 Feb 2019 01:07:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550567278; cv=none; d=google.com; s=arc-20160816; b=f2d000iFTboWp0jMFBpGr2ybyyEDa8C7NV2EkMPGkusxmBz4yv3zV1NWvbShd1LwYy mY0U+ON9GRi/g4RVnT54IGo3nrnzMpCpJJOc69Q3xuUlD1+kuvAd2ek7B3qUi7L2A2f4 uVzyaqmBBDPNxdUYLZEUEUc02dQRTd4Pdf9d5WCv8Q5VXcKyoaiANuANa2ayf0+mOYtA s1qAe47CGDvdf/BytlzB2VWK90Lq50Vau4DAXiLhfKZZm4N2EBNe9O1O+LoQP+wBPqzm MbQPFKaXc1E8nFrAsForwpMH1HCZp+v5r62rNDTSQDIPVvMq2Jcw+rZnXplIPc6ON9cE wttw== 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:dkim-signature; bh=qgrUFp3usg7Q8ndo7M1EzU90TYleG5ZIbmTLNl4eH0I=; b=c0w9q9wtW851tulpJNuKylPI/I9YB46fmX28r3+EOSQQSqNLVUswvPkhBtZi+5SjkT S8excysMe8zLbJUower0bvrMlkWBen2/ctRNSqE0zkLKse5O3JodPVnONRAZFEz28emF jMKD5xmC+bDeSYz6kNC2Y5E+Y/FEodvaciPq70uw8xUNKEdfUvRdlioyIu1XBO4CfCff Q1kgkyw/8HaonZHNh0X/6IHlvBUBBv6RP9SnCqKnyusjbYq0Q7OhmZIwcr0nK5y2Zo8i 8WbJMpmqyYfJZPaoIK0qkM6CGKqM0zlMAQ1J3KPokeimNFaaVc5+4CRkotXOdSZ7zuQW vfLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2b7KO5W0; 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 p18si14811611pgk.308.2019.02.19.01.07.42; Tue, 19 Feb 2019 01:07:58 -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; dkim=pass header.i=@kernel.org header.s=default header.b=2b7KO5W0; 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 S1727766AbfBSJHS (ORCPT + 99 others); Tue, 19 Feb 2019 04:07:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:46828 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727429AbfBSJHS (ORCPT ); Tue, 19 Feb 2019 04:07:18 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9182D2146F; Tue, 19 Feb 2019 09:07:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550567237; bh=sMSKVV8l7NNhyoKncEMpbp0IQtcuBeEA4/nd5VD74Bc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=2b7KO5W0zH5AqZL8nn6L0a9837a2FBlP1SWTEkqjGRChBH+Mb6dFjQampblQrScPg NUDAPSwqVyy5YnhWuUr/PaVOz8ba2SfmmeCTwWCLGLpfB5uEG5AGd5vSNzuBEC+JCt R/jID5QxHZb2PztXj0S4wksttgkosXBUWFctGbEs= Date: Tue, 19 Feb 2019 10:07:14 +0100 From: Greg Kroah-Hartman To: Jiri Slaby Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Dmitry Vyukov , "Eric W. Biederman" Subject: Re: [PATCH 4.20 11/50] signal: Always notice exiting tasks Message-ID: <20190219090714.GA27102@kroah.com> References: <20190213183655.747168774@linuxfoundation.org> <20190213183656.733725215@linuxfoundation.org> <95a41702-ac6a-cd58-2ca5-71d879ee923c@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <95a41702-ac6a-cd58-2ca5-71d879ee923c@gmail.com> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 19, 2019 at 07:23:41AM +0100, Jiri Slaby wrote: > On 13. 02. 19, 19:38, Greg Kroah-Hartman wrote: > > 4.20-stable review patch. If anyone has any objections, please let me know. > > > > ------------------ > > > > From: Eric W. Biederman > > > > commit 35634ffa1751b6efd8cf75010b509dcb0263e29b upstream. > > > > Recently syzkaller was able to create unkillablle processes by > > creating a timer that is delivered as a thread local signal on SIGHUP, > > and receiving SIGHUP SA_NODEFERER. Ultimately causing a loop > > failing to deliver SIGHUP but always trying. > > > > Upon examination it turns out part of the problem is actually most of > > the solution. Since 2.5 signal delivery has found all fatal signals, > > marked the signal group for death, and queued SIGKILL in every threads > > thread queue relying on signal->group_exit_code to preserve the > > information of which was the actual fatal signal. > > > > The conversion of all fatal signals to SIGKILL results in the > > synchronous signal heuristic in next_signal kicking in and preferring > > SIGHUP to SIGKILL. Which is especially problematic as all > > fatal signals have already been transformed into SIGKILL. > > > > Instead of dequeueing signals and depending upon SIGKILL to > > be the first signal dequeued, first test if the signal group > > has already been marked for death. This guarantees that > > nothing in the signal queue can prevent a process that needs > > to exit from exiting. > > > > Cc: stable@vger.kernel.org > > Tested-by: Dmitry Vyukov > > Reported-by: Dmitry Vyukov > > Ref: ebf5ebe31d2c ("[PATCH] signal-fixes-2.5.59-A4") > > History Tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git > > Signed-off-by: "Eric W. Biederman" > > Signed-off-by: Greg Kroah-Hartman > > This patch breaks strace self-tests in 4.20.9. In particular, > "threads-execve": > https://github.com/strace/strace/blob/master/tests/threads-execve.c > https://github.com/strace/strace/blob/master/tests/threads-execve.test > > The test received some fix a day ago, but it did not help in this case: > https://github.com/strace/strace/commit/2a50278b9 > > Only a revert of the above patch helped. > > I don't know if the strace's test is broken (which is quite usual in > cases like these) or the patch affects some user-visible behaviour -- > e.g. could this be a reason for sh failures in the build farm? > > Any ideas? Does cf43a757fd49 ("signal: Restore the stop PTRACE_EVENT_EXIT") help with this? It's queued up for the next round of stable releases and is in Linus's tree. thanks, greg k-h