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=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED 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 BBA64C28CC5 for ; Sat, 8 Jun 2019 04:01:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 893EE208C0 for ; Sat, 8 Jun 2019 04:01:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NdV7i2ll"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="SIGHIuBb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 893EE208C0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ff5AK155glZ+JgLCAVzBpf2n6bRry5C+5RczlbYsevo=; b=NdV7i2lls9u7Vd 2D+dcDvK7U7HV2AVl9mDTIVGcCOvt30jgmHYbbaa1UT7l181jGe8whlG+kfgBJqvryn+3wzouFuh4 JDwkblfD7p1mIbV98VMiC/qVaYmu90RaxyA/Z4JVTyhjczNkYDxKlsm1KI96zU6XsihOGU21Iyq8z Z1odbMy2C7GFA+hsWjFrTu05HeBgPLyNjERPkvdYyf6ae5F03UU8sptONVlUJk4QZ1vlNfR6KZnT0 OSa5poX1zSVThl4lO1zqTeA0Q3MisMDkT3b09sBNU12ibkPwtnlJpVt9Xtm60o9+XUiJ6nn0F0XAE 91EgQAfe+BOJJ07RiJJQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hZSY6-0005K9-BP; Sat, 08 Jun 2019 04:01:46 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hZSWq-0003oP-SY for linux-arm-kernel@lists.infradead.org; Sat, 08 Jun 2019 04:00:30 +0000 Received: by mail-pl1-x644.google.com with SMTP id go2so1529301plb.9 for ; Fri, 07 Jun 2019 21:00:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=YJBSSsNH8TcUO3Ycp4J72yQtEEm/T/jL9xlaGf6pvZI=; b=SIGHIuBbHjdFD2NYvbt1juZyNlfYo8T13G3oRQwScPFyvz27E5QmOWxjQJHoK99WBn Ze60epVcGs+lOMqYkRKqCgC9UKlerLVaaZ1FhvQY+1i8DraNj5oIlnKwiTKses761SQn gTwBZBGZ3BV+37p5XRC1XuqiURHbiOTUskj5E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=YJBSSsNH8TcUO3Ycp4J72yQtEEm/T/jL9xlaGf6pvZI=; b=MGkyytsTh2nFxyqsCQ8qR7EuIFH2MQTRFFGFf7Vjf4LoyD1OHnQw5gMqG/W0+QwxgC FMDVAgopc0ahCzNcEbag1b3ptoIUys4Usn06capZH8lU7ypzRN4QXHulLRmHtrcYdVNY HH7ecTBKG582k4h/v5Qh/Ncma43ySvMuUi35ATK+E8/l9OK1mWL7OdQcLp39ar6HaquA k4Bv3WgprzTG1lFsKTSfydksBu2LhRXo/87pLRYgpdC8Olxu1AMjtb6+C0K/NYRklbBd 4X59yzyGlqZq0oOkgV/7Re7rI3rj7x0QO2/s0BQWvl0EAaFGlxZ0GJV8HEtaMyHWq5Ux Wqdg== X-Gm-Message-State: APjAAAVBib/xldrZwS94hQ/Y8MDD2bgBI5zEQG3MdutkxR58KyXFXjPn ixp69xVetuXc5cBDqAZUMKaljA== X-Google-Smtp-Source: APXvYqzHeK0TqpcqthfQS0PvnOaTM79D0qX0jOvsUb1vmxMb45KBYDAyFtX8G3vNYgX7ILuQ8oms2A== X-Received: by 2002:a17:902:a516:: with SMTP id s22mr20509311plq.178.1559966427983; Fri, 07 Jun 2019 21:00:27 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id q1sm6873405pfb.156.2019.06.07.21.00.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Jun 2019 21:00:27 -0700 (PDT) Date: Fri, 7 Jun 2019 21:00:26 -0700 From: Kees Cook To: Andrey Konovalov Subject: Re: [PATCH v16 07/16] mm, arm64: untag user pointers in get_vaddr_frames Message-ID: <201906072059.69C8284A0E@keescook> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190607_210029_098132_01107B86 X-CRM114-Status: GOOD ( 16.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , kvm@vger.kernel.org, Szabolcs Nagy , Catalin Marinas , Will Deacon , dri-devel@lists.freedesktop.org, linux-mm@kvack.org, Khalid Aziz , Matthew Wilcox , linux-kselftest@vger.kernel.org, Felix Kuehling , Vincenzo Frascino , Jacob Bramley , Leon Romanovsky , linux-rdma@vger.kernel.org, amd-gfx@lists.freedesktop.org, Christoph Hellwig , Jason Gunthorpe , Dmitry Vyukov , Dave Martin , Evgeniy Stepanov , linux-media@vger.kernel.org, Kevin Brodsky , Ruben Ayrapetyan , Ramana Radhakrishnan , Alex Williamson , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, Kostya Serebryany , Greg Kroah-Hartman , Yishai Hadas , linux-kernel@vger.kernel.org, Jens Wiklander , Lee Smith , Alexander Deucher , Andrew Morton , enh , Robin Murphy , Christian Koenig , Luc Van Oostenryck Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jun 03, 2019 at 06:55:09PM +0200, Andrey Konovalov wrote: > This patch is a part of a series that extends arm64 kernel ABI to allow to > pass tagged user pointers (with the top byte set to something else other > than 0x00) as syscall arguments. > > get_vaddr_frames uses provided user pointers for vma lookups, which can > only by done with untagged pointers. Instead of locating and changing > all callers of this function, perform untagging in it. > > Signed-off-by: Andrey Konovalov Reviewed-by: Kees Cook -Kees > --- > mm/frame_vector.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/mm/frame_vector.c b/mm/frame_vector.c > index c64dca6e27c2..c431ca81dad5 100644 > --- a/mm/frame_vector.c > +++ b/mm/frame_vector.c > @@ -46,6 +46,8 @@ int get_vaddr_frames(unsigned long start, unsigned int nr_frames, > if (WARN_ON_ONCE(nr_frames > vec->nr_allocated)) > nr_frames = vec->nr_allocated; > > + start = untagged_addr(start); > + > down_read(&mm->mmap_sem); > locked = 1; > vma = find_vma_intersection(mm, start, start + 1); > -- > 2.22.0.rc1.311.g5d7573a151-goog > -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel