Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5641195ybi; Tue, 4 Jun 2019 09:39:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBcbDok/ammOM9i2uAqczsKxQRvz+9fgjtCb5TbOGCaL/5450UbjiZCJv2oFzA2CSKHfUF X-Received: by 2002:a17:90a:fa0e:: with SMTP id cm14mr6786134pjb.115.1559666355859; Tue, 04 Jun 2019 09:39:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559666355; cv=none; d=google.com; s=arc-20160816; b=tr10suQ7qPlGgNovac/FsoOM41C3macOk5h0XFSKLYlCXEN9sH353Xz7s0XO5Fgdkk iKCalJQKuk+hptWNA3Bdb73iWZ09gWAqgE/5YiBWUhXqL9AHgre4ZZ0hzcnYO7uP/N5z AmfuiIPWE+jD1VnkVHogRePwWHjTcV0prPkgy+YWL5XvQei5inEq4EOysQmnCK6V2bVu qi6L8lizK2Xqv0SG1Ojq8mFQzEmzL7kcsXHkmZ/BpsggmRXL5BGEr86HJA3JFy0MZsK7 Q1BV1YJohHJ52WsKTDZ8doslH9b59tjCVwMupLIEUIivM9/TvRJmu6n+p69B7FoNFQZr StNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=aE1/cHd8DzTD9FjBXgqCGhUsUZ/Ac0/w2Hl806C0EWM=; b=i5kkNOx5bU9UX3seBFWeCjsp4yZURJ1pQgXmWSXR/DSWUogdgoRe9qZ4N8U273WBVS c6CtTZYFxB/EM0Obj7Q0f1xLN+XtDCmmjc1t7TLLFv2ieR0K89P5n2Xli2mLYjNfh6u3 i9U8rMa+CxspW3B8w5S/z5IJNh6GjIwUzvN8M+dsYlN6zmdkynZREu0u/BHhMgzPxvQG zez1L2mWN4onoNBNa6IX9cEv+3xBmU1b7fS2xj9Uqh2iGx+n/q4F1xZ3FICQ6gCchpqT lyadhH3wSEJpA3DPllsY8JDmzy2pLW9tl9vfd+x3VCUKPrj+5TsDk7LIyDDn0P9wONf1 Fgjw== 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 m10si23310399pgq.420.2019.06.04.09.38.58; Tue, 04 Jun 2019 09:39:15 -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 S1727853AbfFDQho (ORCPT + 99 others); Tue, 4 Jun 2019 12:37:44 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:36792 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727451AbfFDQho (ORCPT ); Tue, 4 Jun 2019 12:37:44 -0400 Received: by mail-qk1-f196.google.com with SMTP id g18so3262506qkl.3; Tue, 04 Jun 2019 09:37:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aE1/cHd8DzTD9FjBXgqCGhUsUZ/Ac0/w2Hl806C0EWM=; b=gBZi01V6we8APcZYiBHBU8npGyh1ko7XZA+weiRBOCKEk6+rZUepKd7at1Y1GJUzXI 0HjNgHij9va6VYS6Hd7y37zamsi2pCQftku47zA4pPT/IA1BwWv4Jwt8LLbZ9YB1IpeP u2ZWC9zaVaEiLyfYg5WViwQ0zSesnalr2ivIzzNx2EWnkGSjZKf7EWnGPEFihd6L2w9K qr8vfx9F64jUyMeWhJlD3hcqsbYXT5Iq7S2HRGAg3+u53HnbzvE/10nYD66IYTYjGv1S 3lsvpvcoCXM0HI7ffmV//7oFe1/R+FM0fuN8xK7J381tTD6uO987VkqT6rVGC9OPNIOx BFww== X-Gm-Message-State: APjAAAWkIaBx2izAtaO3FH0O8D+0u4Tng1tKUTJkjsMFa9IE94swWuKQ +l2/L57qr0WMZLcwA9vOJ98P+cWZqg1xB2+3+ho= X-Received: by 2002:a37:a4d3:: with SMTP id n202mr27466154qke.84.1559666262799; Tue, 04 Jun 2019 09:37:42 -0700 (PDT) MIME-Version: 1.0 References: <20190522032144.10995-1-deepa.kernel@gmail.com> <20190529161157.GA27659@redhat.com> <20190604134117.GA29963@redhat.com> In-Reply-To: <20190604134117.GA29963@redhat.com> From: Arnd Bergmann Date: Tue, 4 Jun 2019 18:37:26 +0200 Message-ID: Subject: Re: [PATCH] signal: remove the wrong signal_pending() check in restore_user_sigmask() To: Oleg Nesterov Cc: Andrew Morton , Deepa Dinamani , Linux Kernel Mailing List , dbueso@suse.de, Jens Axboe , Davidlohr Bueso , e@80x24.org, Jason Baron , Linux FS-devel Mailing List , linux-aio , omar.kilani@gmail.com, Thomas Gleixner , "# 3.4.x" , Al Viro , "Eric W. Biederman" , Linus Torvalds , David Laight Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 4, 2019 at 3:41 PM Oleg Nesterov wrote: > > This is the minimal fix for stable, I'll send cleanups later. > > The commit 854a6ed56839a40f6b5d02a2962f48841482eec4 ("signal: Add > restore_user_sigmask()") introduced the visible change which breaks > user-space: a signal temporary unblocked by set_user_sigmask() can > be delivered even if the caller returns success or timeout. > > Change restore_user_sigmask() to accept the additional "interrupted" > argument which should be used instead of signal_pending() check, and > update the callers. > > Reported-by: Eric Wong > Fixes: 854a6ed56839a40f6b5d02a2962f48841482eec4 ("signal: Add restore_user_sigmask()") > cc: stable@vger.kernel.org (v5.0+) > Signed-off-by: Oleg Nesterov Acked-by: Arnd Bergmann I hope Eric can test this with the original reproducer, or maybe someone could create a test case that can be added into LTP. Arnd