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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A9698C2BA18 for ; Thu, 20 Jun 2024 10:29:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Subject:Cc:To: From:Date:References:In-Reply-To:Message-Id:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9DuHh1KUC6QNlhdJh8j9SaPiDZmfHHzRY28gydQgPZU=; b=SmVBjJRXtuGJ6vxFqE5ASR9Q6T c5qPKDTqzPjG9QTwjlkRfdqET0NhuC/mLK/OsyfFlwG10EWRG9MnMEEVFeMuS1xdXso6JCL6oNkfP dbzk5Ka0L9jBCvQnjfzY+6E0YBz5jvPDcZnK8iDEJ9j6125uVAw55PY4OLVLX68kC3TSlATPajx/V TOOrXS42ErWJaLWLPy7lLKe07Bt8IAGkgYYLYY9e1nOaIh9RzdYzarOxwUX55UvY/GrxR8iP30NG5 r92RGdmeQ0OCMqe8EPOQpDXO4bIhOlcJsJcYAeoNByqGp7TRtK27cVroFN8hBrielk/VHuqPAbQ60 486JFuVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKF2n-00000004Zw4-0nzo; Thu, 20 Jun 2024 10:29:29 +0000 Received: from wfhigh3-smtp.messagingengine.com ([64.147.123.154]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKF2k-00000004ZvR-12p8; Thu, 20 Jun 2024 10:29:28 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.west.internal (Postfix) with ESMTP id 32B8318000AC; Thu, 20 Jun 2024 06:29:21 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Thu, 20 Jun 2024 06:29:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1718879360; x=1718965760; bh=9DuHh1KUC6 QNlhdJh8j9SaPiDZmfHHzRY28gydQgPZU=; b=lgDJkdXPTSb9wVrl66jQWjyl4H HcSr6DUI/PYMS/q97Aj3DgRgWjTF6AOIosQUQJXU3PksFQ3lHMbXK77Ry4Dk4xh2 3AQyMOpQpP38BbHX7XKNgTOBqTDxkSeVQsa0DHBf6jo+Zv5jcermhdXOJJvr1dUx NzmILs6yJhAsXSlnyY9AyhWGjMXFFo+WIsJoD+/+937gkHITZBYHe2cidNRIs5Y5 H8Rkm14XzWf1H50rW8mWFHA1UfDFlp9ryImDHRT4n8CALCZidl0INl63OJAOQDx7 WG8j83SrozcXwCoQnBRsUCf+uVqqOv97b3xzDNbBoyJ0DY5N3qY7VODhuqCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1718879360; x=1718965760; bh=9DuHh1KUC6QNlhdJh8j9SaPiDZmf HHzRY28gydQgPZU=; b=RVIL8M8tcKZ25A9GuQ66TolFwY1RPdLTIp+s48K2SkI1 zH2QCdoAmAewScpvQqwt24uLGl4JFm+UViGh1Hn0jJhgWR7jk/ogfIT/9oh29bPd /p+oDjaVXE18gK2Ba8Mz1oDI5IkuHbIlxJJEVutJunzC5peqn8vLvhnMJ4Iryd/Z i+hR/4GmJoRlFjZClts8KW8q/5yF7RZo4w25Z4Nfuch4URBRkcoi+6XTATyPc5CK IXZTxZU1UohSe19h+Ii4yQ/r3NjYwnMRp/2guduFYdUvDgzwZW4yXQfCbMQONl72 aIqdsde4esOxe7S7b2oRMPD36i8+XQSw6eMjR+lzpw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeefvddgfedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepvefhffeltdegheeffffhtdegvdehjedtgfekueevgfduffettedtkeekueef hedunecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id C1E51B6008D; Thu, 20 Jun 2024 06:29:18 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-522-ga39cca1d5-fm-20240610.002-ga39cca1d MIME-Version: 1.0 Message-Id: In-Reply-To: <20240619214711.work.953-kees@kernel.org> References: <20240619214711.work.953-kees@kernel.org> Date: Thu, 20 Jun 2024 12:28:57 +0200 From: "Arnd Bergmann" To: "Kees Cook" Cc: "Yuntao Liu" , "Mark Rutland" , "Catalin Marinas" , "Will Deacon" , "Heiko Carstens" , "Vasily Gorbik" , "Alexander Gordeev" , "Christian Borntraeger" , "Sven Schnelle" , "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , "H. Peter Anvin" , "Gustavo A. R. Silva" , "Paul Walmsley" , "Palmer Dabbelt" , "Albert Ou" , "Leonardo Bras" , "Claudio Imbrenda" , "Pawan Gupta" , linux-kernel@vger.kernel.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, linux-hardening@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH] randomize_kstack: Remove non-functional per-arch entropy filtering Content-Type: text/plain X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240620_032926_467427_21E2C2CD X-CRM114-Status: GOOD ( 11.94 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 19, 2024, at 23:47, Kees Cook wrote: > An unintended consequence of commit 9c573cd31343 ("randomize_kstack: > Improve entropy diffusion") was that the per-architecture entropy size > filtering reduced how many bits were being added to the mix, rather than > how many bits were being used during the offsetting. All architectures > fell back to the existing default of 0x3FF (10 bits), which will consume > at most 1KiB of stack space. It seems that this is working just fine, > so let's avoid the confusion and update everything to use the default. > > The prior intent of the per-architecture limits were: > > arm64: capped at 0x1FF (9 bits), 5 bits effective > powerpc: uncapped (10 bits), 6 or 7 bits effective > riscv: uncapped (10 bits), 6 bits effective > x86: capped at 0xFF (8 bits), 5 (x86_64) or 6 (ia32) bits effective > s390: capped at 0xFF (8 bits), undocumented effective entropy > > Current discussion has led to just dropping the original per-architecture > filters. The additional entropy appears to be safe for arm64, x86, > and s390. Quoting Arnd, "There is no point pretending that 15.75KB is > somehow safe to use while 15.00KB is not." > > Co-developed-by: Yuntao Liu > Signed-off-by: Yuntao Liu > Fixes: 9c573cd31343 ("randomize_kstack: Improve entropy diffusion") > Link: https://lore.kernel.org/r/20240617133721.377540-1-liuyuntao12@huawei.com > Signed-off-by: Kees Cook Reviewed-by: Arnd Bergmann