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 1FBB7C54FD0 for ; Thu, 23 Apr 2020 18:09:33 +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 CAE7C20767 for ; Thu, 23 Apr 2020 18:09:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ekJYVy1T"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="CdFotNnq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CAE7C20767 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=bEmhqN7/UyD2FlqxFD2xMFKelwbdw7CY8Cd+uejGzLY=; b=ekJYVy1TGr50bP d5dX6MNK9ta2ciK7+8sw6wfMJewBnRF2MZPNvB7+LwP5FpL5bGIcfZo8EUqzPlkgaGixoiyf2J9ND e1zuwNrGvekJkjA7Gbslh8BNmdtF613u33CUM6k7tPGpfl2MeFaq6eylh0P2wfHUw4J0eMuqNaI3K PesSEa6+jx1wm0hS+GkejX1PGNcAwdqQVA3wXqK19HmSv8VhcScHfIAg5BixV7EAHmsl7k9alVVhk x+teh/opKTJOLc7rAWmrYbEg0bc+a0ih4aYUzmENhvCqt48sFKHl29+W5zGNeAUheKxtNT8Fwtx9M L9aNxxeOSvqL3S3YhcFA==; 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 1jRgHz-0005ML-2q; Thu, 23 Apr 2020 18:09:31 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRgHw-0005Kg-Fh for linux-arm-kernel@lists.infradead.org; Thu, 23 Apr 2020 18:09:29 +0000 Received: by mail-pg1-x544.google.com with SMTP id g6so3265753pgs.9 for ; Thu, 23 Apr 2020 11:09:27 -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=KWVTVR9QPt8YpEnS6+rG3cx9IAZdQ2Peqca4Ud6UmSY=; b=CdFotNnqSpurMKkIu6CgBx6OkkmuS4dmePbH5JYO6Yb24rHfaG6bv/j6W3gwVuvGlR 64PbSSNPaH8ceQMVqvMs5BZdL4WabMg/+3TPoVNadaUwZ1CIY5Ft1srs/S6AInLWxtLR iKNcf7yWw+tp7Mv+in+N3g014ylhLnJOJ++nc= 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=KWVTVR9QPt8YpEnS6+rG3cx9IAZdQ2Peqca4Ud6UmSY=; b=BzM86Atdx6Px3+V8TUiLTDopKgAP2EOnp1LqnfkLHrJa30adjS4H0Jtx4kf6mf5m42 XC0JghAqC9n2voQ2Ufiv7L6qcpt/jlv33UNSLCXUgCatIlybmtJbm/4cH2FNAMWe0r9M 5kna8D2dLi3/X099MQ5lFe+G/Tq9F5lsDryR0IrD5Ky4U5uok2Qjppj9DoSKvRIz2W85 btMbEWvz5RqGIw8JYsgMXipAIyOccVcD4TWLLoyMYxfAQOwpkkSr9VmHeCUuHaAri6Qt zZGj1aCZ1lvmJQeJQC10MyczYW07Adj4HDH8umFJajlhcb7nc6qdtxc0U6lprMcBxp2j PBSg== X-Gm-Message-State: AGi0PuYkX5eJeaXOMPyYnl2Q6+q8TqRD2TKztGpCOYMeLEOsJvp0O9Ts lg+fTI6DsATpOQ1SzuA67D1swA== X-Google-Smtp-Source: APiQypLMPu77yfYvTCVDe2sNxmi176/dfhJmzHOmLBk67EV18fTOD0x11gPSr7XgMYCWAsHYZmXLuw== X-Received: by 2002:a63:5c01:: with SMTP id q1mr4899728pgb.177.1587665367464; Thu, 23 Apr 2020 11:09:27 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id d184sm3152431pfc.130.2020.04.23.11.09.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Apr 2020 11:09:25 -0700 (PDT) Date: Thu, 23 Apr 2020 11:09:24 -0700 From: Kees Cook To: Will Deacon Subject: Re: [PATCH v12 01/12] add support for Clang's Shadow Call Stack (SCS) Message-ID: <202004231108.1AC704F609@keescook> References: <20191018161033.261971-1-samitolvanen@google.com> <20200421021453.198187-1-samitolvanen@google.com> <20200421021453.198187-2-samitolvanen@google.com> <202004221052.489CCFEBC@keescook> <20200422180040.GC3121@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200422180040.GC3121@willie-the-truck> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200423_110928_525271_F5183934 X-CRM114-Status: GOOD ( 14.54 ) 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 , Juri Lelli , kernel-hardening@lists.openwall.com, Peter Zijlstra , Catalin Marinas , Marc Zyngier , Masahiro Yamada , clang-built-linux@googlegroups.com, Ingo Molnar , Sami Tolvanen , Laura Abbott , Dave Martin , Jann Horn , Steven Rostedt , linux-arm-kernel@lists.infradead.org, Michal Marek , Ard Biesheuvel , Nick Desaulniers , linux-kernel@vger.kernel.org, Miguel Ojeda , James Morse , Masami Hiramatsu 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 Wed, Apr 22, 2020 at 07:00:40PM +0100, Will Deacon wrote: > On Wed, Apr 22, 2020 at 10:54:45AM -0700, Kees Cook wrote: > > On Mon, Apr 20, 2020 at 07:14:42PM -0700, Sami Tolvanen wrote: > > > +void scs_release(struct task_struct *tsk) > > > +{ > > > + void *s; > > > + > > > + s = __scs_base(tsk); > > > + if (!s) > > > + return; > > > + > > > + WARN_ON(scs_corrupted(tsk)); > > > + > > > > I'd like to have task_set_scs(tsk, NULL) retained here, to avoid need to > > depend on the released task memory getting scrubbed at a later time. > > Hmm, doesn't it get zeroed almost immediately by kmem_cache_free() if > INIT_ON_FREE_DEFAULT_ON is set? That seems much better than special-casing > SCS, as there's a tonne of other useful stuff kicking around in the > task_struct and treating this specially feels odd to me. That's going to be an uncommon config except for the most paranoid of system builders. :) Having this get wiped particular thing wiped is just a decent best practice for what is otherwise treated as a "secret", just like crypto routines wipe their secrets before free(). -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel