From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F9862F3A9A; Mon, 5 May 2025 23:14:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746486892; cv=none; b=Crmg/AanZes9XVLXeJnMNlIcod0hhN80/8T4aa9mMXZPmjzGR8aSqe9yEm5I4EFkNWIPSrQG3bTRdEj1DBBDZQ78NHeY2I+pUghTz/GIZVYSMe5begfkGYPp2kORLWoh2fBrMRaUsYnovHS21PDTUzI/CUdTwYD/FsYoF6VDUuA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746486892; c=relaxed/simple; bh=VN5EtMg9ZrHmsH7A10pX7oRSpKuBk9x0NuB/eM47aWc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=ptvpmUpjK1pcVI2TNi4kHNNCO85OHDeqEAoJilZRqz0pFEj6w1z7/mBIPWQgaJV8pqEsvM/IUwtoENt0GHApDNRd9fU7zqTcgDy/yFc3rE+0rc92+BPDeu08hJGWfam98BFRaSc9VJ8VWA9RBa65t14jwP1Z+n892T9u4ceKBOI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XP00LT1g; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XP00LT1g" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9546CC4CEED; Mon, 5 May 2025 23:14:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1746486891; bh=VN5EtMg9ZrHmsH7A10pX7oRSpKuBk9x0NuB/eM47aWc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XP00LT1gnP2TGE4/Foqfv9K+b0DIuPThmCjZ5MJke8bu7Cs8KuIuzD5b51AreWmLT 781E5Tvb039EZHPV6YSgP5T40yDYq1GFrLXjHeQOhGkUtyFKzItDJ/IOpXMxKKrktp 3kmCSLx+A4gaSTSyijRCkoVsET2hCcl+d2u2ooyZSICI6dxDyXJy7mv1MRrz7jvpN6 pFm3CrBmBaDwL/BhzksWgCMKTG7iaypqLIfxm/nZHliabq6/2DSnVfXFWBfCGN6Dfm AY1bpT4eVefbznMN3mRgcPqxiQ3py7QJGjI7cxMcOz/TVM7dJRVBKyFyvkn/oPUgle 6gfeWz0BoQ1Vg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Thomas Gleixner , Sasha Levin , anna-maria@linutronix.de, frederic@kernel.org Subject: [PATCH AUTOSEL 5.15 047/153] timer_list: Don't use %pK through printk() Date: Mon, 5 May 2025 19:11:34 -0400 Message-Id: <20250505231320.2695319-47-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250505231320.2695319-1-sashal@kernel.org> References: <20250505231320.2695319-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.15.181 Content-Transfer-Encoding: 8bit From: Thomas Weißschuh [ Upstream commit a52067c24ccf6ee4c85acffa0f155e9714f9adce ] This reverts commit f590308536db ("timer debug: Hide kernel addresses via %pK in /proc/timer_list") The timer list helper SEQ_printf() uses either the real seq_printf() for procfs output or vprintk() to print to the kernel log, when invoked from SysRq-q. It uses %pK for printing pointers. In the past %pK was prefered over %p as it would not leak raw pointer values into the kernel log. Since commit ad67b74d2469 ("printk: hash addresses printed with %p") the regular %p has been improved to avoid this issue. Furthermore, restricted pointers ("%pK") were never meant to be used through printk(). They can still unintentionally leak raw pointers or acquire sleeping looks in atomic contexts. Switch to the regular pointer formatting which is safer, easier to reason about and sufficient here. Signed-off-by: Thomas Weißschuh Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/lkml/20250113171731-dc10e3c1-da64-4af0-b767-7c7070468023@linutronix.de/ Link: https://lore.kernel.org/all/20250311-restricted-pointers-timer-v1-1-6626b91e54ab@linutronix.de Signed-off-by: Sasha Levin --- kernel/time/timer_list.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c index ed7d6ad694fba..20a5e6962b696 100644 --- a/kernel/time/timer_list.c +++ b/kernel/time/timer_list.c @@ -46,7 +46,7 @@ static void print_timer(struct seq_file *m, struct hrtimer *taddr, struct hrtimer *timer, int idx, u64 now) { - SEQ_printf(m, " #%d: <%pK>, %ps", idx, taddr, timer->function); + SEQ_printf(m, " #%d: <%p>, %ps", idx, taddr, timer->function); SEQ_printf(m, ", S:%02x", timer->state); SEQ_printf(m, "\n"); SEQ_printf(m, " # expires at %Lu-%Lu nsecs [in %Ld to %Ld nsecs]\n", @@ -98,7 +98,7 @@ print_active_timers(struct seq_file *m, struct hrtimer_clock_base *base, static void print_base(struct seq_file *m, struct hrtimer_clock_base *base, u64 now) { - SEQ_printf(m, " .base: %pK\n", base); + SEQ_printf(m, " .base: %p\n", base); SEQ_printf(m, " .index: %d\n", base->index); SEQ_printf(m, " .resolution: %u nsecs\n", hrtimer_resolution); -- 2.39.5