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=-8.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 A6743C433ED for ; Wed, 31 Mar 2021 21:56:43 +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 2171461002 for ; Wed, 31 Mar 2021 21:56:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2171461002 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=erplPaS+wbC0aNFtoajnyUz523Vmv11IEa3eGcxwa9k=; b=gRSMc+w7TLUh5JiaFwjuSryxp pHEwPM9kNMJxJ5pY2ff/gABlvkb3z1rVSY0Ls0FPh8oABxzsHS3Pgd6yTWdLeFuJDFoJrhMs4ifpY KNFTxQ+tYt6jkLxPkiNU/XdyVc4fHeHrhjtaWy/MjMSCFc+n278Bky/gG5Nj2abN9LyHOXiOAzjdD CP7aNSP212unLLGnK8NPvfN3kWuqg/HidKb1AErIaeDVzv0pnQ6HpYYkCmXyC34NNyJuSyGWzsmOi inFmm55z+r2ua9ioJ1rUPX/+2s8S1OrTHba9xjAkg2ytcHQskXE3Lf1bwiTcS6rNr9/OgQq9XlpGf /R611aaow==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lRinp-007m6f-Fb; Wed, 31 Mar 2021 21:55:05 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lRink-007m5n-1U for linux-arm-kernel@lists.infradead.org; Wed, 31 Mar 2021 21:55:01 +0000 Received: by mail-pf1-x42d.google.com with SMTP id x126so15479689pfc.13 for ; Wed, 31 Mar 2021 14:54:59 -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=rtsfbkg65ln578BueP2qKUJ2W4TVYylDnpFNvn0AmZY=; b=lFIjHUpJ6J2bChkAW6VFomn72sxkplIQywWFLHMael4kNCA63jvDhP8bxintcnt5bw KQBjDW0tdgan1Mw+ew9YOivDWjvq1y/RLhovgps8HPve8vSaz1UqvITEKhuq5UCgL/Wz NM80b1+1PpQm7Vs1o0Fx6Yx2NIh0Uno3lLAkY= 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=rtsfbkg65ln578BueP2qKUJ2W4TVYylDnpFNvn0AmZY=; b=dccXoEh5kcWz+XZASdw7dSr1trDAopD0JNpXmPmXSBDC9CnZGeLGSHkxZqCFlX1CDS WR16ZjyQFhMOenBDqzO9YBmk6jL+SkrgaJdR5ZX4qSMH3eVRh6fzT2B5xgN/4sUkihro nB7uN7gPFcFmU2VptGt2aUW9DPe6m9332WOO2St58AcuZiwlV35+S5hnk4LHZ0xnWkS2 f2KZiWPN7vpM0QjYjWlHerSV6LyN84F9vw1jwYAQ4YyRDmUDyTYjanLPDgDJCV1eAJyG zfk81/c8m9JCCE9ZxWgWy+pqeWsGxxsAt/879FKnNq7erPHL5AHi4ybln4DH+ETwfKBb DPJw== X-Gm-Message-State: AOAM531WFHgQriYEz1B/Gc/1kiYhgfzzgQ4GrwEXyvcA9bXEaD4T5/sY +4gwEfBHeTs8T3A4CpsZNFmD1Q== X-Google-Smtp-Source: ABdhPJy+ITLzRDWVQZ4QLokxo3xwGBU2j8b+z7YKdSsnEN/k5kQuDOdpvQny/ml71yhjeB4NsIqJiQ== X-Received: by 2002:a05:6a00:22c6:b029:201:1166:fdad with SMTP id f6-20020a056a0022c6b02902011166fdadmr4839743pfj.58.1617227698663; Wed, 31 Mar 2021 14:54:58 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id y5sm3199222pfl.191.2021.03.31.14.54.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Mar 2021 14:54:58 -0700 (PDT) Date: Wed, 31 Mar 2021 14:54:57 -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: <202103311453.A840B7FC5@keescook> References: <20210330205750.428816-1-keescook@chromium.org> <20210330205750.428816-4-keescook@chromium.org> <87im5769op.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87im5769op.ffs@nanos.tec.linutronix.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210331_225500_173208_EF83ADF6 X-CRM114-Status: GOOD ( 17.97 ) 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 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. > Other than that. > > Reviewed-by: Thomas Gleixner Thank you for the reviews! 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...) -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel