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

Re: parametri Linux [ERA: Debian 12 - Messaggi dmesg]



Il 30/07/23 11:01, Davide Prina ha scritto:
pinguino ha scritto:

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

ma hai seguito qualche quida di hardening?
Se hai fatto un'installazione standard non dovresti avere tutti quei parametri
Buongiorno Lista,
Non ho seguito guide di hardening.
Soltanto questa sulla sicurezza Debian.
https://www.debian.org/doc/manuals/securing-debian-manual/,
per Debian 12.

Si, ho fatto una installazione standard. Ho scaricato il DVD dal sito ufficiale, ed ho fatto una installazione da zero. Non ho potuto fare un avanzamento di versione. I parametri che sono descritti qui sopra, non li ho inserito io. Erano già cosi come li ho trovati.

cercando in rete:

1) kaslr
kASLR is enabled by default in the Debian kernel since 4.7~rc7-1~exp1
(CONFIG_RANDOMIZE_BASE and CONFIG_RANDOMIZE_MEMORY) so there is no need to
enable it with a specific kernel parameter.

infatti se fai:
$ grep "CONFIG_RANDOMIZE_BASE\|CONFIG_RANDOMIZE_MEMORY" /boot/config-$(uname -r)
CONFIG_RANDOMIZE_BASE=y
CONFIG_RANDOMIZE_MEMORY=y
CONFIG_RANDOMIZE_MEMORY_PHYSICAL_PADDING=$(Valore)

quindi questo parametro è inutile poiché già abilitato di default

2) pti=on

enables kernel page-table isolation

$ grep CONFIG_PAGE_TABLE_ISOLATION /boot/config-$(uname -r)
CONFIG_PAGE_TABLE_ISOLATION=y

anche in questo caso il parametro è inutile perché già attivato

3) slab_nomerge

Disables the merging of slabs of similar sizes. Many times some obscure slab will
be used in a vulnerable way, allowing an attacker to mess with it more or less
arbitrarily. Most slabs are not usable even when exploited, so this isn't too big
of a deal. Unfortunately the kernel will merge similar slabs to save a tiny bit of
space, and if a vulnerable and useless slab is merged with a safe but useful slab,
an attacker can leverage that aliasing to do far more harm than they could have
otherwise. In effect, this reduces kernel attack surface area by isolating slabs
from each other. The trade-off is a very slight increase in kernel memory
utilization. slabinfo -a can be used to tell what the memory footprint increase
would be on a given system.

$ grep SLAB /boot/config-$(uname -r)
# SLAB allocator options
# CONFIG_SLAB is not set
CONFIG_SLAB_MERGE_DEFAULT=y
CONFIG_SLAB_FREELIST_RANDOM=y
CONFIG_SLAB_FREELIST_HARDENED=y
# end of SLAB allocator options

questo, da quanto deduco, dovrebbe avere un effetto diverso da quanto previsto
nel Linux di default Debian

4) page_poison=1

clear the page allocator to prevent use-after-free attacks

$ grep CONFIG_PAGE_POISONING /boot/config-$(uname -r)
CONFIG_PAGE_POISONING=y

anche questo è inutile poiché già attivato

5) slub_debug=FPZ

Enables sanity checks (F) and redzoning (Z). Sanity checks are self-evident and
come with a modest performance impact, but this is unlikely to be significant on
an average Tails system. The checks are basic but are still useful both for
security and as a debugging measure. Redzoning adds extra areas around slabs that
detect when a slab is overwritten past its real size, which can help detect
overflows. Its performance impact is negligible.

An additional note: any time slub_debug= is put in the kernel command line,
slab_nomerge is implied. But having slab_nomerge explicitely declared can help
prevent regressions where disabling of debugging features is desired but
re-enabling of merging is not.

come indicato sopra questo dovrebbe far qualcosa di diverso, però non so se
funziona dato che
# CONFIG_SLAB is not set

6) nosmt

disables SMT

questo, se ho interpretato correttamente, disabilita l'SMT (Simultaneous
MultiThreading), ma fare questo ha forti impatti prestazionali.
La sua disabilitazione permette di evitare che i bug hardware collegati ad esso
possano essere sfruttati.



Penso che questi parametri li hai abilitati in /etc/default/grub
In /etc/default/grub.d/01_hardening.cfg ho trovato questo :
GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT kaslr pti=on slab_nomerge page_poison=1 slub_debug=FPZ nosmt"

sembra che siano abilitati anche qui.

In /etc/default/ non c'è il file grub , ma c'è grub.ucf-dist che non ha quei parametri.

per saperne di più:
$ man kernel-command-line

https://www.kernel.org/doc/html/
Ok. Lo leggo.

Io sconsiglio di applicare a caso qualcosa trovato su un articolo o su qualche
guida generica, senza essersi informati per avere almeno un'idea generica di
quello che si sta facendo e verificare se sulla propria Debian è già abilitato
o meno e che effetti ha con il resto della configurazione in essere.

Ciao
Davide

Grazie
Saluti
Claudio

--
La mia privacy non è affar tuo
https://noyb.eu/it
- You do not have my permission to use this email to train an AI -


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


Reply to: