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=-5.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 32996C34047 for ; Wed, 19 Feb 2020 13:46:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E925324654 for ; Wed, 19 Feb 2020 13:46:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="01zXz8eV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E925324654 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7919F6B0003; Wed, 19 Feb 2020 08:46:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 741F26B0006; Wed, 19 Feb 2020 08:46:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 657966B0007; Wed, 19 Feb 2020 08:46:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0024.hostedemail.com [216.40.44.24]) by kanga.kvack.org (Postfix) with ESMTP id 4A1DE6B0003 for ; Wed, 19 Feb 2020 08:46:09 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 0135F247F for ; Wed, 19 Feb 2020 13:46:09 +0000 (UTC) X-FDA: 76507000458.10.level38_8cf6d73d37362 X-HE-Tag: level38_8cf6d73d37362 X-Filterd-Recvd-Size: 3503 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Wed, 19 Feb 2020 13:46:08 +0000 (UTC) Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6DC3620801; Wed, 19 Feb 2020 13:46:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582119967; bh=VCz4kDLLIpq2JqdJ2+ipuFM04RiXeKKl9ftTf4Uhf9g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=01zXz8eVQgvO3Y0oNpfFarZ6/ghmQR7gOQRql/5wwt7GH8yf2OtsglMlvrB8ByNQm UQ980QXBiWBG+hKPpDzfN5B9OdTVsXX0/2WiKZYaoPMmHDLFQEY02AmHPb6tCeqfyU NY+bFafPiHq6dlwyNqxzWUkQtMPLcX5iK3MQK6cE= Date: Wed, 19 Feb 2020 13:46:03 +0000 From: Will Deacon To: Catalin Marinas Cc: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, Szabolcs Nagy , Linus Torvalds , Andrew Morton , Florian Weimer , Victor Stinner , Andrey Konovalov Subject: Re: [PATCH v2] mm: Avoid creating virtual address aliases in brk()/mmap()/mremap() Message-ID: <20200219134602.GB21366@willie-the-truck> References: <20200219123156.86952-1-catalin.marinas@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200219123156.86952-1-catalin.marinas@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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: On Wed, Feb 19, 2020 at 12:31:56PM +0000, Catalin Marinas wrote: > Currently the arm64 kernel ignores the top address byte passed to brk(), > mmap() and mremap(). When the user is not aware of the 56-bit address > limit or relies on the kernel to return an error, untagging such > pointers has the potential to create address aliases in user-space. > Passing a tagged address to munmap(), madvise() is permitted since the > tagged pointer is expected to be inside an existing mapping. > > The current behaviour breaks the existing glibc malloc() implementation > which relies on brk() with an address beyond 56-bit to be rejected by > the kernel. > > Remove untagging in the above functions by partially reverting commit > ce18d171cb73 ("mm: untag user pointers in mmap/munmap/mremap/brk"). In > addition, update the arm64 tagged-address-abi.rst document accordingly. > > Link: https://bugzilla.redhat.com/1797052 > Fixes: ce18d171cb73 ("mm: untag user pointers in mmap/munmap/mremap/brk") > Cc: # 5.4.x- > Cc: Andrew Morton > Cc: Florian Weimer > Reported-by: Victor Stinner > Acked-by: Will Deacon > Acked-by: Andrey Konovalov > Signed-off-by: Catalin Marinas > --- > > Changes in v2: > > - Added note to tagged-address-abi.rst that this behaviour changed in v5.6 and > some older kernel may still have the old behaviour. > > - Updated the commit log to make it clearer we broke the user ABI, also adding > link to the Red Hat bugzilla entry. Cheers, I'll queue this up as I have a couple of other arm64 fixes pending now. (Andrew, please shout if you'd prefer to take it). Will