mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zdev/dracut: Prevent loading of unused kernel modules
zdev provides dracut logic for configuring devices early during boot via kernel command line parameters rd.dasd and rd.zfcp. A copy of resulting configuration directives is made available to the booted Linux using chzdev's export function. The use of command line option --all in this export step results in chzdev loading all kernel modules required by supported types, even if no device of that type exists on the booted system, or if no zdev kernel parameter was specified. Loading unused kernel modules during boot increases memory usage, prolongs boot time, and expands the kernel's attack surface unnecessarily. Fix this by replacing command line option --all with --configured to instruct chzdev to export only data for devices with a persistent configuration, while not loading any kernel modules. Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com> Reviewed-by: Vineeth Vijayan <vneethv@linux.ibm.com> Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
a3d50487ed
commit
c12faf0128
@@ -9,7 +9,7 @@
|
||||
# Copy zdev persistent config from initrd to root-fs.
|
||||
#
|
||||
|
||||
chzdev --export /run/zdev.initrd.config --all --type --persistent --quiet
|
||||
chzdev --export /run/zdev.initrd.config --configured --type --persistent --quiet
|
||||
|
||||
# Apart from debugging purposes, this is useful for distro installers,
|
||||
# which can import the early config into their own environment early
|
||||
|
||||
Reference in New Issue
Block a user