Skip to content

Commit d9d2568

Browse files
marc-hbJonathan Corbet
authored andcommitted
docs: make kptr_restrict and hash_pointers reference each other
vsprintf.c uses a mix of the `kernel.kptr_restrict` sysctl and the `hash_pointers` boot param to control pointer hashing. But that wasn't possible to tell without looking at the source code. They have a different focus and purpose. To avoid wasting the time of users trying to use one instead of the other, simply have them reference each other in the Documentation. Signed-off-by: Marc Herbert <marc.herbert@linux.intel.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260107-doc-hash-ptr-v2-1-cb4c161218d7@linux.intel.com>
1 parent 653793b commit d9d2568

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1969,6 +1969,9 @@ Kernel parameters
19691969
param "no_hash_pointers" is an alias for
19701970
this mode.
19711971

1972+
For controlling hashing dynamically at runtime,
1973+
use the "kernel.kptr_restrict" sysctl instead.
1974+
19721975
hashdist= [KNL,NUMA] Large hashes allocated during boot
19731976
are distributed across NUMA nodes. Defaults on
19741977
for 64-bit NUMA, off otherwise.

Documentation/admin-guide/sysctl/kernel.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,9 @@ if leaking kernel pointer values to unprivileged users is a concern.
591591
When ``kptr_restrict`` is set to 2, kernel pointers printed using
592592
%pK will be replaced with 0s regardless of privileges.
593593

594+
For disabling these security restrictions early at boot time (and once
595+
for all), use the ``hash_pointers`` boot parameter instead.
596+
594597
softlockup_sys_info & hardlockup_sys_info
595598
=========================================
596599
A comma separated list of extra system information to be dumped when

0 commit comments

Comments
 (0)