From patchwork Tue Nov 8 09:43:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= X-Patchwork-Id: 16968 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2598607wru; Tue, 8 Nov 2022 01:50:43 -0800 (PST) X-Google-Smtp-Source: AMsMyM4W83FMXRPK1BivxBarmAudwlMkrFJl0zNsPpnKR/x5C920GOib00VoJ7B2iAMhpktmeKYB X-Received: by 2002:a17:906:328c:b0:780:7574:ced2 with SMTP id 12-20020a170906328c00b007807574ced2mr52252026ejw.634.1667901043174; Tue, 08 Nov 2022 01:50:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667901043; cv=none; d=google.com; s=arc-20160816; b=oa8bIXUA2tqmr5oJkLawCv0+AAb+fazM7MvLbBm/3eXrytipU2S6tycHTcI9xcYUvt EIsGbzc9IxxzP4GiFGudCB6+iaMA4F3UTmYcKD3sOgRPtGSFwDr4/pv4ObUScWfV4fAA P7ua0LA08ioJp6pbrgsprpvfTGtRoK/mbkRmigkjZhoasaR2aW7jrx/vHhnn1hcSBQpe qX/bpcUVhTjbkhb8uTZV3GxiPjh9g6qIK9uEGdYvGxYeVZak1akTje1Z/PmysG9kQprT LOTlpeisYipjP7S4+f3fpqwWXES/UNio0Mx7/R9IfEpFU1/BGEXKXvBuH97GE/8m2rxt wMQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1m/wXqz3m3Z8KOPX0vHt3R2SNBbCLX0ZfbTz9ZhUWoo=; b=tc0lZOhMqfD0tZeKxV2Gt/0YW94rI7kSQ8vbzmno4o/8CxstBO2toWujcpeItz9a0d GEpkGJSzQwS/XBfNKTyHTQJAb2BjbYoAUXIm2q4WwS1BChapO/2v/dgjh/LIfQTCSuJB BDQPMNdBHlEIeXQExnaZzWdAkobDm1vgyr8VfeaDHwkPf5sGVUVKQiE8mkv5DXLMMgeh BVtGKpJ8IxI/wbIc5RdxlEt8c2NGBn7obArBHcfHYsB4SkNDbFyrXLuundmnmRScSX4y bipdAitrVI7kQoTRWNVsGgeO3S36+Z3KKtcQ4eTvZSnkVMvf41ie3NxD90wSVJWSjnbt EBsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=WftMKg6B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g7-20020a170906394700b007815e9c5b80si9793263eje.617.2022.11.08.01.50.19; Tue, 08 Nov 2022 01:50:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=WftMKg6B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233695AbiKHJmq (ORCPT + 99 others); Tue, 8 Nov 2022 04:42:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233487AbiKHJmG (ORCPT ); Tue, 8 Nov 2022 04:42:06 -0500 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2D7432BBE for ; Tue, 8 Nov 2022 01:42:04 -0800 (PST) Received: (Authenticated sender: clement.leger@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id B325160015; Tue, 8 Nov 2022 09:42:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1667900523; h=from:from: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; bh=1m/wXqz3m3Z8KOPX0vHt3R2SNBbCLX0ZfbTz9ZhUWoo=; b=WftMKg6BPP2Xu50Spqn4fVqH8JY5SYueG8mkI4sNRhCrcIymX/IkKiz7Snk79xhcQq3wmX bx0wVbb2MP5kIZ34j20Bkdm1FceSW3SoNSH8qpOkix14H70mWIxPSuO+l51ZeRBBXHWcRm 5ybD9wO7PzvD6dFvUAaj4Itl4BYy2qHs/Q3XmfMCC2QjzU57R7lbIiJ4Xtn1/ADhjHzJA2 ehrefxKU7Hj+LC595rHJzkVdKfYyZEm6KanGmErVIqSWsj2x00ceBakndAHQWGJ0vMqeDy jsRd4ueswMbaPhlj9E60Y91wG2SS5rwlT4pVCmHz9Xz20E4hUT863b+YhkNuYA== From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: Catalin Marinas , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Thomas Petazzoni , Alexandre Belloni , =?utf-8?b?Q2zDqW1lbnQg?= =?utf-8?b?TMOpZ2Vy?= Subject: [PATCH] mm/kmemleak: use %pK to display kernel pointers in backtrace Date: Tue, 8 Nov 2022 10:43:22 +0100 Message-Id: <20221108094322.73492-1-clement.leger@bootlin.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748921004173351742?= X-GMAIL-MSGID: =?utf-8?q?1748921004173351742?= Currently, %p is used to display kernel pointers in backtrace which result in a hashed value that is not usable to correlate the address for debug. Use %pK which will respect the kptr_restrict configuration value and thus allow to extract meaningful information from the backtrace. Signed-off-by: Clément Léger --- mm/kmemleak.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 646e2979641f..b16be8891ae3 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -358,7 +358,7 @@ static void print_unreferenced(struct seq_file *seq, for (i = 0; i < object->trace_len; i++) { void *ptr = (void *)object->trace[i]; - warn_or_seq_printf(seq, " [<%p>] %pS\n", ptr, ptr); + warn_or_seq_printf(seq, " [<%pK>] %pS\n", ptr, ptr); } }