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 86D96C433EF for ; Sat, 11 Jun 2022 03:46:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E73568D0103; Fri, 10 Jun 2022 23:46:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E22558D00F7; Fri, 10 Jun 2022 23:46:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CEAA18D0103; Fri, 10 Jun 2022 23:46:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id C085F8D00F7 for ; Fri, 10 Jun 2022 23:46:33 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 8FEBC204F9 for ; Sat, 11 Jun 2022 03:46:33 +0000 (UTC) X-FDA: 79564567866.08.E709624 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by imf02.hostedemail.com (Postfix) with ESMTP id 2A64C80083 for ; Sat, 11 Jun 2022 03:46:32 +0000 (UTC) Received: by mail-pj1-f48.google.com with SMTP id cx11so1059749pjb.1 for ; Fri, 10 Jun 2022 20:46:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=4IrN97Z1/unmod/0ZIgRREwNK9Dy4GlFmKlR4IOlB2k=; b=hb4l4z3HG1CVMmqPwl4/D1F8761cs2tTehUNvl/L8uMyrLPJvW7RsrggENAgsab4io Zv5yQK9qdUPwNuP9lVOY/y6TY8a3Oc5qDekpUtenRoFkvrFPoA6UvVws1C3tux1dCimp kOOuIyXvbj0inJNrczRDU//NJz3ohut46sRl6O7ofLIlPIoE71x5lG+Yn7kt055M4sGG V3coDTpJC9jh77FPAguxa2tqFo6LVbh2uJe7xg/aKvo/L4ePRAtsYhHyq4AxEoer/WML 1ISE+Dm6SqmodoZ5bat1m55xhIzPSSrGZkDr+QuXreldboiOkADsv4W9qfm6qSC2EK86 RtKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=4IrN97Z1/unmod/0ZIgRREwNK9Dy4GlFmKlR4IOlB2k=; b=OkIMxpVTf5Srr3d0oVYnLz1Qvx8JMDs7GRjyCA9JgbkSmnnmRaN62MHZsQvjhhC7Rx LDPqR98mlKZUPCtfSI8tyqJ/7vqWjP25ngwjVlTmbwCc4vQYACOI87KoYMCT0h2d3ceu 6CSLxRnwdiGtx1QepFbVBNPUNVNTi5fDM3tCJKAgDRpN7xUUrClwpJqCWjE421tDTuuH af7YDmoRmRbGHBotwCuBINkMHRbOvOKXzeVhohgGMkrIAXz2jFKJOrHG6eTH1fNRSduS gMLX18oeKPbmZ6+peYG2ixxKr/WQMVAvmf7h42WsnV4Oq4adJsndvn0c3HDBC7FXeQnE pvxQ== X-Gm-Message-State: AOAM531GBUGX0D2y2qS7lr2p/GXP7iyVPSVtFjTEbsLDUitckqAwrvCt 5uPSIMQZmWkDbW1pE9dmW54= X-Google-Smtp-Source: ABdhPJz/jDdaLC34L72YARJH+N80C4P6Crbov088Y5N17eQQL78XPGY9rLyVrHfAlIl2f4KrcPbuXg== X-Received: by 2002:a17:90b:3506:b0:1e8:8449:6acb with SMTP id ls6-20020a17090b350600b001e884496acbmr3024124pjb.27.1654919192077; Fri, 10 Jun 2022 20:46:32 -0700 (PDT) Received: from [192.168.1.104] ([101.86.206.203]) by smtp.gmail.com with ESMTPSA id w15-20020a1709026f0f00b001677d4a9654sm463706plk.265.2022.06.10.20.46.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Jun 2022 20:46:31 -0700 (PDT) Message-ID: <957f5626-2c89-f53a-2156-bbde2bb545f2@gmail.com> Date: Sat, 11 Jun 2022 11:46:27 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v3 3/3] mm: kmemleak: check physical address when scan Content-Language: en-US To: Catalin Marinas Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, yee.lee@mediatek.com References: <20220609124950.1694394-1-patrick.wang.shcn@gmail.com> <20220609124950.1694394-4-patrick.wang.shcn@gmail.com> From: Patrick Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1654919193; a=rsa-sha256; cv=none; b=V+3GyewMy55NQUL0417S9DAtlNRPMtX0dUT1xyYfXzxZbpPUw+njTOidAyrdws2Ugk/0om j297ssI1WgnQaGYrxnIksI6lBoNhRa6qhJXGnP+Ar7ZU6K3lafR9AKw365v4ksYte1GgB0 KDKTZM+xr8zXMoG5DnTxSLUU0Wqlnk8= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=hb4l4z3H; spf=pass (imf02.hostedemail.com: domain of patrick.wang.shcn@gmail.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=patrick.wang.shcn@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1654919193; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=4IrN97Z1/unmod/0ZIgRREwNK9Dy4GlFmKlR4IOlB2k=; b=AbxbvALsDnhnFURdopbYDQ1WW/GqDVZWxElP3LTLyIoNGXlNhgS1dBf3jtWKpB/RvP1OO5 Ew93i/TXsJTXx4wDeBfih0Px0r0JELfMHh5nbqUarr/JK48qXq69Ci72HNpgGTcwpTPkOJ OlH5hynbaYZTiynrC0a3TrL0abBpehc= X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 2A64C80083 X-Stat-Signature: 9ue6jinjwuwtwcgj51649hb41rg9yds4 X-Rspam-User: Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=hb4l4z3H; spf=pass (imf02.hostedemail.com: domain of patrick.wang.shcn@gmail.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=patrick.wang.shcn@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1654919192-847695 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 2022/6/10 02:16, Catalin Marinas wrote: > On Thu, Jun 09, 2022 at 08:49:50PM +0800, Patrick Wang wrote: >> Check the physical address of objects for its boundary >> when scan instead of in kmemleak_*_phys(). >> >> Fixes: 23c2d497de21 ("mm: kmemleak: take a full lowmem check in kmemleak_*_phys()") >> Suggested-by: Catalin Marinas >> Signed-off-by: Patrick Wang > > Reviewed-by: Catalin Marinas > > The fixed commit above was cc stable, so we'll probably need all these > three patches in stable. But I'd keep them a bit in -next for testing > first (and I see Andrew already picked them up; we might as well merge > them in 5.20 and send them to -stable after, it's not some critical > feature). > > Thanks for the series. I don't think you need to respin unless others of > comments. I've received an auto build test WARNING from kernel test robot: mm/kmemleak.c: In function 'scan_object': >> arch/powerpc/include/asm/page.h:215:42: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 215 | #define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + VIRT_PHYS_OFFSET)) | ^ mm/kmemleak.c:1403:19: note: in expansion of macro '__va' 1403 | __va((void *)object->pointer) : | ^~~~ So I will replace __va((void *)object->pointer) to __va((phys_addr_t)object->pointer) for fixing this warning, and move the prototype change and the kmemleak_not_leak_phys() removal to a separate one as you suggested at the same time. Thanks for these comments and suggestions. Thanks, Patrick