Received: by 2002:ab2:715a:0:b0:1fd:c064:50c with SMTP id l26csp27817lqm; Mon, 10 Jun 2024 11:34:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWnyBhSd0WRjwqjAtaAOFrMosJEvTly9nlkdWWJaYRJFg60CTc54i2BuojHTHNgBm6Od0VSvkx4mezn78rN0gzR9IfwFbzl2r3XvY78VQ== X-Google-Smtp-Source: AGHT+IFtNGA8Ny22VVzzxldIfeWMFN76gUMsMZFrML+IdOgcmUNwTjs1nO17S29au6le6CJL3+pk X-Received: by 2002:a17:902:680c:b0:1f7:2a95:f2d7 with SMTP id d9443c01a7336-1f72a95f584mr2706595ad.59.1718044450595; Mon, 10 Jun 2024 11:34:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718044450; cv=pass; d=google.com; s=arc-20160816; b=ikgeYQ+nEeKy9yyuNa6qpxLMA8ikOKRMeyFijqFTf1g7bZL1Ux5Ip4NvbOYaSSQLim 9vFGX4wlHu5kgR63u4XCJqtp+32+Ae+oC4TPZSzgWpPh/L4ksz0f453DdIGMP2Itr8Fi 5NglD3PHHjYNhMIWMcZLxDhe5ipCBrzE2Stg2JntOAFFN9ruSPswYXy14pns088YbmQn aGmHkVPgUymBj75m8ysNFAl1rYRO0cdS6wuZlGznkPylp6fjBSw6kLvn4pPFF2uSU34r gjAJovHsqsQKVVx99Xs+wwqSYW9F5+yBJdY6QhN+FZQj36aEGG+rfQh8pwJrug62+7O2 e9Gg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=37zNUKQYOoYltYhO5TRmaqN1hGRut7DSf96WM680ufg=; fh=92OBtp61OurCe/mjvkBnyzOh5YyxmCoAGXoN92C51Lo=; b=VAMaQzR9NyMLVMNuM34J8YcGuem+m9FEqbxBThPr5mGAzku4caGgDsYt57hfwEF4EA Jw6n+NFyVNqaK/99l6d/WA65URTiV3UpfN/4CWGDFZFr9uZQ6URS17Qm3FYlcEAIQaco X6ELet0F9mc3zQXGQBGiIRik6vgDsDmYwn18ZAnHjsj1+rXccUlNqG9NGJEVJaR0cIVv BVcjk9tyGxBp9mnKTlLJKznCohxEUutbAW13x6QZe7LfKV+b5nMjIyZvZpbDWJRNzr2N 1jaUFUItctvlwPDLuxGH8HIoPW4pChUBIx+g7H3FMmensL9GyKVf4kpX/RIfeHz9ZIEj 40yg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=uCf5d+Qt; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-208719-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208719-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6de6e82e7si48161125ad.643.2024.06.10.11.34.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 11:34:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208719-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=uCf5d+Qt; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-208719-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208719-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2FE56B22D52 for ; Mon, 10 Jun 2024 18:12:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1C1CF757E3; Mon, 10 Jun 2024 18:11:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="uCf5d+Qt" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 447D814B978 for ; Mon, 10 Jun 2024 18:11:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718043101; cv=none; b=mHzD1GvBUUStjBsV7rQNAxaGYVlMiLDVws8/I+89KQiUMOaYAY78OkT78aOZ3tsV1NHNhMOYKQlRXa5FA4xR5l9fKmLGvEW0XbSUoCHHlKjU1rRdvltYT2Ku2Z/t44CnKd/mcWv/FbHHCtchIeIGr0IXL/IAFi1Eg1g1dBVKHNo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718043101; c=relaxed/simple; bh=Zyt0Q07VE/fjAXBZsWUk0sLyvaGo1lHLtKHoWXrBxrE=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=oAU0+CYIxBQQZPZeWWA3mB29qRUorNXRtNcZ6RDug/rML0zbEwiVquRIZwkRayW7VcDAEjh9rdAcMBSIt8RvCP8o4TdOKz1+r9xkjgKUn5ohFuaknXxiGQDU8fMd88bzhEkplOIvj9F6bY1jQN7bVeIC0XX1S08oUA2MmFQoo30= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=uCf5d+Qt; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7AE2CC2BBFC; Mon, 10 Jun 2024 18:11:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1718043100; bh=Zyt0Q07VE/fjAXBZsWUk0sLyvaGo1lHLtKHoWXrBxrE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=uCf5d+QtExZpXuCpWZUvOrXZvwBkkat207Tiwy2JRip+dPloyEhnTbJe6JWJELXX3 YqdbM0HeJLKjjNJcPtjrg1x87nWu0+5UqczOTTR1UnC9E19XnYGG4K+ZDOrqftXpyO mO1WkE1UlMwskW68N+85JxIMS1/f1wwblEigZZBU= Date: Mon, 10 Jun 2024 11:11:39 -0700 From: Andrew Morton To: Rafael Aquini Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Heiko Carstens , Petr Mladek , Mike Rapoport , Paul McKenney , Samuel Holland Subject: Re: [PATCH v2] mm: mmap: allow for the maximum number of bits for randomizing mmap_base by default Message-Id: <20240610111139.1e392360ffe847ea48ffebab@linux-foundation.org> In-Reply-To: <20240606180622.102099-1-aquini@redhat.com> References: <20240606170026.101839-1-aquini@redhat.com> <20240606180622.102099-1-aquini@redhat.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 6 Jun 2024 14:06:22 -0400 Rafael Aquini wrote: > An ASLR regression was noticed [1] and tracked down to file-mapped areas > being backed by THP in recent kernels. The 21-bit alignment constraint > for such mappings reduces the entropy for randomizing the placement of > 64-bit library mappings and breaks ASLR completely for 32-bit libraries. > > The reported issue is easily addressed by increasing vm.mmap_rnd_bits > and vm.mmap_rnd_compat_bits. This patch just provides a simple way to > set ARCH_MMAP_RND_BITS and ARCH_MMAP_RND_COMPAT_BITS to their maximum > values allowed by the architecture at build time. > > [1] https://zolutal.github.io/aslrnt/ Are we able to identify a Fixes: target for this? I assume a cc:stable is appropriate?