Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1225015rbb; Mon, 26 Feb 2024 02:51:25 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUiAOUo7IJCMwurKOKVmam31LpTuniYLiayx/AZAADPjROkxPIyTp6FASu2fYlp8gxEUkoHhq8o7+DEpt+6emIhuNcgKfSBmnoIYu5Hgg== X-Google-Smtp-Source: AGHT+IGEqb8UgCh/tWN33XdaZ3UkYli6VW869pUT7hn+br00BWoLVSugcsAWz6MMOql7zjQuc69m X-Received: by 2002:a05:6a20:c888:b0:19e:cbe9:63b with SMTP id hb8-20020a056a20c88800b0019ecbe9063bmr7623025pzb.3.1708944685293; Mon, 26 Feb 2024 02:51:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708944685; cv=pass; d=google.com; s=arc-20160816; b=mYUUZDUgqKVSFWwPXhFwQ/WzJLpkN3GntMen8jfraWF3sUmlfQfXa/JcjMN1SxhnEp 3UzsdrjKFdIoEpC2xerESz/BWdaoXAqDlRrZBe53RaZreKfZgZZht2f7gO8sklvgAtZ1 jRrWIsI/Il35Rm45QOrmUWfce4MqIzBATaRh6TEqrwIM7je4VJDGex91pFofwU0o2P/4 xoTLJVRVRajEF5TvP61gcc+HFkrnwcEn/qiAhTzVNoasouo/VqPd1ano14r7vTI1JeVH adcP+3QwilLWRVlLH4mvQPwCwC84W0Ag4lsW7qr2sabZTdMoD+VGjn31ZF94d1lb4bHU Sujw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:references:message-id:in-reply-to:subject:cc:to:from :date:dkim-signature; bh=enAnnPs6vMcqMh2X6nIOdI0rWuPKZvZyHGCVSGS0Erc=; fh=bqPY33+ImdUyICFs/l7Afu+2h7qHnZ3YaO5AKxoVhQg=; b=ekfLA9rRTaif+RKxK6cPG2fHG/lRXlJx3MTKIlEt0xo0tXsRkmrawWrv/OgvFm70M8 q8f3i1IRYDz9HaYAKtTlL4DmCGLOwkowQXK7o+Qh2VJ7EFO6MQc8cEur7STIFyw3+QFP XOc6ttKa062Pn8scSIK8YzxfC1jYIcnPnDbd5qaOakfYmtsV7442xahu/AMTxrI1xN6y 2GqTlFtg8quUC4MeNUfhWR7AQtEUhV3AWtgZuBJgnVCadzUXVgh0G9fDy1n4dB1so1cn sQl3yaP9m27Oi9a2HPZdXUb5Vaewki24R/5UbdNCOxdEPYTy1KtfomAZn7QBDrcsAeJ8 6jWw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WfutgURm; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-81176-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81176-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id p2-20020a056a000b4200b006e13cdd21b5si3583086pfo.207.2024.02.26.02.51.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 02:51:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81176-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WfutgURm; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-81176-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81176-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 55300293C5F for ; Mon, 26 Feb 2024 10:44:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CCD152D056; Mon, 26 Feb 2024 10:39:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WfutgURm" 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 D759A1CD2B; Mon, 26 Feb 2024 10:39:34 +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=1708943975; cv=none; b=RHWKNao42Eex6DNqYe/MxZZQ9DRLIboxXwomMlt4UT42M6HiEalI71922XBQNCFDEunA9VB407tWeKZiJPPrFusP1F3QUR9TmO+x7Uyct6/U3PyGdy+5ggU3OBxOGw579jIMLtf7KEbv2MfgZk3PprP6bEIIXL0UgWMRMGaCVB8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708943975; c=relaxed/simple; bh=ymjcFen8c3Su6bcKnRhsOkKT7wLiavklUN50no/AaHQ=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=KPZOGPSybuNR9XQ68t/q6tA/xJexzc+0ma4dcJNSTh8sWSMmj8jz1ElP1EgnIsX9DguwOZRCa8T15FdNSHyXR15tHW6AmKwlBDDuYDqIv43dQnPwQFU8ZYsod/SIbVUcsiD8bMdiGES6kqroGJ+GSNIDOlM4ml/3a83G+EDAjuQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WfutgURm; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8C3DC433C7; Mon, 26 Feb 2024 10:39:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708943974; bh=ymjcFen8c3Su6bcKnRhsOkKT7wLiavklUN50no/AaHQ=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=WfutgURm5TLAIvDzJD7MQrGOiOzovl+SSrWQDpL4BQZXqKXSlQ2C9l6cELAoAMBEq vdMEAelQUFi/VxzMO6RrmQAmEQK39mArk2ZgicrtiN7neDkvZI8bBAbAiOiXh9rn5v YRvqot7ee5G9BMdNI//SqP2QdML0e7tUw6dL1dQ2UbtHd4V0JqbCAca/IoBvMG3E7A q4l+a4VZS9iqKGPq5Hox7Ql+vxXdi8fiT6iUksgDB77c1408r/w2On0Q6QUCktvl6P umNGMDfpge25hvRiJ/pqUHobDyJpqvIhSyUKPC9rdtULwBYLJTcd/68H75Kv1+g69e mKgW5FtuQO6mw== Date: Mon, 26 Feb 2024 11:39:35 +0100 (CET) From: Jiri Kosina To: Kees Cook cc: y0un9n132@gmail.com, Geert Uytterhoeven , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Peter Zijlstra , Qi Zheng , Alexandre Ghiti , x86@kernel.org, Al Viro , Christian Brauner , Jan Kara , Eric Biederman , Christophe Leroy , Josh Poimboeuf , "Kirill A. Shutemov" , Rick Edgecombe , Brian Gerst , Bjorn Helgaas , Tony Battersby , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH 1/2] x86: Increase brk randomness entropy on x86_64 In-Reply-To: <20240217062545.1631668-1-keescook@chromium.org> Message-ID: References: <20240217062035.work.493-kees@kernel.org> <20240217062545.1631668-1-keescook@chromium.org> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) 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 On Fri, 16 Feb 2024, Kees Cook wrote: > In commit c1d171a00294 ("x86: randomize brk"), arch_randomize_brk() was > defined to use a 32MB range (13 bits of entropy), but was never increased > when moving to 64-bit. The default arch_randomize_brk() uses 32MB for > 32-bit tasks, and 1GB (18 bits of entropy) for 64-bit tasks. Update > x86_64 to match the entropy used by arm64 and other 64-bit architectures. > > Reported-by: y0un9n132@gmail.com > Closes: https://lore.kernel.org/linux-hardening/CA+2EKTVLvc8hDZc+2Yhwmus=dzOUG5E4gV7ayCbu0MPJTZzWkw@mail.gmail.com/ > Signed-off-by: Kees Cook Wow, this is a pretty aged code indeed. Acked-by: Jiri Kosina Thanks, -- Jiri Kosina SUSE Labs