Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp719046rwl; Wed, 12 Apr 2023 03:10:32 -0700 (PDT) X-Google-Smtp-Source: AKy350Y2LgSte+g9fKNv7H1lkIVpB5BkeSRNkeq+atv6Of6pvR2HfKRTEVh8LeIHYiC55LlZxfZa X-Received: by 2002:a17:906:1641:b0:946:bfb0:de85 with SMTP id n1-20020a170906164100b00946bfb0de85mr13205459ejd.70.1681294232435; Wed, 12 Apr 2023 03:10:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681294232; cv=none; d=google.com; s=arc-20160816; b=jluqezli5aVgog/W1iyMOI+AL2JIYzXBjcPuN9HsW4ShuUVCPaZo3NWk05bMSKZ9ER jJFe73lxsfyaPyAWQKso9F0BeVMEPp2sIKLCypEn8AXDIMRM1STIbWmbJlQXBVsSQ0bk nF7vJGfiVGxWXGuugGPyVdNssIeOLGzBrdEr3BHz3bTxGSMmolRJeU1vw9Ggsaz/DeCn AYhYZJo2DjmayiSCkXW8hcLnlqzYqjEuDZM2NQwK06gTx/YpsDVPczGtXi4hU+fk0nsg 9Tkmh+LJHuu8KRabGQ94YmNXu8SLjhpWp2Fw2Bll6o0IwvRDW+yBEPtNtqeGrwkxfRlU hkJw== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Rf9eJ5MxefQIK/ifripExuzMMOs4WN1VhFiKtB5ZmWY=; b=TOo4Hix6YYXv1rLPZoaFwQ2FnfTV/l0+WbYz3MUKIWXPyWWsv6iV6ufPSxUargmyLc HpVG5YjbiLyXoCnFimEFSfhQleT80cB9jb4zniJqhMW/M7kCUTcDu5TSadZ4uHH2JiYP v/f31XdEEblgC8jiXBP7VDeKOmpEW7cDkOcjBxjYCXJLt/OfB78bgcOAIla29tiNyxzc 92sUOBprTteeDjnqHKVEXHsKbQxagTt6IxbecjP1k1etaVuHw/SBeHXGLxRVyN2UYU4l khhIqsiQB7Gz9igJEpbz1MyKiDhgz+Sy6MgqlUWzWE9FpR+i/wfyKoun6+BseRRZor3O jtOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fj12-20020a1709069c8c00b0092ca204119esi1580844ejc.570.2023.04.12.03.10.04; Wed, 12 Apr 2023 03:10:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229977AbjDLKHM (ORCPT + 99 others); Wed, 12 Apr 2023 06:07:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229661AbjDLKHJ (ORCPT ); Wed, 12 Apr 2023 06:07:09 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6C61D975D for ; Wed, 12 Apr 2023 03:06:37 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 85F7FC14; Wed, 12 Apr 2023 03:07:17 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.21.3]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1B6283F587; Wed, 12 Apr 2023 03:06:31 -0700 (PDT) Date: Wed, 12 Apr 2023 11:06:29 +0100 From: Mark Rutland To: Heiko Carstens Cc: Kees Cook , Alexander Popov , Vasily Gorbik , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] stackleak: allow to specify arch specific stackleak poison function Message-ID: References: <20230405130841.1350565-1-hca@linux.ibm.com> <20230405130841.1350565-2-hca@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 12, 2023 at 11:58:07AM +0200, Heiko Carstens wrote: > On Wed, Apr 12, 2023 at 10:03:46AM +0100, Mark Rutland wrote: > > On Wed, Apr 05, 2023 at 03:08:40PM +0200, Heiko Carstens wrote: > > > Factor out the code that fills the stack with the stackleak poison value > > > in order to allow architectures to provide a faster implementation. > > > > > > Acked-by: Vasily Gorbik > > > Signed-off-by: Heiko Carstens > > > > As on patch 2, it might be nicer to have a noinstr-safe memset64() and use that > > directly, but I don't have strong feelings either way, and I'll defer to Kees's > > judgement: > > Wouldn't that enforce that memset64() wouldn't be allowed to have an own > stackframe, since otherwise it would write poison values to it, since we > have > > if (on_task_stack) > erase_high = current_stack_pointer; > > in __stackleak_erase()? Yes, sorry -- I was implicitly assuming that a noinstr-safe version would be __always_inline. > That was actually my motiviation to make this s390 optimization an always > inline asm. > > Besides that this wouldn't be a problem for at least s390, since memset64() > is an asm function which comes whithout the need for a stackframe, but on > the other hand this would add a quite subtle requirement to memset64(), if > I'm not mistaken. That's a fair enough justification, I think. Thanks for the details! Thanks, Mark.