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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9ADFBC433F5 for ; Wed, 16 Feb 2022 23:26:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BECFD6B0078; Wed, 16 Feb 2022 18:26:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B9C1A6B007B; Wed, 16 Feb 2022 18:26:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A18B66B007D; Wed, 16 Feb 2022 18:26:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0145.hostedemail.com [216.40.44.145]) by kanga.kvack.org (Postfix) with ESMTP id 912EE6B0078 for ; Wed, 16 Feb 2022 18:26:35 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 3D34E181AC9C6 for ; Wed, 16 Feb 2022 23:26:35 +0000 (UTC) X-FDA: 79150229550.15.262B143 Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) by imf19.hostedemail.com (Postfix) with ESMTP id B8B161A0005 for ; Wed, 16 Feb 2022 23:26:34 +0000 (UTC) Received: by mail-yb1-f177.google.com with SMTP id p5so9330733ybd.13 for ; Wed, 16 Feb 2022 15:26:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yl++UbQHvu031O88qjaOvVPH96zPax6XyUywms3AfE8=; b=du1dfzkCVyYJKstpFmIAxK2VNbKxzZZ6BqvK/vaUaaHusJhtDgI8Zx2SL2BK83cgC0 yjx7jgQd+h2bjjVfymSN82w/XWqXpRoMuoaQyPKCRg5Ig5iW6S6yy/+/mNRLIvex4SnI 2mrF33ukku/kGa51F8cAwgK/AE9FUo0IjGDPucJWRd8WnTg1g+0verMaJSCRb0T953UF Da31rWgY2Pqx/0IPX3Yxlrz4zMDvsyUxHyZnBFPT5w/gYZJMmG0UcnvWxAn55S/GISKq yf/+sau0mzPk2xw1Mk2yEyxC5GtlGCTV+bj8rBFxae37maEgxLhVfh2RZYGXkYu0OzUB Ek4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yl++UbQHvu031O88qjaOvVPH96zPax6XyUywms3AfE8=; b=B2ic9KtGT/GmF4vSDGF7zAK9CgMaqn04gfrqeDImUnwGW4Z1QwoW2DGgzS1id5zu0B Nm/IcwC5r6ByjBZCXcpltqbZ5PKcSLHvi9we1wQ42yjhkQymAzDL01J/fongmgtm9qgH 9N5JKGO7J6UICvj7S3Hh4gmcuCcvMPKWDWfYBUSHkIrgbESLRkNlxC7tBwMaJdQRBA2q /XS46Nu37LjQyD58nShwdr61c7P4++BLuq1Vbc0TZL0SonyJh0+7UlZRovw2CrUSKtf1 Pmmwr5UXCiB9i1JR3R5UiDRvPqGUcBZnI6+L719ecp9niK8wJk6IJq6iBocHfk4FFhaK Z+qA== X-Gm-Message-State: AOAM530VAgyLDkpcxHncaeo1niJlCLYsvOoGBlmMff+U0xei+bYh2FCx NeL8Mkl6fpQJOB+UMdNIQa5BiwlHa8PqryFTVG9V7A== X-Google-Smtp-Source: ABdhPJwjoTHWombbeiuCgd+bm9lJ6I8IV5xERt6WrfekPcH+1L/91PJDXxGq1mQj3Rwwc+WX88bk3+QQzDWQ+x8mhKg= X-Received: by 2002:a25:28a:0:b0:620:e848:af9b with SMTP id 132-20020a25028a000000b00620e848af9bmr218531ybc.374.1645053993763; Wed, 16 Feb 2022 15:26:33 -0800 (PST) MIME-Version: 1.0 References: <5b120f7cadcc0e0d8d5f41fd0cff35981b3f7f3a.1645038022.git.andreyknvl@google.com> In-Reply-To: From: Marco Elver Date: Thu, 17 Feb 2022 00:26:22 +0100 Message-ID: Subject: Re: [PATCH mm] kasan: print virtual mapping info in reports To: Andrey Konovalov Cc: andrey.konovalov@linux.dev, Alexander Potapenko , Andrew Morton , Dmitry Vyukov , Andrey Ryabinin , kasan-dev , Vincenzo Frascino , Catalin Marinas , Linux Memory Management List , LKML , Andrey Konovalov Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=du1dfzkC; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf19.hostedemail.com: domain of elver@google.com designates 209.85.219.177 as permitted sender) smtp.mailfrom=elver@google.com X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: B8B161A0005 X-Stat-Signature: ho7ei44sfbyshzpt3nqfd9cqmoeeruuc X-HE-Tag: 1645053994-565513 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, 16 Feb 2022 at 21:42, Andrey Konovalov wrote: > > On Wed, Feb 16, 2022 at 8:31 PM Marco Elver wrote: > > > > On Wed, 16 Feb 2022 at 20:01, wrote: > > > > > > From: Andrey Konovalov > > > > > > Print virtual mapping range and its creator in reports affecting virtual > > > mappings. > > > > > > Also get physical page pointer for such mappings, so page information > > > gets printed as well. > > > > > > Signed-off-by: Andrey Konovalov > > > > > > --- > > > > > > Note: no need to merge this patch into any of the KASAN vmalloc patches > > > that are already in mm, better to keep it separate. > > > --- > > > mm/kasan/report.c | 12 +++++++++++- > > > 1 file changed, 11 insertions(+), 1 deletion(-) > > > > > > diff --git a/mm/kasan/report.c b/mm/kasan/report.c > > > index 137c2c0b09db..8002fb3c417d 100644 > > > --- a/mm/kasan/report.c > > > +++ b/mm/kasan/report.c > > > @@ -260,8 +260,18 @@ static void print_address_description(void *addr, u8 tag) > > > pr_err(" %pS\n", addr); > > > } > > > > > > + if (is_vmalloc_addr(addr)) { > > > + struct vm_struct *va = find_vm_area(addr); > > > + > > > + pr_err("The buggy address belongs to the virtual mapping at\n" > > > + " [%px, %px) created by:\n" > > > + " %pS\n", va->addr, va->addr + va->size, va->caller); > > > > Can you show an example of what this looks like? > > [ 20.883723] The buggy address belongs to the virtual mapping at > [ 20.883723] [ffff8000081c9000, ffff8000081cb000) created by: > [ 20.883723] vmalloc_oob+0xd8/0x4dc > > > It's not showing a stack trace, > > No, only a single frame. > > > so why not continue the line and just say "... created by: %pS\n" > > Putting it on a separate line makes the line lengths looks more balanced. > > Also, printing a frame on a separate line is consistent with the rest > of KASAN reporting code. That's reasonable, thanks. Reviewed-by: Marco Elver