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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1E5BC4707C for ; Mon, 15 Jan 2024 20:46:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8C0326B0089; Mon, 15 Jan 2024 15:46:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 870566B008A; Mon, 15 Jan 2024 15:46:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7381B6B008C; Mon, 15 Jan 2024 15:46:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 623F46B0089 for ; Mon, 15 Jan 2024 15:46:55 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 379E81201A4 for ; Mon, 15 Jan 2024 20:46:55 +0000 (UTC) X-FDA: 81682729590.01.4E2E2F5 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf03.hostedemail.com (Postfix) with ESMTP id EA7D520014 for ; Mon, 15 Jan 2024 20:46:52 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=cUtApX74; dmarc=none; spf=none (imf03.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1705351613; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=uDdfThpdH9ql6Ca0BuOZZY+u/sUmaV3Rr9Jsf4ip26A=; b=JMJ0rKhCOs6AtzrWHgU2rnxIV10TenGxvWSYrkv2LzXFOQpZ5jaPfigseY+iOYtSt0rmTP bNCteRPOHgCmdTp5qYyg8FRVnCu0KPiEG4tDcG9BIebGrsZ4ICI184pbEnPBF7bf/9Gloy Fpo3LghB4HfArkotGJMJGdiLQfWecRw= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=cUtApX74; dmarc=none; spf=none (imf03.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1705351613; a=rsa-sha256; cv=none; b=RZ/Zxi3lZ0FZnldvH/NueG10dL+yoo98DNBV6AyMzUbXcy9z6s83HA7xrgo/EfRX20e+bh UoiGTzsOQPWlTW9q2cY5EZz913Bo8KS26tAEquT0Q0czoonzgYZnflS3fBLsnJLGk8Og1w FlcG4tdCj4uyVqtMOe3pa7Wkwwhb6mM= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=uDdfThpdH9ql6Ca0BuOZZY+u/sUmaV3Rr9Jsf4ip26A=; b=cUtApX74xV9c/9Py7ccSIy3b6w v3rPhiOAfrVob6jj0FRvnqhtZMX6bb9iriJwUx639vDERxK+q+aGsQj1tBThkPJeaony6AoZmap+V ShBiy7o6C281trzUjCx1lkT5nSipNw/pS2bT0hfftpP0RmcG+JVdHmAme7Q4WC6kvnUo2AynVpGlL 5r3TEZm9VHBaxuv03rKewdbxNNg27g0JKWhYl0KovrOvA/POvVL4c5TaO922raJkDtHajFVMZnGsf I6wieMPMb0HUXvDbA4L6F9TrPEh4P143QIm6MlmllqxbRiaiE1u9adKwUiIfioo+I3KQRppRWayOY jcpBfleA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1rPTqt-00Amll-0k; Mon, 15 Jan 2024 20:46:35 +0000 Date: Mon, 15 Jan 2024 20:46:34 +0000 From: Matthew Wilcox To: mail@horotw.com Cc: linux-hardening@vger.kernel.org, Jakub Wilk , Salvatore Bonaccorso , Linux Memory Management List , William Kucharski Subject: Re: Limited/Broken functionality of ASLR for Libs >= 2MB Message-ID: References: <69fa6015256613ed10aee996e181ebd4@horotw.com> <87il3ur1ik.fsf@gentoo.org> <07c348caaf6b4c457ab4b452f53ed048@horotw.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <07c348caaf6b4c457ab4b452f53ed048@horotw.com> X-Rspamd-Queue-Id: EA7D520014 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: hho9u95r6e4txqyjq9i3bzmzium84zjm X-HE-Tag: 1705351612-115726 X-HE-Meta: U2FsdGVkX19Um+p5QLt6X3y1HwY/o9RFFak6r1JR8cutDM0aiTnqpoDOGRrtgY5Pg+aHU02pG4UqVEMJwGKjuX3iDzMJOyqBreYj3hNQRC1WVbRgX5SZugmw4Of6SIIjKakCZw8gMr5vsqBz2fE73N/X7e4ZTSFWdCDb7PBxvEjKYdSiC1CV/UNnrwpOvT2d5YdTLzheA0FeA+WyE735zz1raytBpvZq0aM6+04Nx2sn1hCN59ye3SFKJmmHs+QrElYYRCdvRcb4j6jKgPDav/o1+Ev/qSPxkTMhO8LpMp33BBDUCO5B2/grQzJE99kYNE+oJpilZRJJjx2AMbY8TDg3FpsDTFaxERuACFc5CkH7ITZgTLYTtwRnUyghTOYhZrh+7nw9E8aB8ne44TqmjqWfPtb+5CpqLs1THP8EX9KvLvmClY/AsA70d3OGkiaqI5TbdrfjVh9VIUsfxOrxObq9UPxOCkaIbqDifOh0evCV80+m3YSJvtZPgAWKg4k7NirsldYXz+rMIq9Ju85a/fbaJxCo/RTLTQSKqyb7fJrvZmDSjdXp6towi2gAFQx31NsIlRjGrfX40pPuR249djsWEwvozJTixabXT8vrNcuXXYwVxEfp+kN/1ex6F29EtfBx/HWyG7E+B/opgrf/ngUnUv2ZlfLTWDHTdDwfmZgPZWVC41dPd8VH7g3ZwcUt3JIn7zwj/xF0c+61/yWi+D2RNMwypNq4UW4mQQZdKKq0uSJA4tM17WPtdWVi+If5R2wWg7CbjG60gleujmFHwQZFukrzTlDxHOyfWxk7MzNPgO145R2gZnwGxboZhKhxYxbX1w2rACdGekxvniJCeUALy9UFgSBTWZTXwwlomr+U2j3g/we93sSHQGApUzNgkILf951FJWVni69VBoT0LBlMSSQ5ftN6QfN80B40BuGQcr0w13MniXbBX1eTM5rSfhK6329gBdOeePNof8v QMO0FxLP 9lK8XqXcDSBJ9z9A0qWFgDYdVlpytLZ7MV5VTQBjKRXvndHmLx9+moREr7BCbDlvRZ1UnyEqIoGOXizR0Qx71eyfgSYVfTL5LntkTpsTscsOa+gZpxvYPNZQWi48rsMcuSPXLUtxlVtxVutYQQ+NUDTlNbBRzWJp7dba5nlU98VMXwfxPwdF+W2QFLqXkAO/Lot/2FDwAFrOJQ4p1/ZukjWTWpzXPvTYYQFClb2shOWaLL+zzZdE40SZcHd+SjYtJeITrHIfYuVlQSXLXHvPF8jp24b94GFd6/ZId3UcNKZukx/FcTVe3qH5Cc4THY4QiPEt30kJZk2GxUYpaCBzFXb9Tw4QqVlWhJk6L7hQF25cGLt4GxYr0AVqMaA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Mon, Jan 15, 2024 at 07:21:19PM +0100, mail@horotw.com wrote: > Am 15.01.2024 17:52, schrieb Matthew Wilcox: > > On Mon, Jan 15, 2024 at 04:40:36PM +0000, Sam James wrote: > > > mail@horotw.com writes: > > > > Hey, I read that ASLR is currently (since kernel >=5.18) broken for > > > > 32bit libs and reduced in effectiveness for 64bit libs... (the issue > > > > only arises if a lib is over 2MB). > > > > I confirmed this for myself but only for the 64bit case. > > > > > > > > I saw that this issue is being tracked by ubuntu > > > > (https://bugs.launchpad.net/ubuntu-kernel-tests/+bug/1983357). > > > > If this is the wrong place and I should instead report it elsewhere I > > > > am very sorry. > > > > > > See also https://bugs.debian.org/1024149. Unfortunately, I don't > > > think the issue found its way upstream until now (thanks). > > > > > > CCing relevant maintainers (per the Debian bug). > > > > You know, my email address is all over that commit and the doofus who > > "discovered the vulnerability" didn't even have the courtesy to let > > me know. I've had several private emails about this over the last few > > days and I just don't care. Who's running 32-bit code and cares about > > security? 32-bit kernels are known-vulnerable to all kinds of security > > problems, and I think this is the least of your worries. > > > > This was intended to happen, it's not a surprise. > > Hi, > first of all I am very sorry, I didn't realize I should have contacted you > first (I'm not the one who found the bug initially), I will do it > differently in the future. I'm not annoyed *at you*. I'm annoyed at the guy who first "discovered" it. I'm annoyed at the people who are running around with their hair on fire. I'm annoyed at all the people who *didn't* contact me. > Unfortunately, my knowledge is not sufficient to judge how bad it is that > 32bit effectively has no ASLR support anymore. > > 64bit is also affected, even though there are probably more than enough > bits left there? I have since seen that both Arch and Ubuntu seem to have > "patches" in place (https://gitlab.archlinux.org/archlinux/packaging/packages/linux/-/commit/3904bcb32cc58c10232fb618bf96c1b43b0bc9d7) > in which they set the `CONFIG_ARCH_MMAP_RND_BITS=32` and > `CONFIG_ARCH_MMAP_RND_COMPAT_BITS=16`, I'm not sure if this is a good > result or if it will cause other problems. Yeah, I don't know either. Outside my scope of expertise. I received a suggestion off-list that we only do the PMD alignment on 64-bit, which seems quite reasonable to me. After all, I don't care about performance on 32-bit just as much as I don't care about security on 32-bit.