Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8304913ybi; Thu, 6 Jun 2019 09:57:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyArellEkm8jUXVmkydid7CN2Zb7WxFoMvjDvXpN/xqgGVxai/LHyrn2LSGqvvJ4QwoA14m X-Received: by 2002:aa7:8188:: with SMTP id g8mr4663633pfi.221.1559840225973; Thu, 06 Jun 2019 09:57:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559840225; cv=none; d=google.com; s=arc-20160816; b=dDxObCk/FjN8ODNmtZIdIpBozxQUbc2yi33T3N7EcGhmgzU4chtBuC7bSTQDMf2aYI AdzOZ3xB+SZdlvbHhgXwENn/YFaFpcilU1wmz5uMK5avlwyAGu+LcmrMztQuUrhmSeU1 H3nobNOjUhW6U/+pPeCl5pBczSZ26QjsMehFVeBfwo4Ncch+StnDcBZ9Ynwqpunhus5u +ivIr3M3oqwTRY76a9bpkgnb2Y8y0eUkH0zBuFUYj4AVixxWPqBNTU6eQyKXJDPT9pjV fkhSArQfdLwmF+FpOEC7gDx0xxXkaqyWrYv3rNDK5R2+FmNmtg0MY9ImsDan3V+F2FCE K21Q== 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; bh=mPpSFXzetRVrvfTrLv8ZBDqmhlSFUMV5K5WVOALNrVc=; b=E94HprfeF5vPYYSumxR8oqgdAqV7atyxFTgIucTK6Bg/HdP9jCQR6qf6ZUYw3EGN4L peGnOr90hKLF17XPRVBz83a2CCmcuhYkvTMTUprazYFUMaCLJ7wlE/48lI6X/hrel+Hm c4ZGPja5bcpqgEIJIklFP8e+tu2xobEWmKE0KSBdPPqrLQ/WqQC3PVSLzn03QAEfC9mD mgXK2FyRjAW6/ptYlDIPu+oWnlXXSZ3OZISPymi4H4qq59jeUaOWfRwc7SpmjNq5pCb5 Jr37sKiGj8RLxEjHmP2uYWdPj9P59OiVRuqBCJ8VzxsVA775GbSkR5DB2RpTSwFun0UM Lpkw== 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 g6si2458677pgu.383.2019.06.06.09.56.48; Thu, 06 Jun 2019 09:57:05 -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 S1727470AbfFFLFj (ORCPT + 99 others); Thu, 6 Jun 2019 07:05:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6381 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725784AbfFFLFi (ORCPT ); Thu, 6 Jun 2019 07:05:38 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D5D5B30872C3; Thu, 6 Jun 2019 11:05:32 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.159]) by smtp.corp.redhat.com (Postfix) with SMTP id 459EC2A333; Thu, 6 Jun 2019 11:05:23 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 6 Jun 2019 13:05:32 +0200 (CEST) Date: Thu, 6 Jun 2019 13:05:22 +0200 From: Oleg Nesterov To: David Laight Cc: 'Linus Torvalds' , Andrew Morton , Deepa Dinamani , Linux List Kernel Mailing , Arnd Bergmann , Davidlohr Bueso , Jens Axboe , Davidlohr Bueso , "e@80x24.org" , Jason Baron , linux-fsdevel , "linux-aio@kvack.org" , "omar.kilani@gmail.com" , Thomas Gleixner , stable , Al Viro , "Eric W. Biederman" Subject: Re: [PATCH -mm 0/1] signal: simplify set_user_sigmask/restore_user_sigmask Message-ID: <20190606110522.GA4691@redhat.com> References: <20190522032144.10995-1-deepa.kernel@gmail.com> <20190529161157.GA27659@redhat.com> <20190604134117.GA29963@redhat.com> <20190605155801.GA25165@redhat.com> <1285a2e60e3748d8825b9b0e3500cd28@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1285a2e60e3748d8825b9b0e3500cd28@AcuMS.aculab.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Thu, 06 Jun 2019 11:05:38 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/06, David Laight wrote: > > If a signal handler is called, I presume that the trampoline > calls back into the kernel to get further handlers called > and to finally restore the original signal mask? See sigmask_to_save(), this is what the kernel records in uc.uc_sigmask before the signal handler runs, after that current->saved_sigmask has no meaning. When signal handler returns it does sys_rt_sigreturn() which restores the original mask saved in uc_sigmask. > What happens if a signal handler calls something that > would normally write to current->saved_sigmask? See above. Oleg.