[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian 12 - Messaggi dmesg



Il 24/07/23 11:47, Alessandro Rubini ha scritto:
[    0.208536] ** This system shows unhashed kernel memory addresses   **

Vuol dire che i messaggi del kernel mostrano gli indirizzi interni
invece di una "hash" degli stessi (ma solo se il driver usa "%p" per
stampare il puntatore, invece che le normali stringhe testuali.
Per esempio in caso di oops o panic.

[    0.208536] ** via the console, logs, and other interfaces. This    **

Appunto, i messaggi.

Questo quadratozzo di NOTICE sta in lib/vsprintf.c nei sorgenti del kernel,
da cui vedo che dipende dal parametro "no_hash_pointers".
Buongiorno Lista,
Qua ho trovato questo:
https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html?highlight=boot%20parameter
 no_hash_pointers
Force pointers printed to the console or buffers to be unhashed. By default, when a pointer is printed via %p format string, that pointer is "hashed", i.e. obscured by hashing the pointer value. This is a security feature that hides actual kernel addresses from unprivileged
                        users, but it also makes debugging the kernel more
                        difficult since unequal pointers can no longer be
                        compared.  However, if this command-line option is
specified, then all normal pointers will have their true value printed. This option should only be specified when debugging the kernel. Please do not use on production
                        kernels.

Spiega cosa fa. Poi alla fine dice di non usarlo nei kernels di produzione.


Guardando /proc/cmdline si dovrebbe vedere la presenza di questa
opzione, che si puo` togliere nella configurazione del boot loader.
In /boot/grub/grub.cfg non ho trovato quel parametro.
Non so se lo devo aggiungere ?

Io ho trovato questo nel mio /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-6.1.0-9-amd64 root=UUID=880d6880-906e-49a6-8e72-bef089ab837e ro kaslr pti=on slab_nomerge page_poison=1 slub_debug=FPZ nosmt

Non c'è il parametro no_hash_pointers

Grazie
Saluti
Claudio


Io, che sono vecchio e rinco, non vedo 'sto gran problema di
sicurezza, e da sviluppatore preferisco di gran lunga i numeri
veri. Ma oggi non si possono minimizzare potenziali minacce senza
sembrare rinco (appunto!) quindi forse andrebbe tolta l'opzione.

Il dubbio che rimane e` perche` qualcuno ha messo quel parametro,
che serve solo a chi fa debug sul kernel. Da me non c'e` :)

Comunque tra ricerche in rete e/o "git blame" sui sorgenti, e` spiegato
tutto.

saluti
/alessandro


--
https://www.linkedin.com/in/claudio-sandrone


Reply to: