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=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 08B22C433ED for ; Thu, 1 Apr 2021 06:33:26 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 859BD600EF for ; Thu, 1 Apr 2021 06:33:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 859BD600EF 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+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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc: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=SI2CPGWDYAfIW9fPR1eOltvWGRt2cveUHwFWcmsFigA=; b=efcp69hI3BCd1RTRtWUgUHX7X SNuzMBiLTC0MGXheG6OFWSqBO8sAJYU6m3sxMuOuoFD7QfcvhzDOzM/nZV8Awj+J6C8PAvbmr01MQ w10yoW6kVKyPNwc46kyZ93U7y8E76XMMcLkkmeHNI0EtRT5D7Ir2PMJF8sFlFmHi8DHZSl6b2rLQW 7JOsZilqg05O7kjDP7mV0j1Q0KSrTWchDNSCSK7mlYfeeOHl4Di+RGOTO0NgRnyg7KTlarvn6PNz6 zilUzWOHNysogTn3xchA7eFgtiyvrVHALPEoJlPXLLGJkPqJhpofq0EAO7WnGBAeg77O5x4N+0UJf JaEPVK/qg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lRqs4-008gDk-If; Thu, 01 Apr 2021 06:32:00 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lRqrn-008gCA-38 for linux-arm-kernel@lists.infradead.org; Thu, 01 Apr 2021 06:31:58 +0000 Received: by mail-pl1-x631.google.com with SMTP id l1so494192plg.12 for ; Wed, 31 Mar 2021 23:31:42 -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=hfTiBhDabA7pBPLjBpIi4iWvrEHL2e3DeE4vbI5tAiE=; b=INuoEL/r01BHe5/0yKi04SaL6KiDFwaY3kVglmh8y1egtrKhBcEeVSMQq834wTyuHZ qDvvBOvmZArmoVNPOp/MXHjJ9+bCFSVaPsePM0Sw+bRDQEqjhousEsLqTQ9dRxVkOvYx HBppUlDY7Djx+X/wpLnFxgFe7TiS6kNvMLqwc= 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=hfTiBhDabA7pBPLjBpIi4iWvrEHL2e3DeE4vbI5tAiE=; b=MeFwViUOZSBQStzQ/uI2RUKDQx9Rxs6+3qOcu+4OGw/ZQvE1hz7rrLl/qwCD4Q5U+L E1ldNEfMs9RH/qRO+l0XaMh6wNW52CXGnpSfHS7tIAFY344d5JhaiVuskdyx7K2mH2kV QMC1mARrmlZoA0aXHMi/lQcyPW9yk7W+Oo3eu6pfirTc87Q3fFnb0gQaizJsC3vVG7G2 ZYP2TjIQlZYu+t6rdxxcOfOPX4ry4W60dNN4ED7TFFzvy8iWbvlyiC/SjEpsIue+rrEI B+cbjVvFkTzCTB4Uv4VTuBDokmbJqCOUWJJI5LjqQdmkpfOMN3j8RqMOg3svcuucIiNS atGg== X-Gm-Message-State: AOAM533AZFyvNSZdkRJBeOk0xNXoEeeWFqrsxbXjPbidc7IVuOyjbTQb yXuYKznkKxBEa7UMQsfg2lclEQ== X-Google-Smtp-Source: ABdhPJybf6kMo+xaigSfWlgtmn9ANKW+eH5leA3QXT6lgzLQyGzKLYlDgQSa+C8d5xDIMNkOgP5Eag== X-Received: by 2002:a17:902:6b43:b029:e6:3d73:e9fb with SMTP id g3-20020a1709026b43b02900e63d73e9fbmr6546739plt.37.1617258701439; Wed, 31 Mar 2021 23:31:41 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id gf20sm4300574pjb.39.2021.03.31.23.31.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Mar 2021 23:31:40 -0700 (PDT) Date: Wed, 31 Mar 2021 23:31:39 -0700 From: Kees Cook To: Thomas Gleixner Cc: Elena Reshetova , x86@kernel.org, Andy Lutomirski , Peter Zijlstra , Catalin Marinas , Will Deacon , Mark Rutland , Alexander Potapenko , Alexander Popov , Ard Biesheuvel , Jann Horn , Vlastimil Babka , David Hildenbrand , Mike Rapoport , Andrew Morton , Jonathan Corbet , Randy Dunlap , kernel-hardening@lists.openwall.com, linux-hardening@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 3/6] stack: Optionally randomize kernel stack offset each syscall Message-ID: <202103312329.394CCA13CF@keescook> References: <20210330205750.428816-1-keescook@chromium.org> <20210330205750.428816-4-keescook@chromium.org> <87im5769op.ffs@nanos.tec.linutronix.de> <202103311453.A840B7FC5@keescook> <87v9973q54.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87v9973q54.ffs@nanos.tec.linutronix.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210401_073143_242860_95E667E0 X-CRM114-Status: GOOD ( 23.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Apr 01, 2021 at 12:38:31AM +0200, Thomas Gleixner wrote: > On Wed, Mar 31 2021 at 14:54, Kees Cook wrote: > > On Wed, Mar 31, 2021 at 09:53:26AM +0200, Thomas Gleixner wrote: > >> On Tue, Mar 30 2021 at 13:57, Kees Cook wrote: > >> > +/* > >> > + * Do not use this anywhere else in the kernel. This is used here because > >> > + * it provides an arch-agnostic way to grow the stack with correct > >> > + * alignment. Also, since this use is being explicitly masked to a max of > >> > + * 10 bits, stack-clash style attacks are unlikely. For more details see > >> > + * "VLAs" in Documentation/process/deprecated.rst > >> > + * The asm statement is designed to convince the compiler to keep the > >> > + * allocation around even after "ptr" goes out of scope. > >> > >> Nit. That explanation of "ptr" might be better placed right at the > >> add_random...() macro. > > > > Ah, yes! Fixed in v9. > > Hmm, looking at V9 the "ptr" thing got lost .... I put the comment inline in the macro directly above the asm(). > > Do you want to take this via -tip (and leave off the arm64 patch until > > it is acked), or would you rather it go via arm64? (I've sent v9 now...) > > Either way is fine. Since the arm64 folks have been a bit busy, can you just put this in -tip and leave off the arm64 patch for now? Thanks! -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel