From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F94CCA9EC9 for ; Fri, 1 Nov 2019 03:59:51 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id AA242208CB for ; Fri, 1 Nov 2019 03:59:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="LILcQjVb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA242208CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-17220-kernel-hardening=archiver.kernel.org@lists.openwall.com Received: (qmail 1736 invoked by uid 550); 1 Nov 2019 03:59:45 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Received: (qmail 1712 invoked from network); 1 Nov 2019 03:59:44 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=jWbfirm5A7lClilm5TrxMUwFVETsZ0QZ3dgXNGgwJk0=; b=LILcQjVb+J77OLR0Wqh8wnQrNbg/1wbjTbvcWvcASlmFUoRhF+FiABYaQL4F6fbQbF uxzeSY91YoL9miij3Kit1NzjdfNC1KqoUlTChwS9qCXgWIlOVwAzcIYT52gA3K2PVO/8 zI4nwynvLe0KA4Pq1Usu8zAit0zL/9zkfYAew= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jWbfirm5A7lClilm5TrxMUwFVETsZ0QZ3dgXNGgwJk0=; b=GfYHrILE1r8yttPpk0kwlj+sgBP8RjvOrHfHji5uPjHnL6Slml51eH/OBB7IWoKajs HIpkM4cB/xIJehceU7q/YEcp3WI/dFo63YfZHXkJEMvdod852ICQE0uKKJ8Ec2AeHm6S e05fSWYUBJyF6uVd8t4qjW0oloPenlKCWnqnacBgXw4c3lZmDFSSocUGnNs4qEwwxZEB jUireutr3BeTnT+gflQc75UJXjViv3kMi4PZ2vftSD59mp+dzDsVjrjWERkdG9cUC1zi 5bXI3l+y7w1mgmg+Gb6OeFg4+mb4dYY60s0YhfDLhpoKZyE/oKB3Oao6aCEUiUkTlXnx 560w== X-Gm-Message-State: APjAAAXhLJEtzUuXs0uL0ABcgu+xlN8cg/zK7PfF0E1C8bAAKgj+TqCB ABrma7WxnfrDJXz9SAY7XYPDwg== X-Google-Smtp-Source: APXvYqy5NPe898RXSU+w1c0UaOFby31e22ngkYRTC9hJdLIA+7oZafTpdC/J3+7KdM9QjpM8htFvPw== X-Received: by 2002:a63:ee48:: with SMTP id n8mr11288858pgk.374.1572580772699; Thu, 31 Oct 2019 20:59:32 -0700 (PDT) Date: Thu, 31 Oct 2019 20:59:30 -0700 From: Kees Cook To: Nick Desaulniers Cc: Sami Tolvanen , Will Deacon , Catalin Marinas , Steven Rostedt , Masami Hiramatsu , Ard Biesheuvel , Dave Martin , Laura Abbott , Mark Rutland , Jann Horn , Miguel Ojeda , Masahiro Yamada , clang-built-linux , Kernel Hardening , Linux ARM , LKML Subject: Re: [PATCH v3 13/17] arm64: preserve x18 when CPU is suspended Message-ID: <201910312059.59F983B@keescook> References: <20191018161033.261971-1-samitolvanen@google.com> <20191031164637.48901-1-samitolvanen@google.com> <20191031164637.48901-14-samitolvanen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Oct 31, 2019 at 10:34:53AM -0700, Nick Desaulniers wrote: > On Thu, Oct 31, 2019 at 10:27 AM Sami Tolvanen wrote: > > > > On Thu, Oct 31, 2019 at 10:18 AM Nick Desaulniers > > wrote: > > > > +#ifdef CONFIG_SHADOW_CALL_STACK > > > > + ldr x18, [x0, #96] > > > > + str xzr, [x0, #96] > > > > > > How come we zero out x0+#96, but not for other offsets? Is this str necessary? > > > > It clears the shadow stack pointer from the sleep state buffer, which > > is not strictly speaking necessary, but leaves one fewer place to find > > it. > > That sounds like a good idea. Consider adding comments or to the > commit message so that the str doesn't get removed accidentally in the > future. > Reviewed-by: Nick Desaulniers Yeah, with the comment added: Reviewed-by: Kees Cook -Kees -- Kees Cook From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEA31CA9EC9 for ; Fri, 1 Nov 2019 03:59:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ADC322083E for ; Fri, 1 Nov 2019 03:59:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Bj0zrELN"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="LILcQjVb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ADC322083E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=A2f15GLLHuObE6G9PP9zUd3wPebDCT+lp01RJV1OgDE=; b=Bj0zrELNHbiwCW tnBb6i3orD3Iz8cPOp3S9+Q6K5f18kGR0pTyWvuBY4Lb1lEAcrrnal4v26Qu8uR3/hu3jzEwn3hK4 ANZzQeXueTerBRZNnTTXHo/bMhEM9poEmqe4wfcU8p8TYHQRZWP4Dtbu9ZNzHP/S+VrFo49Nbfa/8 uwRsETrdyFnQyhX4eak9sxOxX1eCm5g+eSJ6ldcd1GLubwrMhW7YpsFbD3LqTyHxqLGmo0ddsWpvW dbNCRiSqchmKNnZt4SacA3ZP+zOq7IsFuRpBJ8uLKWh813FmhVlYbEmWlYJZ/n10iktqqx20fmrR0 bufQn0rWiVKtpjpz9LIg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iQO64-0002OP-CA; Fri, 01 Nov 2019 03:59:36 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iQO61-0002Nw-AE for linux-arm-kernel@lists.infradead.org; Fri, 01 Nov 2019 03:59:34 +0000 Received: by mail-pg1-x541.google.com with SMTP id l24so5595020pgh.10 for ; Thu, 31 Oct 2019 20:59:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=jWbfirm5A7lClilm5TrxMUwFVETsZ0QZ3dgXNGgwJk0=; b=LILcQjVb+J77OLR0Wqh8wnQrNbg/1wbjTbvcWvcASlmFUoRhF+FiABYaQL4F6fbQbF uxzeSY91YoL9miij3Kit1NzjdfNC1KqoUlTChwS9qCXgWIlOVwAzcIYT52gA3K2PVO/8 zI4nwynvLe0KA4Pq1Usu8zAit0zL/9zkfYAew= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jWbfirm5A7lClilm5TrxMUwFVETsZ0QZ3dgXNGgwJk0=; b=nSdp9T8bic/j5cLXrBZoOLzVfw/PuLSl6O+b3FbIzqEpQBqXsejVqeD1Mkls/C7cA4 QwQOLWcLd2GTmxVgcRw4jlYxRxp5C4iyEqzaq+hq6WfBzevsfYEqPi2B+yz+ZIOvIb5/ 94sRwZMdItoOorJ7kjQS/evKznL0ISFTzVx0oSuu03vJCXsyM9XSZAx6nDsTWjLd/wbU BAJJ6qhGz+cGSMjuPDR5fu40gzITytkXLnH+IP/J88poBvRmC1jJ85D9EoXAvwnhZWXr PMj9E2eL/cO34dV/tLBZJeSKLS3MJqeWIhwgszrfwbSBCTvxSqiLWidkIBhpKqlC48IZ w7cw== X-Gm-Message-State: APjAAAWlBdWnZLyqyG9BA3cj2ah+1N25B2tYwPq5uwiCnePMRjpqPLt0 ZgNFlFzQpZEQpQiqh7p9qJwuUw== X-Google-Smtp-Source: APXvYqy5NPe898RXSU+w1c0UaOFby31e22ngkYRTC9hJdLIA+7oZafTpdC/J3+7KdM9QjpM8htFvPw== X-Received: by 2002:a63:ee48:: with SMTP id n8mr11288858pgk.374.1572580772699; Thu, 31 Oct 2019 20:59:32 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id c184sm5427852pfc.159.2019.10.31.20.59.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2019 20:59:31 -0700 (PDT) Date: Thu, 31 Oct 2019 20:59:30 -0700 From: Kees Cook To: Nick Desaulniers Subject: Re: [PATCH v3 13/17] arm64: preserve x18 when CPU is suspended Message-ID: <201910312059.59F983B@keescook> References: <20191018161033.261971-1-samitolvanen@google.com> <20191031164637.48901-1-samitolvanen@google.com> <20191031164637.48901-14-samitolvanen@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191031_205933_355385_517C68F2 X-CRM114-Status: GOOD ( 12.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , clang-built-linux , Ard Biesheuvel , Masahiro Yamada , Catalin Marinas , Jann Horn , LKML , Steven Rostedt , Miguel Ojeda , Masami Hiramatsu , Sami Tolvanen , Kernel Hardening , Laura Abbott , Will Deacon , Dave Martin , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Oct 31, 2019 at 10:34:53AM -0700, Nick Desaulniers wrote: > On Thu, Oct 31, 2019 at 10:27 AM Sami Tolvanen wrote: > > > > On Thu, Oct 31, 2019 at 10:18 AM Nick Desaulniers > > wrote: > > > > +#ifdef CONFIG_SHADOW_CALL_STACK > > > > + ldr x18, [x0, #96] > > > > + str xzr, [x0, #96] > > > > > > How come we zero out x0+#96, but not for other offsets? Is this str necessary? > > > > It clears the shadow stack pointer from the sleep state buffer, which > > is not strictly speaking necessary, but leaves one fewer place to find > > it. > > That sounds like a good idea. Consider adding comments or to the > commit message so that the str doesn't get removed accidentally in the > future. > Reviewed-by: Nick Desaulniers Yeah, with the comment added: Reviewed-by: Kees Cook -Kees -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel