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 5F1CCC3A5A9 for ; Mon, 4 May 2020 18:06:19 +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 32876206B8 for ; Mon, 4 May 2020 18:06:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DfRBqE7w"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="VfjjNs3D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 32876206B8 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=5st3mWOG4G3Ix0hbEhJ9nTegQKQXzTMYFHqHaISUipY=; b=DfRBqE7wdIcvnX 2C1yv0XbRbOERP9hUik+54CstuIBKRbC2JQVyBF0jF/UBbuacm5FfOUjzcIW1BUnMabO/mSCwc8wb hpYJ1q1iYv/S6smcSVJoRx5dnVwVsT69eWqpJWmCFSQgMviewYSsF4/gewyVgpVGHHPa2GIMmOShF SaOqPy9p2E0Mfb47hIQVs5Km5V8ySzww1FRFBDY4OUWpOFi1UJp/f8h3FSSLAHWux0ErrbFubAcqT ZjVMNKeML1BcqMwMkcBwGlG5gKtlO2qTEaLPI3ck1HYceWfcrI8dZvY8f+A0RLgxwP2nNn5II8llZ k5Rdz9cZXYsRcFmB+f5Q==; 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 1jVfTr-0000dX-Qo; Mon, 04 May 2020 18:06:15 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jVfTl-0000br-Kp for linux-arm-kernel@lists.infradead.org; Mon, 04 May 2020 18:06:14 +0000 Received: by mail-pg1-x542.google.com with SMTP id s18so110247pgl.12 for ; Mon, 04 May 2020 11:06:08 -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=5H5y0GT0IX1bjv46W43wTOmcN/3DzOsesayYr+f385c=; b=VfjjNs3D1ejtb+5tDVnv4xIxeWbWw/o38mrHwOZ5Gwkc82EKTZ7pb9asTgtjF5BOl5 Zqs4vbc5AMjqxgNOipERymQfeg78d3WB44sQWSCPyzc8fjFCFil4qhPuqg1dVU2c7TEV A6XlZfrUYCmdVmssHy2yO3uNUZUiSM/Gfc3ko= 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=5H5y0GT0IX1bjv46W43wTOmcN/3DzOsesayYr+f385c=; b=IiQBHXv2P1EZthLAtkOyUdEAYBMKLOo11PYv/YzJeUDtjyDYxmDCq3eMBZbMr+xLKo jR7Z/e5kdza+sFZU4vYyKlvl9Y/6azZI3WC+0Wo0Ttm1p9QXe1dWzoG5bdbZPs1ooufa MuJtwhJAZY6PDMB+SSw/KAZjgSULHJw+AdioiSe1jDDb2PO5N2pvXWQx7zwnL04gmp83 0AarjzYiunrydnZZNwBDrMSLTrVAdyl4DNzWdnLieChadngo3OCSa/WTUjrurQudESO3 EBXhiQZzcn+KPKoHTsHDnKJjEzJrVJpxwTrp2QhmzqtpEACJ0zm77XR26ng9wKqf5aI0 GWHw== X-Gm-Message-State: AGi0Pub0FEpvYC2FnP8O7jXQ41PzHbz+2jJx1B0il4Arav+1V/9fMOAp q32R0aZtdwZdhdmganWgIwU+HQ== X-Google-Smtp-Source: APiQypIlcStIRBl6cHaGQp3N0+X9MfO14Oi4jnSZEiTTEcv+6ntBV7uerro/crzxcPaqm3zz3v5luA== X-Received: by 2002:a65:4c83:: with SMTP id m3mr201796pgt.128.1588615568087; Mon, 04 May 2020 11:06:08 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id p2sm8099142pgh.25.2020.05.04.11.06.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 11:06:07 -0700 (PDT) Date: Mon, 4 May 2020 11:06:06 -0700 From: Kees Cook To: Will Deacon Subject: Re: [PATCH v11 01/12] add support for Clang's Shadow Call Stack (SCS) Message-ID: <202005041050.7E29A56637@keescook> References: <20200416161245.148813-1-samitolvanen@google.com> <20200416161245.148813-2-samitolvanen@google.com> <20200420171727.GB24386@willie-the-truck> <20200420211830.GA5081@google.com> <20200422173938.GA3069@willie-the-truck> <20200422235134.GA211149@google.com> <202004231121.A13FDA100@keescook> <20200424112113.GC21141@willie-the-truck> <20200427204546.GA80713@google.com> <20200504165227.GB1833@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200504165227.GB1833@willie-the-truck> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200504_110609_711209_35BFDC2A X-CRM114-Status: GOOD ( 19.32 ) 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 Mon, May 04, 2020 at 05:52:28PM +0100, Will Deacon wrote: > On Mon, Apr 27, 2020 at 01:45:46PM -0700, Sami Tolvanen wrote: > > On Fri, Apr 24, 2020 at 12:21:14PM +0100, Will Deacon wrote: > > > The vmap version that I asked Sami to drop > > > is at least better in this regard, although the guard page is at the wrong > > > end of the stack and we just hope that the allocation below us didn't pass > > > VM_NO_GUARD. Looks like the same story for vmap stack :/ > > > > SCS grows up and the guard page is after the allocation, so how is it at > > the wrong end? Am I missing something here? > > Sorry, I'd got the SCS upside-down in my head (hey, that second 'S' stands > for 'Stack'!). But I think I'm right about vmap stack, which feels a > little fragile even though it seems to work out today with the very limited > uses of VM_NO_GUARD. Yeah, when VMAP_STACK was originally being developed, IIRC, there was an effort made to eliminate all the users of VM_NO_GUARD, and it looks like it's mostly there. Really the only use left is arm64's kernel image mapping routines, and then it's not actually used in the traditional sense -- it's just a boolean for whether to toss in a guard page at the end of the data section, and the VMAs are built manually. I think that code could actually be refactored to drop it too and then the only user would be KASAN, which, IIUC, wants to build consecutive vmap areas. -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel