diff options
| author | Jeff Layton <[email protected]> | 2025-06-18 14:24:14 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2025-06-20 00:02:03 +0000 |
| commit | 7d02ba96635d184dfc292ecc7308ced1fceaba8d (patch) | |
| tree | 5fd862a3cf0a6bb05e0a15b3fdad9f8dec0c83a6 /lib/ref_tracker.c | |
| parent | Linux 6.16-rc2 (diff) | |
| download | kernel-7d02ba96635d184dfc292ecc7308ced1fceaba8d.tar.gz kernel-7d02ba96635d184dfc292ecc7308ced1fceaba8d.zip | |
ref_tracker: don't use %pK in pr_ostream() output
As Thomas Weißschuh points out [1], it is now preferable to use %p
instead of hashed pointers with printk(), since raw pointers should no
longer be leaked into the kernel log. Change the ref_tracker
infrastructure to use %p instead of %pK in its formats.
[1]: https://lore.kernel.org/netdev/[email protected]/
Reviewed-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Krzysztof Karas <[email protected]>
Signed-off-by: Jeff Layton <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'lib/ref_tracker.c')
| -rw-r--r-- | lib/ref_tracker.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ref_tracker.c b/lib/ref_tracker.c index cf5609b1ca79..de71439e12a3 100644 --- a/lib/ref_tracker.c +++ b/lib/ref_tracker.c @@ -96,7 +96,7 @@ __ref_tracker_dir_pr_ostream(struct ref_tracker_dir *dir, stats = ref_tracker_get_stats(dir, display_limit); if (IS_ERR(stats)) { - pr_ostream(s, "%s@%pK: couldn't get stats, error %pe\n", + pr_ostream(s, "%s@%p: couldn't get stats, error %pe\n", dir->name, dir, stats); return; } @@ -107,13 +107,13 @@ __ref_tracker_dir_pr_ostream(struct ref_tracker_dir *dir, stack = stats->stacks[i].stack_handle; if (sbuf && !stack_depot_snprint(stack, sbuf, STACK_BUF_SIZE, 4)) sbuf[0] = 0; - pr_ostream(s, "%s@%pK has %d/%d users at\n%s\n", dir->name, dir, + pr_ostream(s, "%s@%p has %d/%d users at\n%s\n", dir->name, dir, stats->stacks[i].count, stats->total, sbuf); skipped -= stats->stacks[i].count; } if (skipped) - pr_ostream(s, "%s@%pK skipped reports about %d/%d users.\n", + pr_ostream(s, "%s@%p skipped reports about %d/%d users.\n", dir->name, dir, skipped, stats->total); kfree(sbuf); |
