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=-9.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 AB370C433DF for ; Fri, 10 Jul 2020 20:01:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6628D2075D for ; Fri, 10 Jul 2020 20:01:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="psuhvaDf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6628D2075D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 16A398D0002; Fri, 10 Jul 2020 16:01:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F2EB8D0001; Fri, 10 Jul 2020 16:01:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EFC6F8D0002; Fri, 10 Jul 2020 16:01:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0198.hostedemail.com [216.40.44.198]) by kanga.kvack.org (Postfix) with ESMTP id D5F1E8D0001 for ; Fri, 10 Jul 2020 16:01:52 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 657688248047 for ; Fri, 10 Jul 2020 20:01:52 +0000 (UTC) X-FDA: 77023236864.04.pull92_4b05d9f26ed1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id 5A1918011E4E for ; Fri, 10 Jul 2020 20:01:44 +0000 (UTC) X-HE-Tag: pull92_4b05d9f26ed1 X-Filterd-Recvd-Size: 3487 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Fri, 10 Jul 2020 20:01:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=gZ14XZU76Moz0JJm/DTbCynhQSKBoFpfiud9XVKdk/0=; b=psuhvaDfJScNec39Soi5BOpt5S Blx+Orwk8ErlcTCSvyahfRbPncIDtWPPHHv4YcfjBNvSRrvJhUPhyKXDOGNAwPnQzXad8jIfANotY zOmi4y0B3bW/igWaJOfDCL58kLNQpk1qYW3jFLaR+uueRxn3onAYSnSHJ+EAAXTffc1ZUf2uw5m6E 7ZcWc9n+lFU75t645LTPojJuSJehnVpjSyCc4x9inIyCruXvd4lbbNh/ReodNvltd3e3bP6O3SMno yXn5b7T/ryTNNq7K7CtEt2cs3ugM1G+k9xFeZCU3HgqZgT+D0ToIHV/R+weU32CN8bmmbNJqCfhly lN5Y+7FQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtzDG-00048T-DR; Fri, 10 Jul 2020 20:01:38 +0000 Date: Fri, 10 Jul 2020 21:01:38 +0100 From: Matthew Wilcox To: Uladzislau Rezki Cc: Andrew Morton , linux-mm@kvack.org, LKML , Hillf Danton , Michal Hocko , Oleksiy Avramchenko , Steven Rostedt Subject: Re: [PATCH 1/1] mm/vmalloc.c: Add an error message if two areas overlap Message-ID: <20200710200138.GQ12769@casper.infradead.org> References: <20200710194042.2510-1-urezki@gmail.com> <20200710194406.GP12769@casper.infradead.org> <20200710200030.GB19487@pc636> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200710200030.GB19487@pc636> X-Rspamd-Queue-Id: 5A1918011E4E X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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 Fri, Jul 10, 2020 at 10:00:30PM +0200, Uladzislau Rezki wrote: > On Fri, Jul 10, 2020 at 08:44:06PM +0100, Matthew Wilcox wrote: > > On Fri, Jul 10, 2020 at 09:40:42PM +0200, Uladzislau Rezki (Sony) wrote: > > > Before triggering a BUG() it would be useful to understand > > > how two areas overlap between each other. Print information > > > about start/end addresses of both VAs and their addresses. > > > > > > For example if both are identical it could mean double free. > > > > > > Signed-off-by: Uladzislau Rezki (Sony) > > > --- > > > mm/vmalloc.c | 10 +++++++++- > > > 1 file changed, 9 insertions(+), 1 deletion(-) > > > > > > diff --git a/mm/vmalloc.c b/mm/vmalloc.c > > > index 5a2b55c8dd9a..1679b01febcd 100644 > > > --- a/mm/vmalloc.c > > > +++ b/mm/vmalloc.c > > > @@ -549,8 +549,13 @@ find_va_links(struct vmap_area *va, > > > else if (va->va_end > tmp_va->va_start && > > > va->va_start >= tmp_va->va_end) > > > link = &(*link)->rb_right; > > > - else > > > + else { > > > + pr_err("Overlaps: 0x%px(0x%lx-0x%lx), 0x%px(0x%lx-0x%lx)\n", > > > + va, va->va_start, va->va_end, tmp_va, > > > + tmp_va->va_start, tmp_va->va_end); > > > > It might be helpful to have a "vmalloc:" prefix to that string to indicate > > where to start searching. And I don't think we're supposed to use %px > > without a really good justification these days. > > > That makes sense, i will add such prefix for sure. As for %px i can just > use a casting to (unsigned long) and 0x%lx prefix. That's not the point. Linus wants us to not display actual pointers to the user.