Received: by 2002:ac0:a874:0:0:0:0:0 with SMTP id c49csp748250ima; Fri, 15 Mar 2019 13:15:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpkoUTaR9Ihz3p901ZM5XZcQ5cus4ndtjx2t1Zqrooif8d33ikjq8cRkUJy8aEflJPtTix X-Received: by 2002:a63:2c4c:: with SMTP id s73mr5283366pgs.113.1552680917075; Fri, 15 Mar 2019 13:15:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552680917; cv=none; d=google.com; s=arc-20160816; b=lK3+FCBe4rDkSyhY3l2xzWV2Jr7Ifg3rEhgYLXn9bVXPsAb3XY6pcJAnfq2TcxiXBw m19VI/Ut6TATKb1uIV8Y/GEfxT9y4Jn30C4B2KWnR3Jq9Z0Pg/D6Am9zXtskX6KzV3Oi M12GLdROqkRGoNPIr7/amv2ViqKw1dUp8P10iiB7ahbNSIfKCT65L39SZ/cXdT+O3vx0 eiHKImY5tqw6z/VZypYbsXHEMgJHy9lDiy5YhG5DOgHiwtfFAqJYoo2QOwT+fcij7ctg FFlqBl94hvxUldMUSB3r2EAeH2t2lxg2JzRiXG9qnGLAKXGwK29toJ859vFavYquzAPy KQxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=gGMx3B7Iz27z3iGL7B+okEFSLxvTVbfS91a/K9thdOI=; b=Zrj+lsFCa1e3k2zcfqR65uRzO2TRH5JQBDFiQHLptkFCs6eSTEAByNQOTEpJWQxRkG Gf+O+TmuojmF1R5bIWXcItkz6vvZkEQcTmjp/JEs+jW0NhIuMDV9rX7L2lMIRpi15dKH wNzr6Hocy5eFkuzR1s/BXix3C2iVxnfnMCIks6bRlKah1FeEDap1HdWsF8Pc2qIT6gOU qQF9o9c0tK9Os7JoDQM6d4VQfq16y5gA4WkBKZQYlf+ZSfZZ7NHqI+3fhoiNHpujD0fX XSMcIaLhwxrxyiD21QY7SkaCpOd4vbrbW5+D7WqFEcmrhsROUldwEhzzJwdjLVWRhjqs Q0Xw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w65si115525pfb.86.2019.03.15.13.15.00; Fri, 15 Mar 2019 13:15:17 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726773AbfCOUOV (ORCPT + 99 others); Fri, 15 Mar 2019 16:14:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:46102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726303AbfCOUOU (ORCPT ); Fri, 15 Mar 2019 16:14:20 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 BC34021871; Fri, 15 Mar 2019 20:14:15 +0000 (UTC) Date: Fri, 15 Mar 2019 16:14:14 -0400 From: Steven Rostedt To: Andrey Konovalov Cc: 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 , 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, 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 Subject: Re: [PATCH v11 10/14] tracing, arm64: untag user pointers in seq_print_user_ip Message-ID: <20190315161414.4b31fb03@gandalf.local.home> In-Reply-To: <355e7c0dadaa2bb79d22e0b7aac7e4efc1114d49.1552679409.git.andreyknvl@google.com> References: <355e7c0dadaa2bb79d22e0b7aac7e4efc1114d49.1552679409.git.andreyknvl@google.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 15 Mar 2019 20:51:34 +0100 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. > > seq_print_user_ip() uses provided user pointers for vma lookups, which > can only by done with untagged pointers. > > Untag user pointers in this function. > > Signed-off-by: Andrey Konovalov > --- > kernel/trace/trace_output.c | 5 +++-- > p | 45 +++++++++++++++++++++++++++++++++++++ > 2 files changed, 48 insertions(+), 2 deletions(-) > create mode 100644 p > > diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c > index 54373d93e251..6376bee93c84 100644 > --- a/kernel/trace/trace_output.c > +++ b/kernel/trace/trace_output.c > @@ -370,6 +370,7 @@ static int seq_print_user_ip(struct trace_seq *s, struct mm_struct *mm, > { > struct file *file = NULL; > unsigned long vmstart = 0; > + unsigned long untagged_ip = untagged_addr(ip); > int ret = 1; > > if (s->full) > @@ -379,7 +380,7 @@ static int seq_print_user_ip(struct trace_seq *s, struct mm_struct *mm, > const struct vm_area_struct *vma; > > down_read(&mm->mmap_sem); > - vma = find_vma(mm, ip); > + vma = find_vma(mm, untagged_ip); > if (vma) { > file = vma->vm_file; > vmstart = vma->vm_start; > @@ -388,7 +389,7 @@ static int seq_print_user_ip(struct trace_seq *s, struct mm_struct *mm, > ret = trace_seq_path(s, &file->f_path); > if (ret) > trace_seq_printf(s, "[+0x%lx]", > - ip - vmstart); > + untagged_ip - vmstart); > } > up_read(&mm->mmap_sem); > } > diff --git a/p b/p > new file mode 100644 > index 000000000000..9d6fa5386e55 > --- /dev/null > +++ b/p > @@ -0,0 +1,45 @@ > +commit 1fa6fadf644859e8a6a8ecce258444b49be8c7ee > +Author: Andrey Konovalov > +Date: Mon Mar 4 17:20:32 2019 +0100 > + > + kasan: fix coccinelle warnings in kasan_p*_table > + > + kasan_p4d_table, kasan_pmd_table and kasan_pud_table are declared as > + returning bool, but return 0 instead of false, which produces a coccinelle > + warning. Fix it. > + > + Fixes: 0207df4fa1a8 ("kernel/memremap, kasan: make ZONE_DEVICE with work with KASAN") > + Reported-by: kbuild test robot > + Signed-off-by: Andrey Konovalov Did you mean to append this commit to this patch? -- Steve > + > +diff --git a/mm/kasan/init.c b/mm/kasan/init.c > +index 45a1b5e38e1e..fcaa1ca03175 100644 > +--- a/mm/kasan/init.c > ++++ b/mm/kasan/init.c > +@@ -42,7 +42,7 @@ static inline bool kasan_p4d_table(pgd_t pgd) > + #else > + static inline bool kasan_p4d_table(pgd_t pgd) > + { > +- return 0; > ++ return false; > + } > + #endif > + #if CONFIG_PGTABLE_LEVELS > 3 > +@@ -54,7 +54,7 @@ static inline bool kasan_pud_table(p4d_t p4d) > + #else > + static inline bool kasan_pud_table(p4d_t p4d) > + { > +- return 0; > ++ return false; > + } > + #endif > + #if CONFIG_PGTABLE_LEVELS > 2 > +@@ -66,7 +66,7 @@ static inline bool kasan_pmd_table(pud_t pud) > + #else > + static inline bool kasan_pmd_table(pud_t pud) > + { > +- return 0; > ++ return false; > + } > + #endif > + pte_t kasan_early_shadow_pte[PTRS_PER_PTE] __page_aligned_bss;