Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2266869ybm; Thu, 23 May 2019 14:08:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUgZ6/VosVzIZO5vNbpX+783sUCTJLf81N//NXh+jtgsYCHD3gI81GbERR3Efs/g3flUY1 X-Received: by 2002:a17:902:a98b:: with SMTP id bh11mr28311085plb.8.1558645705022; Thu, 23 May 2019 14:08:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558645705; cv=none; d=google.com; s=arc-20160816; b=ELWOlgAalJ4x4GKGqj5zKCz8P1+Uqe4qZbsD0maejTPesKPhG5n3diBOBAQGsINgLH d47jeklbh7Ayqwiy5FLJKBfVApds4DxHxM007i1hBdnO1VS12Icb6VY+isJmokJLG0SF WOex3OJEyXfPQcnADsC8Rkx39fUr3D953Er3EwjM4BLE5Y0NFNR4SkVotQ6xt0Fgp0/T jFP0fjeJtkLRr2OaG0XX9CkSll+M80lHV+9gbKdZOJHscE97+q9KMyB0cE80X8o6mZeX FuhJetdwPAiDvwjpleExiNjZj9TqqfmOTd58l0Kf2Gqpsq/MdZZoDnhP0EA5b7uqUORz Qlhg== 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:dkim-signature; bh=qdKz+TOs1wCAyZUw0giltCYWrjHfuqYDcD0Y730vB18=; b=XCxg04QIGhW+CarZcI9AbgxMe0Oq3Mm2OlrD+1UbXOxlh3wZnT9Ngs8ir9QAFCL3k6 R3QMGOb/fA+xOfgmzIzlVN+htDSvRiTKZyGYM1y2HA6F3se85fSoAe68Vfhaq123JYPL qxd32PKKDSPHb6FZUZNwRSFWpCGpSd0jZ4chFhGr7hlUrpW7oU4TQGgtR48z0ooT3QNb ydlt2OzovgOAJiz0U6+ZuSPG2/puxA9nNjWqrUR16IcT/qtk/biUAcXzgw+duzHZv1bg S/+2wZukGXvxWs9C2LXx1svAGQXRs9vQyELmJXYq8l/SQKJ6FC1TJ9gFnZQMDMnfHtqz eKyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="X1/pu0J+"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x12si964008plo.171.2019.05.23.14.08.07; Thu, 23 May 2019 14:08:25 -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=@gmail.com header.s=20161025 header.b="X1/pu0J+"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731633AbfEWVG6 (ORCPT + 99 others); Thu, 23 May 2019 17:06:58 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:52666 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731537AbfEWVG6 (ORCPT ); Thu, 23 May 2019 17:06:58 -0400 Received: by mail-it1-f193.google.com with SMTP id t184so12283158itf.2; Thu, 23 May 2019 14:06:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qdKz+TOs1wCAyZUw0giltCYWrjHfuqYDcD0Y730vB18=; b=X1/pu0J+wGbtPR2O2S+IZYCGPHacIpZIWlZOFWyrcdChosOCsJjjuHh8Pmjbpcd/iR v93QHkkPBOa+2R+cA7xBGf3GJGK02mE+fvVDdEqB4GgsTipeTPJ6UQCrvJq1kJdFsskk Hf68qhuoJF1y72HyQhy9UTR3pwbJ0O9GFSXpJUdO0NLDRyZ927qoRsk/ndLeG80c6yon KvRUWEcuvxzy08YY3EsZPEefJ9KlXLSN7/HrXAx4ZcfMc7utGhKD2QaS4QFHFQqcxvSq u6HahTlnlzCTKgxbW3PKFhDSjhK486kZuopYnyXvidTzXDyRLyYdnh+FR0DcMA72iFhD 4IYQ== 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=qdKz+TOs1wCAyZUw0giltCYWrjHfuqYDcD0Y730vB18=; b=q2kjOeNLaruz5fmvyfCne3jSuaf8mYtxhxjfy9NBJ93DP26a1Vvo8X7opb6xajTwim FCI62uCmeKsDyt2cZg8pfzRwLnnacCw+jPyu/IYG9U8wuJGTvPXItHAgkrybYyuyqUT4 vnTAjdiFhc6WaTYKpA3FaFmgJSuKfUjZAMhPxPaTEGgAFQ4orpiqMmoysuq6or1cBy7/ bsaLC4BIt6WGkrpLML+ZMm/9vEH2RGINbZE8+oY9mFSf5BHYc7u+/OZx9nS2647nyZst Hn1iRkgaH5VqN9A+OgTWhjvDIkGvi2ZVVESXwdbckqefRbDZo0gGZgptXBDtNiCVh4bL AWIw== X-Gm-Message-State: APjAAAXwSo24peNtu5zbjbvwO5v/O/2uhWZkuxb5OX1x8NvFDwHzS+Kr Ux0X58s5HblrdCFv+f9JTDezwAjui48HM5sGZ1Y= X-Received: by 2002:a24:e084:: with SMTP id c126mr14417307ith.124.1558645617016; Thu, 23 May 2019 14:06:57 -0700 (PDT) MIME-Version: 1.0 References: <20190522032144.10995-1-deepa.kernel@gmail.com> <20190522150505.GA4915@redhat.com> <20190522161407.GB4915@redhat.com> <4f7b6dbeab1d424baaebd7a5df116349@AcuMS.aculab.com> <20190523145944.GB23070@redhat.com> <345cfba5edde470f9a68d913f44fa342@AcuMS.aculab.com> <20190523163604.GE23070@redhat.com> In-Reply-To: From: Deepa Dinamani Date: Thu, 23 May 2019 14:06:45 -0700 Message-ID: Subject: Re: [PATCH v2] signal: Adjust error codes according to restore_user_sigmask() To: David Laight Cc: Oleg Nesterov , Linux Kernel Mailing List , Andrew Morton , Alexander Viro , Arnd Bergmann , "dbueso@suse.de" , "axboe@kernel.dk" , Davidlohr Bueso , Eric Wong , Jason Baron , Linux FS-devel Mailing List , linux-aio , Omar Kilani , Thomas Gleixner , "stable@vger.kernel.org" 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 > Just adding a little more clarification, there is an additional change > between [a] and [b]. > As per [a] we would just restore the signal instead of changing the > saved_sigmask and the signal could get delivered right then. [b] > changes this to happen at syscall exit: Rewording above, as there seems to be a few misrepresentations: Just adding a little more clarification, there is an additional change between [a] and [b]. As per [a] we would just restore the signal mask instead of changing the saved_sigmask and the even the blocked signals could get delivered right then. [b] changes the restoration to happen at syscall exit: > void restore_user_sigmask(const void __user *usigmask, sigset_t *sigsaved) > { > > > > /* > * When signals are pending, do not restore them here. > * Restoring sigmask here can lead to delivering signals > that the above > * syscalls are intended to block because of the sigmask passed in. > */ > if (signal_pending(current)) { > current->saved_sigmask = *sigsaved; > set_restore_sigmask(); > return; > } -Deepa