Skip to content

Commit 52966bf

Browse files
jtlaytonkuba-moo
authored andcommitted
ref_tracker: use %p instead of %px in debugfs dentry name
As Kees points out, this is a kernel address leak, and debugging is not a sufficiently good reason to expose the real kernel address. Fixes: 65b584f ("ref_tracker: automatically register a file in debugfs for a ref_tracker_dir") Reported-by: Kees Cook <[email protected]> Closes: https://lore.kernel.org/netdev/202507301603.62E553F93@keescook/ Signed-off-by: Jeff Layton <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 61aaca8 commit 52966bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ref_tracker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ void ref_tracker_dir_debugfs(struct ref_tracker_dir *dir)
434434
if (dentry && !xa_is_err(dentry))
435435
return;
436436

437-
ret = snprintf(name, sizeof(name), "%s@%px", dir->class, dir);
437+
ret = snprintf(name, sizeof(name), "%s@%p", dir->class, dir);
438438
name[sizeof(name) - 1] = '\0';
439439

440440
if (ret < sizeof(name)) {

0 commit comments

Comments
 (0)