You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several places where we use zfs_dbgmsg and %p to print pointers (see metaslab.c:2371:metaslab_condense() or zio.c:1887:zio_deadman_impl()). In the Linux kernel, these values "are hashed to give a unique identifier without leaking kernel addresses to user
space. On 64 bit machines the first 32 bits are zeroed." (https://www.kernel.org/doc/Documentation/printk-formats.txt)
This means the pointers aren't very useful for debugging crash dumps since you can't find the location of the struct they refer to.
It is possible to print the actual pointers using %pK ("For printing kernel pointers which should be hidden from unprivileged users") or %px ("For printing pointers when you really want to print the address").
Note that on Linux, /proc/spl/kstat/zfs/dbgmsg is world-readable (on Illumos it's root only).
Would restricting the permissions for /proc/spl/kstat/zfs/dbgmsg and then printing the actual pointers be an appealing option for people?
And if we don't want to print the actual pointers is there any benefit to continue printing the scrambled version of them?
Describe how to reproduce the problem
You can see this in the metaslab.c:2371:metaslab_condense() entries in zfsdbg_msg.
The text was updated successfully, but these errors were encountered:
Would restricting the permissions for /proc/spl/kstat/zfs/dbgmsg and then printing the actual pointers be an appealing option for people?
Yes that makes sense, I definitely think we should start by updating /proc/spl/kstat/zfs/dbgmsg to only be accessible by root. At which point I think it would be reasonable to start printing the real pointers.
System information
Problem
There are several places where we use
zfs_dbgmsg
and%p
to print pointers (seemetaslab.c:2371:metaslab_condense()
orzio.c:1887:zio_deadman_impl()
). In the Linux kernel, these values "are hashed to give a unique identifier without leaking kernel addresses to userspace. On 64 bit machines the first 32 bits are zeroed." (https://www.kernel.org/doc/Documentation/printk-formats.txt)
This means the pointers aren't very useful for debugging crash dumps since you can't find the location of the
struct
they refer to.It is possible to print the actual pointers using
%pK
("For printing kernel pointers which should be hidden from unprivileged users") or%px
("For printing pointers when you really want to print the address").Note that on Linux,
/proc/spl/kstat/zfs/dbgmsg
is world-readable (on Illumos it's root only).Would restricting the permissions for
/proc/spl/kstat/zfs/dbgmsg
and then printing the actual pointers be an appealing option for people?And if we don't want to print the actual pointers is there any benefit to continue printing the scrambled version of them?
Describe how to reproduce the problem
You can see this in the
metaslab.c:2371:metaslab_condense()
entries inzfsdbg_msg
.The text was updated successfully, but these errors were encountered: