Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp144429ybg; Wed, 18 Mar 2020 19:18:52 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsSLpFi80+CrZKMWdukDJVn1k9amcTsMsoIR8lLxEVKuTHqKp+DIz+5ay9GFF8XC/XifX9P X-Received: by 2002:a9d:67c7:: with SMTP id c7mr519341otn.85.1584584332452; Wed, 18 Mar 2020 19:18:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584584332; cv=none; d=google.com; s=arc-20160816; b=BY3qesSuRqanZHM5dJxGRSSUJ0JsFn1ErVIAOSSGrxRhZqer7WO7JTqGEA8NIRZz8I OttrVz+zB3SH2AygTIB4egoJVx3DzwUohNEJZvp0aQEqmUcYqvImUNKGrfkm/cp0hCqY i8hKUHeC4TFLQpRMhs62O0m86H8q7b/K6EgqxNnRCraazr2f/xTuWoHI/HUpbg1qq6ij ENav8Egpmhf8AJx2cl2rfduAAXSZf9YWWzGlVIhry8lxK01jYQk+QnNOrwqu2TSx435O R0K97zE2vhpNbNJ6x+P7JfmHED6evOUUTGIL4wJPvfZqbTF1d5IQztul8PlnNbxBSEpO hjjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:cc:to:from:date; bh=kkC8iVvzS+S139zSIzkrOBf/33ldbSKUb4RYKImRqbE=; b=nxjroDOv38FYmbdJvxmacpf6Au/v8DTRq4XEAppcwZYGDFavgFWgkHSlDm+xTpNZkf lknHGb1DPmPbN+8Ak6w+MZLKtWtCLHmVeOf0xF7ZBnm4dWMLycb3fK4tfutFHSzWMkae AozYMdfuWcTQ/1jY7ris6wJyht92KEPyGR0ep+YtNg06G5iHz0nCtVznuExrzdxwWcVr FBT4kH6H36ggrjgu0IxebJUm7oh0tO9EPFoi5I1yRZH8hCYMwb25cKOfqi3RXcW3vR7x 6dhUEsQh/0EHYLnxSaX+7SSqKKnwrYVNJB1mNKwBdk+3VO/Gzs8SLKfKu6aDrc//8maK DLow== 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 n190si299590oig.207.2020.03.18.19.18.36; Wed, 18 Mar 2020 19:18:52 -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 S1727082AbgCSCQg (ORCPT + 99 others); Wed, 18 Mar 2020 22:16:36 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:54150 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726596AbgCSCQf (ORCPT ); Wed, 18 Mar 2020 22:16:35 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jEkjV-00Epvm-CK; Thu, 19 Mar 2020 02:16:29 +0000 Date: Thu, 19 Mar 2020 02:16:29 +0000 From: Al Viro To: Stas Sergeev Cc: Ingo Molnar , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC][possible bug] when should SS_AUTODISARM have effect? Message-ID: <20200319021629.GC23230@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Consider the following scenario: SIGPIPE has SA_ONSTACK handler, SIGSEGV - non-SA_ONSTACK one. SIGPIPE is delivered and we fail halfway through setting a sigframe for it. OK, we get SIGSEGV forced in, which gets handled not on altstack. But what should happen if we fail *after* having saved the altstack settings into the sigframe that got abandoned? AFAICS, we get them reset and the original setting entirely lost. Shouldn't that thing be applied only after we have succeeded in building the frame? In signal_delivered(), perhaps... I realize that this is out of scope for POSIX, so it's not a matter of standard compliance, but it looks like a bit of a QoI issue...