Harden check for used modules in hostonly mode
PATCH 1/1 Harden check for used modules in hostonly mode
Make sure that we do not accept module name which is substring of some other module name. This resulted in piix being mistakenly loaded together with ata_piix. It completely broke DVD access here.
---
dracut-functions | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
dracut-functions +1 -1
@@ -502,7 +502,7 @@ instmods() { [[ -f $initdir/$1 ]] && { shift; continue; } # If we are building a host-specific initramfs and this # module is not already loaded, move on to the next one. - [[ $hostonly ]] && ! grep -q "${mod//-/_}" /proc/modules && \ + [[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \ ! echo $add_drivers | grep -qe "\<${mod}\>" && { shift; continue; }
Quoted 1 line · On Sunday 09 of May 2010 22:23:58 Andrey Borzenkov wrote:
Make sure
that we do not accept module name which is substring of
Quoted 1 line
some other
module name. This resulted in piix being mistakenly loaded
Quoted 1 line
together
with ata_piix. It completely broke DVD access here.
Quoted 2 lines
Quoted 1 line
Ping. In
2.6.35 it became much worse. In 2.6.33 I had DVD as IDE and HD as PATA which was OK. In 2.6.35 using exactly the same setup I lost any access to HD. I.e. with these modules:
{pts/1}% lsmod | grep piixata_piix
22460 0
libata 193241 4
ata_generic,pata_acpi,ata_piix,ahci
piix 5408 1
ide_core 116373 3
ide_cd_mod,ide_pci_generic,piix
2.6.33 detects DVD as hda and HDD as
sda; with 2.6.35 only hda is detected. If I unload IDE stack and reload ata_piix it correctly detects both HDD as sda and DVD as sr0.
So without this patch dracut generates initrd that cannot find root device.
Thank you!
Quoted 4 lines
---
dracut-functions | 2 +-1
files changed, 1 insertions(+), 1 deletions(-)
Quoted 2 lines
diff --git
a/dracut-functions b/dracut-functions
Quoted 1 line
index fdcfb7e..ebf09c0
100755
Quoted 3 lines
dracut-functions +0
-0@@ -502,7
+502,7 @@ instmods() {
Quoted 1 line
[[ -f $initdir/$1 ]] && { shift;
continue; }
Quoted 1 line
# If we are building a host-specific initramfs and
this
Quoted 2 lines
# module is not already loaded, move on to the next one.
- [[ $hostonly ]] && ! grep -q "${mod//-/_}" /proc/modules && \
Quoted 1 line
+ [[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules &&
\
Quoted 2 lines
! echo $add_drivers | grep -qe "\<${mod}\>" && {
shift; continue;
Quoted 4 lines
}
--
To unsubscribe from this list: send
the line "unsubscribe initramfs"
Quoted 1 line
in the body of a message to
Quoted 1 line
More majordomo info at
pushed
Quoted 29 lines · Andrey Borzenkov
Make sure that we do not accept module name which is substring of some other module name. This resulted in piix being mistakenly loaded together with
ata_piix. It completely broke DVD access here.Signed-off-by Andrey Borzenkov<arvidjaar-JGs/[email protected]>---
dracut-functions | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)dracut-functions +1
-2@@ -502,7 +502,7 @@ instmods() { [[ -f $initdir/$1 ]]&& { shift; continue; } # If we are building a host-specific initramfs and this # module is not already loaded, move on to the next one. - [[ $hostonly ]]&& ! grep -q "${mod//-/_}" /proc/modules&& \ + [[ $hostonly ]]&& ! grep -qe "\<${mod//-/_}\>" /proc/modules&& \ ! echo $add_drivers | grep -qe "\<${mod}\>"&& { shift; continue; } --To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html