Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1505701ybm; Tue, 21 May 2019 15:29:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwHrFVzoqWEi9otkHbSlF8nXQOTDud2nPALenH8apOZjvwzt/2qmlTo+03FdIFW2dSV6x0Y X-Received: by 2002:a63:42:: with SMTP id 63mr86167453pga.337.1558477753937; Tue, 21 May 2019 15:29:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558477753; cv=none; d=google.com; s=arc-20160816; b=CF/PVmqHoDCiM3+Nbc+Nt2OJtS9mHH4AmGODjCb1DcYXOCOs/pJIFjIwE1kHjRECzT RTrBXmA5+QuX/KBVty5MVUeUGchhdWfvaWKZxdtylEdsHgzrsHHCKLyHc1QveqeXf5LJ RbDYEjfwLoqki79fB1ackydTUMX06cWC2rhNAaeS3Jc/xsdU+bw0BoGHSzpWm+6rMmEE wcc3FgSVLV/cJA0d5y8YIKuH6tlqnZ0QCw/+DFBrdhKz0PPt7iv1e6DxrgcJipB9JEUR SRk2bELmBW93kcC2Pj/+IPHtZQPeA4doJ6vD93ldiVaKyz4NjfSZ8djMSO0Y0lgjP8/2 XPHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Yu3aFk6LsgJTR7JxoDFuSV4Gf+TWhAyC3q9kRDhOIzs=; b=SZjVMC0TikfUMUVu2doLYeww4G0y3cjyFri5hRz9i9Pg3R8ft+Ba5GtKm3NcSbNTZv ZHY1ql94wtCVWUbVHeyo/5HbzKDdwDpocSpNO1xGzmUKPCmmsm1ApHZGeg8UYsgErLHD v74r25sUnQ+M1154RN4QKyWlW6n/hZSFpuf8Eo4ywpXtYVZhj8qnQM/UDNjLs+rFsGRJ fls9wN1ROtUzNLVQwez4k4lcxiHu4//6HVJ6WP8CEBZvFMjLvXuanM4hc/ap252g9QZI asBYFZ5+LYpNKhp8V/HBjykOwYvSKFDuMpmDPVUYg9oDYbPSIegIHrDaFP71xvXl6c1x pY8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aYlPqqP8; 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 cp18si14422500plb.196.2019.05.21.15.28.58; Tue, 21 May 2019 15:29:13 -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; dkim=pass header.i=@kernel.org header.s=default header.b=aYlPqqP8; 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 S1727385AbfEUW1u (ORCPT + 99 others); Tue, 21 May 2019 18:27:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:50018 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726017AbfEUW1u (ORCPT ); Tue, 21 May 2019 18:27:50 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) (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 F2A5C217D7; Tue, 21 May 2019 22:27:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558477669; bh=f5uEoHUN4BmcdB5I8paRLRa+KIbFOaIzyTepmZ7yDes=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=aYlPqqP861Eho4x2nqqJFvRWWd/odtIQcz9aqclko8lAceqQYjeJ/t5tGi1KP0wiJ 038YM5HOU3qLCLPDaAKxkytnBl/M5vZrjsK5K7vMh2XNjz4DcB73WwBR2Yl2AJi/Sm bOws1O/C+vDEjEsToQuVRz5LZMZVnS7PF8zdTE5Q= Date: Tue, 21 May 2019 15:27:48 -0700 From: Andrew Morton To: Eric Wong Cc: Deepa Dinamani , linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, arnd@arndb.de, dbueso@suse.de, axboe@kernel.dk, dave@stgolabs.net, jbaron@akamai.com, linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, omar.kilani@gmail.com, tglx@linutronix.de, stable@vger.kernel.org, Oleg Nesterov Subject: Re: [PATCH 1/1] signal: Adjust error codes according to restore_user_sigmask() Message-Id: <20190521152748.6b4cd70cf83a1183caa6aae7@linux-foundation.org> In-Reply-To: <20190521092551.fwtb6recko3tahwj@dcvr> References: <20190507043954.9020-1-deepa.kernel@gmail.com> <20190521092551.fwtb6recko3tahwj@dcvr> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 21 May 2019 09:25:51 +0000 Eric Wong wrote: > Deepa Dinamani wrote: > > For all the syscalls that receive a sigmask from the userland, > > the user sigmask is to be in effect through the syscall execution. > > At the end of syscall, sigmask of the current process is restored > > to what it was before the switch over to user sigmask. > > But, for this to be true in practice, the sigmask should be restored > > only at the the point we change the saved_sigmask. Anything before > > that loses signals. And, anything after is just pointless as the > > signal is already lost by restoring the sigmask. > > > > The inherent issue was detected because of a regression caused by > > 854a6ed56839a. > > The patch moved the signal_pending() check closer to restoring of the > > user sigmask. But, it failed to update the error code accordingly. > > > > Detailed issue discussion permalink: > > https://lore.kernel.org/linux-fsdevel/20190427093319.sgicqik2oqkez3wk@dcvr/ > > > > Note that the patch returns interrupted errors (EINTR, ERESTARTNOHAND, > > etc) only when there is no other error. If there is a signal and an error > > like EINVAL, the syscalls return -EINVAL rather than the interrupted > > error codes. > > > > The sys_io_uring_enter() seems to be returning success when there is > > a signal and the queue is not empty. This seems to be a bug. I will > > follow up with a separate patch for that. > > > > Reported-by: Eric Wong > > Fixes: 854a6ed56839a40f6b5d02a2962f48841482eec4 ("signal: Add restore_user_sigmask()") > > Signed-off-by: Deepa Dinamani > > Reviewed-by: Davidlohr Bueso (top-posting fixed). > It's been 2 weeks and this fix hasn't appeared in mmots / mmotm. > I also noticed it's missing Cc: for stable@ (below) Why is a -stable backport needed? I see some talk above about lost signals but it is unclear whether these are being observed after fixing the regression caused by 854a6ed56839a. IOW, can we please have a changelog which has a clear and complete description of the user-visible effects of the change. And please Cc Oleg.