Received: by 2002:ac0:a874:0:0:0:0:0 with SMTP id c49csp733163ima; Fri, 15 Mar 2019 12:53:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVha/077iTpALQOZYDnzx+cSwVGLqYUyOsafMUGvQ0n3BZLkXvdM1r7h4s/9aPOQxih6EZ X-Received: by 2002:a65:4806:: with SMTP id h6mr5147165pgs.408.1552679635757; Fri, 15 Mar 2019 12:53:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552679635; cv=none; d=google.com; s=arc-20160816; b=oy28eiOMO0Mb/ns3bQ2XC6b+4iAGKMWy/ovA5D9A0WBFbjk2+FAYuny2mn91ssDv7P N3RQvsMt7Tuiruoj9HGGMz55wt52iz2X7bUJaKF/I9wRJcX1E+GZ/mrjOKbjr++uWuFd ErBMVIe0sN5qvpOqW2piXUvClEJ9rT9f3H++2P7AEqW01LC+s6gsFhzhpPZdlYv/ZVaL icC57MlDCovjYWZ+tNKE6qva/TvCW90GflsCgNAxYrSzSGIvGehlUcblp2Eln1q+y/Xi FUVJBPGM/7BILL9wsIKhHRKwywXJtVE5D80pjJ8ug66Th5LudT/9uWH8r827SxpW4s4/ Achw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=REP9LhKq3azFcE3epBwHjl0z4e4u8qSodB2K6JOUUqY=; b=tVNPswMAAv8771IreEn+GnIvWvd1W2V3eXE6PvyebC+gzwuWCS5tvvV7dda73azcq+ lzbFDu+Lke5LQU/oqRMgeQd7dIz/LE5GDqG0odcte4g1fzxv2V6R6kZHBMhTh10Fe6MM dkjJOETJU2SvZumr7mULTqyWlHgqmjlHOj9xNQ5P821OhHK/PRaSPIPWOiizSheuTBIu Cr85zghJSBeZgkWRfPF7JE31ZWDkaOvXZf8c8j5+UfKqtCy++ThcHwEit6Ak1V+nr6TL IwH3s8H6568uQcN6tfUJs2FVCRP3heJjV5rHPxGxYjp9N/AKPEd7biRBVQsRraxdXvRO thqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=FNIVGISA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t85si2653209pfa.110.2019.03.15.12.53.40; Fri, 15 Mar 2019 12:53:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=FNIVGISA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727529AbfCOTwW (ORCPT + 99 others); Fri, 15 Mar 2019 15:52:22 -0400 Received: from mail-qt1-f202.google.com ([209.85.160.202]:42905 "EHLO mail-qt1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727526AbfCOTwT (ORCPT ); Fri, 15 Mar 2019 15:52:19 -0400 Received: by mail-qt1-f202.google.com with SMTP id n10so2020675qtk.9 for ; Fri, 15 Mar 2019 12:52:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=REP9LhKq3azFcE3epBwHjl0z4e4u8qSodB2K6JOUUqY=; b=FNIVGISAdAEFbreSsDDijAXV7iz7bJ+nqAbnQIHGv5JyzeZ7lcBCJx59d3veVulKlh 7jE3udTRD8ZB4FsTnM9RGbtkCH/mbxzWvFL0H4sXjQx4qi2m5t5ro7oy5rhM45nSVVBP 5ClTpMIvyiu2q1I0rCYKPmV2nRUW01xZpnfJIxUQMHQ44ykxwcrzRx307eckpZorbuN3 6VEq4E+w7Q2yQVpjsHzE5SdEEFgZlQL/gXacFSIer7uFwLUhfH2E6+fmsaTjr28zvsU3 LxduxWE/YJsel6dur8r7Ne5zecAEIXKRCQ6ztsVh51aCO/ECwJBztr37RmWaHcFGyfRo FPEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=REP9LhKq3azFcE3epBwHjl0z4e4u8qSodB2K6JOUUqY=; b=Ku33b58mbsgLLZqwVitzNmewY18yIy8C8WMDkwSh/jg7qZEhrvr7pNt9um2tsM6mYJ u+yt4ZrOjp2PsEY8GgsX0fw1+MzTDJA6dAKkzVPO08rO+yHVoVk2p60EIvbxG5kNw0qD ehvUxv6weA0iYIiVqCU76DlRTK608lJaNjRE7A5Z7kr9Yk6PrfIC7m4epk+R6DaLs5fF VFBGfBbD4Og6zmSA/c2ZgGx+TyYhxi9SHgwSQldlc6UO9JbfGbbhwQTW1qbc/GjUML3d 3ppebQBPFJkj8h6PDI5u8kP2D2XpZ9Xo03FK/RJvW+fnjQhNtVggSsTjJxSHb0CY2wCW hczg== X-Gm-Message-State: APjAAAXf7xXlJfTO1XdZeisRiE24tyCfNZhSewzUvFLuG0ZQyKcA835c xmZ/gtXa85FXziVDmsnRjiN6vxR0R4LLg2od X-Received: by 2002:ac8:2d7c:: with SMTP id o57mr3149114qta.39.1552679538830; Fri, 15 Mar 2019 12:52:18 -0700 (PDT) Date: Fri, 15 Mar 2019 20:51:35 +0100 In-Reply-To: Message-Id: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.21.0.360.g471c308f928-goog Subject: [PATCH v11 11/14] uprobes, arm64: untag user pointers in find_active_uprobe From: Andrey Konovalov To: Catalin Marinas , Will Deacon , Mark Rutland , Robin Murphy , Kees Cook , Kate Stewart , Greg Kroah-Hartman , Andrew Morton , Ingo Molnar , "Kirill A . Shutemov" , Shuah Khan , Vincenzo Frascino , Eric Dumazet , "David S. Miller" , Alexei Starovoitov , Daniel Borkmann , Steven Rostedt , Ingo Molnar , Peter Zijlstra , Arnaldo Carvalho de Melo , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dmitry Vyukov , Kostya Serebryany , Evgeniy Stepanov , Lee Smith , Ramana Radhakrishnan , Jacob Bramley , Ruben Ayrapetyan , Chintan Pandya , Luc Van Oostenryck , Dave Martin , Kevin Brodsky , Szabolcs Nagy , Andrey Konovalov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. find_active_uprobe() uses provided user pointer (obtained via instruction_pointer(regs)) for vma lookups, which can only by done with untagged pointers. Untag the user pointer in this function. Signed-off-by: Andrey Konovalov --- kernel/events/uprobes.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index c5cde87329c7..d3a2716a813a 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -1992,6 +1992,8 @@ static struct uprobe *find_active_uprobe(unsigned long bp_vaddr, int *is_swbp) struct uprobe *uprobe = NULL; struct vm_area_struct *vma; + bp_vaddr = untagged_addr(bp_vaddr); + down_read(&mm->mmap_sem); vma = find_vma(mm, bp_vaddr); if (vma && vma->vm_start <= bp_vaddr) { -- 2.21.0.360.g471c308f928-goog