Skip to content

Commit e54cb00

Browse files
committed
Merge remote-tracking branch 'raja/limit_bdev_writes' into arraybolt3/trixie
2 parents 84e193c + e43d4d7 commit e54cb00

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ Kernel space:
248248
- Optional - On compatible AMD CPUs enable Secure Memory Encryption (SME) to protect against
249249
cold boot attacks and Secure Encrypted Virtualization (SEV) for further guest memory isolation.
250250

251+
- Prevent runaway privileged processes from writing to block devices that are mounted by
252+
filesystems to protect against filesystem corruption and kernel crashes.
253+
251254
Direct memory access:
252255

253256
- Enable strict IOMMU translation to protect against some DMA attacks via the use

etc/default/grub.d/40_kernel_hardening.cfg#security-misc-shared

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,18 @@ GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX erst_disable"
259259
#GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX mem_encrypt=on"
260260
#GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX kvm_amd.sev=1"
261261

262+
## Prevent processes from writing to block devices that are mounted by filesystems.
263+
## Enhances system stability and security by protecting against runaway privileged processes.
264+
## Allowing processes to write to the buffer cache can cause filesystem corruption and kernel crashes.
265+
## Does not prevent data modifications using direct SCSI commands or lower-level storage stack access.
266+
## May lead to breakages in certain limited scenarios.
267+
##
268+
## https://github.com/torvalds/linux/commit/ed5cc702d311c14b653323d76062b0294effa66e
269+
## https://lore.kernel.org/lkml/20240105-vfs-super-4092d802972c@brauner/
270+
## https://github.com/a13xp0p0v/kernel-hardening-checker/issues/186
271+
##
272+
GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX bdev_allow_write_mounted=0"
273+
262274
## 2. Direct Memory Access:
263275
##
264276
## https://madaidans-insecurities.github.io/guides/linux-hardening.html#dma-attacks

0 commit comments

Comments
 (0)