All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Harden check for used modules in hostonly mode
@ 2010-05-09 18:23 Andrey Borzenkov
  2010-08-04  6:55 ` Andrey Borzenkov
  2010-08-04 16:31 ` Harald Hoyer
  0 siblings, 2 replies; 3+ messages in thread
From: Andrey Borzenkov @ 2010-05-09 18:23 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

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/UdohzUI@public.gmane.org>

---

 dracut-functions |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dracut-functions b/dracut-functions
index fdcfb7e..ebf09c0 100755
--- a/dracut-functions
+++ b/dracut-functions
@@ -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; 
 		}

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Harden check for used modules in hostonly mode
  2010-05-09 18:23 [PATCH] Harden check for used modules in hostonly mode Andrey Borzenkov
@ 2010-08-04  6:55 ` Andrey Borzenkov
  2010-08-04 16:31 ` Harald Hoyer
  1 sibling, 0 replies; 3+ messages in thread
From: Andrey Borzenkov @ 2010-08-04  6:55 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: Text/Plain, Size: 1992 bytes --]

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
> 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/UdohzUI@public.gmane.org>
> 

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 piix
ata_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!

> ---
> 
>  dracut-functions |    2 +-
>  1
files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git
a/dracut-functions b/dracut-functions
> index fdcfb7e..ebf09c0
100755
> --- a/dracut-functions
> +++ b/dracut-functions
> @@ -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
majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at 
http://vger.kernel.org/majordomo-info.html


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Harden check for used modules in hostonly mode
  2010-05-09 18:23 [PATCH] Harden check for used modules in hostonly mode Andrey Borzenkov
  2010-08-04  6:55 ` Andrey Borzenkov
@ 2010-08-04 16:31 ` Harald Hoyer
  1 sibling, 0 replies; 3+ messages in thread
From: Harald Hoyer @ 2010-08-04 16:31 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA

pushed

On 05/09/2010 08:23 PM, Andrey Borzenkov wrote:
> 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/UdohzUI@public.gmane.org>
>
> ---
>
>   dracut-functions |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/dracut-functions b/dracut-functions
> index fdcfb7e..ebf09c0 100755
> --- a/dracut-functions
> +++ b/dracut-functions
> @@ -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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-04 16:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-09 18:23 [PATCH] Harden check for used modules in hostonly mode Andrey Borzenkov
2010-08-04  6:55 ` Andrey Borzenkov
2010-08-04 16:31 ` Harald Hoyer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.