Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp617762img; Mon, 18 Mar 2019 10:21:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxFNPneVurZgMid6XNUrrMGeiKQwsjf4e5mMKhE4weiU57qkkphlpQTXJY9b1v6v6qXF9D X-Received: by 2002:a17:902:45a5:: with SMTP id n34mr21186051pld.127.1552929674613; Mon, 18 Mar 2019 10:21:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552929674; cv=none; d=google.com; s=arc-20160816; b=NJhqmG00p+t5l1QpcFjjJpU12SFEOsAHPJ6iBHJnJPh4IP9AmbAMeuKE/alNXNLZVC bhFGukakxobL+dfPV5xUCaA3fjvKgXlWimO0oyqyhv6qZpCBHCwymXwpTDl4xK24xJKX PQfLs+7mVYFJTdIXwCynFnGvMR7OmNGPIc+HVlZR08HLGFn8HemL/gXB2ZQ+QI/jf1LY N1l2wpIv68mRB5e0S3knjztuYlpFh1QpZtFyxJ4MPFIZQ4LQYSPvgQeAVzRdA4gSdCF/ xGavvRAkwPx8ICIo4YyrbZQ98Xws1gjGL3weV9s/ifLaECTXhEdsgfzLVlpViX1o3RLX xCjg== 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=y0pmDLbK+7BSAh5x56WEIsXOyLAwrKLQOAsadcipF54=; b=SZnoOb7qILp9PSExA3WHH6nNnCcLamupsBM2bATdJlu2UHsRi5SnE/0MoHwluus3t3 iUH9ItkspPZfD7tnIVKd6N69b7T04h36YJbKSKjJh/Q9ED1WahqsoXR2lNj7BFCo3BJi L8bOmuwpfSErArSBm6IPeWlUi3UvegkfIuQZ7Q7rQMUGe20sY8wbVVdLIrJDD7lrLVu+ mze5m8SWLGa+XgDWIe+7XzFQncirUJuRqO8EUIFkQDHOGwkXM5BW05Le1hObE8i1MLNI pjPuL8rrHNHFw+ZIrCdmlKSJsq+Asb2ODtxlTaDkyuKUX8YCSe/SlpGMuQgYb5q3keih J2mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=n6mK8qGB; 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 o6si8902969pgk.470.2019.03.18.10.20.59; Mon, 18 Mar 2019 10:21:14 -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=n6mK8qGB; 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 S1728025AbfCRRS0 (ORCPT + 99 others); Mon, 18 Mar 2019 13:18:26 -0400 Received: from mail-qt1-f201.google.com ([209.85.160.201]:39668 "EHLO mail-qt1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728009AbfCRRSX (ORCPT ); Mon, 18 Mar 2019 13:18:23 -0400 Received: by mail-qt1-f201.google.com with SMTP id n13so3248320qtn.6 for ; Mon, 18 Mar 2019 10:18:23 -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=y0pmDLbK+7BSAh5x56WEIsXOyLAwrKLQOAsadcipF54=; b=n6mK8qGBi8yC21LmjABra3FF+XTvfgLYZr9bPF1sHZ9sen0usXtJo9r8UWpIWYoDEs YEss5ttEDAL6lIbgFyj4X628k4cUup4CCMJ0VLQ4ftrPTG+rRMptHjumdErdUDl9ISYY rB+TuyC09kttxpZuExC8/+TH8Y8tVKRukuxPYVczcjDCqo+QtLbM9TmxH0fH4rTQxur3 7pLUDwD0Z21jyoNe+FO+hi4d+W5N8IZjBamLALgbuY36eoX0Noj2JHkXsAIpP352R88b ntHc4rkT8wXoHbCbhE2dgY+nunbgZmc/Jf/sc4zQqGibHR6/JS9I5KqLldKTT6WFAxiu sHnA== 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=y0pmDLbK+7BSAh5x56WEIsXOyLAwrKLQOAsadcipF54=; b=fBOAjZ25n1/NOSgxm3aD+EVtaXsgy6djADx/Vq5gAilpOo5ptSr1cPLurdNzCPCLYV iuWCd8xSJpyG2vJw4hshue/tHlvDdol4iJoeihfQzEILyQJhzAgZC3Jgvp8N2tGFh3jr UxqdIt7lFUPW0SKFJAhO0VDXCE753uilE50rJFRSEWO0fMVBP1qp8vauD7FIHcltPw0O 1duAZpAzYqC5iChbp/qIyU8F9592S6U3JciubmYxmg1gCN+un9GDwW4ASsMOM409GmET 48jornIbC7YD9RBaVRdzi9V4iok+ngScAQS0yJOHx1T8wbulmI7M5jBsumlie1/HhnuM k2cQ== X-Gm-Message-State: APjAAAVx3BSK0NBi+alnwyJ4rmDAX+Pm5MNjdTVLmo4rT6ditofaFLzk cL9/Lzy18PzflI2Ple6THcS5lO22YhTBpX2p X-Received: by 2002:ac8:2e7a:: with SMTP id s55mr10982902qta.34.1552929502878; Mon, 18 Mar 2019 10:18:22 -0700 (PDT) Date: Mon, 18 Mar 2019 18:17:43 +0100 In-Reply-To: Message-Id: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.21.0.225.g810b269d1ac-goog Subject: [PATCH v12 11/13] 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.225.g810b269d1ac-goog