Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp499667pxb; Fri, 8 Jan 2021 10:12:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJyo2cQ99vbi/INUZGYwN6m5Sx1yq9dXGETFoxTF7DMydNOmuT2qtMAE6AOjlwl8ZabAnwUN X-Received: by 2002:aa7:d608:: with SMTP id c8mr5980073edr.260.1610129527550; Fri, 08 Jan 2021 10:12:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610129527; cv=none; d=google.com; s=arc-20160816; b=Lv3eNxYl+zA0PBap/DP+B/u62CsOMnnY8OHwij8WQ/GpOq95zsbLqyS3940N72u4Gz +lC7zM/blBxV4McLhUU7IfcvucecMCAUb7BkpPJaDNexasv3o7PJqNcOxWQfoAzUUMiy bN1uzuobzb41rAV4ZICBddB450KZL9E8qZOgBdVxAb8TVVQBg9KmukcmFMTYbVD5Mxkl G2Hx4x62j6jnv/5p5KlmLYhTFErl69Ld1NLlUKlprPLjgBJzk4yYd74LXnhJKuDDm+12 qv7BeKgvNFGjVYHEMG+RrZhiPrwZzzsvZThQTHU5SkKt5+q3niKkfwJw2VgbJEUvoTAm 6Drw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=QjVquzcPBLQ/5wx/T2SiQgFd0wnC0HJR12amNmWLPVk=; b=G8g9yG6HNqo7f96FgkLDhyWcLk1mFa3MDs3JMf0FpvWLjIusjgv09L10tkgSZgdhQj 9dXojcQgbjAer0/0vcjg43x+k+zlZy5OGRjpHgHsJ6VkIZLs/v0yZ+ZNY2JQmYX2UsLi GAp5UcRpWxb1aafxa6Ix1zgny9l5F2Ro1A/SBbFrExz4q0WpImMYI8PdqpJPY7rq3LvZ LUlpAA0qlFvPkh1gf93Ak0FOcwI9OcXR2a+uKFqiNvtRiGKaJPuTipZw9Q62zuasci0a BP18PY3/7tbe4c+D9ofFvw+IeIXSUI091a37dGGHO9aeJOcXqkK8LI+hxlRQYjKp+xhE bObw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p9si3878910edq.97.2021.01.08.10.11.33; Fri, 08 Jan 2021 10:12:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728114AbhAHSKP (ORCPT + 99 others); Fri, 8 Jan 2021 13:10:15 -0500 Received: from mx2.suse.de ([195.135.220.15]:57156 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727910AbhAHSKO (ORCPT ); Fri, 8 Jan 2021 13:10:14 -0500 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 A723EAD29; Fri, 8 Jan 2021 18:09:32 +0000 (UTC) Date: Fri, 8 Jan 2021 19:09:35 +0100 From: Borislav Petkov To: "Chang S. Bae" Cc: tglx@linutronix.de, mingo@kernel.org, luto@kernel.org, x86@kernel.org, len.brown@intel.com, dave.hansen@intel.com, hjl.tools@gmail.com, Dave.Martin@arm.com, jannh@google.com, mpe@ellerman.id.au, tony.luck@intel.com, ravi.v.shankar@intel.com, libc-alpha@sourceware.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 3/4] x86/signal: Prevent an alternate stack overflow before a signal delivery Message-ID: <20210108180935.GB12995@zn.tnic> References: <20201223015312.4882-1-chang.seok.bae@intel.com> <20201223015312.4882-4-chang.seok.bae@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201223015312.4882-4-chang.seok.bae@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 22, 2020 at 05:53:11PM -0800, Chang S. Bae wrote: > The kernel pushes data on the userspace stack when entering a signal. If > using a sigaltstack(), the kernel precisely knows the user stack size. ^^^^^^^^^^^^^^^^^^^^^^^ Formulate properly. > > When the kernel knows that the user stack is too small, avoid the overflow > and do an immediate SIGSEGV instead. ^^^^^^^^^^^^^^^^^^^^^^^ Ditto. > This overflow is known to occur on systems with large XSAVE state. The > effort to increase the size typically used for altstacks reduces the ^^^^^^^^^^ "alternate signal stacks" -- Regards/Gruss, Boris. SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg