From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 196393858001 for ; Thu, 25 Mar 2021 21:27:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 196393858001 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bp@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 210D3AF9C; Thu, 25 Mar 2021 21:27:38 +0000 (UTC) Date: Thu, 25 Mar 2021 22:27:33 +0100 From: Borislav Petkov To: "Bae, Chang Seok" Cc: Andy Lutomirski , "Cooper, Andrew" , Boris Ostrovsky , "Gross, Jurgen" , Stefano Stabellini , Thomas Gleixner , Ingo Molnar , X86 ML , "Brown, Len" , "Hansen, Dave" , "H. J. Lu" , Dave Martin , Jann Horn , Michael Ellerman , Carlos O'Donell , "Luck, Tony" , "Shankar, Ravi V" , libc-alpha , linux-arch , Linux API , LKML Subject: Re: [PATCH v7 5/6] x86/signal: Detect and prevent an alternate signal stack overflow Message-ID: <20210325212733.GC32296@zn.tnic> References: <20210316065215.23768-1-chang.seok.bae@intel.com> <20210316065215.23768-6-chang.seok.bae@intel.com> <20210325185435.GB32296@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 21:27:40 -0000 On Thu, Mar 25, 2021 at 09:11:56PM +0000, Bae, Chang Seok wrote: > But if sigaltstack()’ed with the SS_AUTODISARM flag, both on_sig_stack() and > sas_ss_flags() return 0 [1]. Then, segfault always here. v5 had the exact > issue before [2]. Ah, there's that SS_AUTODISARM check above it which I missed, sorry. I guess we can do a __on_sig_stack() helper or so which does the stack check only without the SS_AUTODISARM. Just for readability's sake in what is already a pretty messy function. Thx. -- Regards/Gruss, Boris. SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg