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=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=no 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 5C5FBC34056 for ; Wed, 19 Feb 2020 19:40:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 16EF1208E4 for ; Wed, 19 Feb 2020 19:40:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="q/HySXNn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16EF1208E4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BB7406B0006; Wed, 19 Feb 2020 14:40:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B66D26B0007; Wed, 19 Feb 2020 14:40:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA5056B0008; Wed, 19 Feb 2020 14:40:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0120.hostedemail.com [216.40.44.120]) by kanga.kvack.org (Postfix) with ESMTP id 915496B0006 for ; Wed, 19 Feb 2020 14:40:22 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 4F659440B for ; Wed, 19 Feb 2020 19:40:22 +0000 (UTC) X-FDA: 76507893084.08.dust12_204a3eb92ae38 X-HE-Tag: dust12_204a3eb92ae38 X-Filterd-Recvd-Size: 3792 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Wed, 19 Feb 2020 19:40:21 +0000 (UTC) Received: from X1 (nat-ab2241.sltdut.senawave.net [162.218.216.4]) (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 C6FC0206DB; Wed, 19 Feb 2020 19:40:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582141221; bh=zA4WbZt1RU4Jf8KjArYOGBQKdWZtq7HFpafj6fev344=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=q/HySXNn/jrJLMXzHErwVhZqTdTNZUPTK0tc8rZSX/ZeMXkeA4ZbVI0e9BRikOXI1 Myzpv+Lw1xi9iD3LarBq6lxdBpwpVkWRbAosDDyPufiya9lGIOWltkX6+c3eXykv6u kjDPuSHwnES88H2d1ESuJhjpIing1Ib8tUXN9Htc= Date: Wed, 19 Feb 2020 11:40:20 -0800 From: Andrew Morton To: Will Deacon Cc: Catalin Marinas , linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, Szabolcs Nagy , Linus Torvalds , Florian Weimer , Victor Stinner , Andrey Konovalov Subject: Re: [PATCH v2] mm: Avoid creating virtual address aliases in brk()/mmap()/mremap() Message-Id: <20200219114020.0d6c730abce1cdd77e4e5487@linux-foundation.org> In-Reply-To: <20200219134602.GB21366@willie-the-truck> References: <20200219123156.86952-1-catalin.marinas@arm.com> <20200219134602.GB21366@willie-the-truck> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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, 19 Feb 2020 13:46:03 +0000 Will Deacon wrote: > 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). Please go ahead. Reviewed-by: Andrew Morton