Debian Bug report logs - #689872
libkmod2: module parameters on kernel command line parsed wrong

version graph

Package: libkmod2; Maintainer for libkmod2 is Marco d'Itri <md@linux.it>; Source for libkmod2 is src:kmod.

Reported by: "Selim T. Erdogan" <selim@alumni.cs.utexas.edu>

Date: Sun, 7 Oct 2012 13:12:01 UTC

Severity: important

Tags: d-i, patch

Found in version kmod/9-2

Fixed in version kmod/9-3

Done: Marco d'Itri <md@linux.it>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, selim@alumni.cs.utexas.edu, Marco d'Itri <md@linux.it>:
Bug#689872; Package libkmod2. (Sun, 07 Oct 2012 13:12:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Selim T. Erdogan" <selim@alumni.cs.utexas.edu>:
New Bug report received and forwarded. Copy sent to selim@alumni.cs.utexas.edu, Marco d'Itri <md@linux.it>. (Sun, 07 Oct 2012 13:12:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: "Selim T. Erdogan" <selim@alumni.cs.utexas.edu>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: libkmod2: module parameters on kernel command line parsed wrong
Date: Sun, 07 Oct 2012 16:08:56 +0300
Package: libkmod2
Version: 9-2
Severity: important
Tags: d-i patch

This problem only affects module parameters given on the kernel command 
line at boot time which include a '.' as part of their value.  For 
example "libata.force=1.5Gbps".  The bug causes such values to 
overwrite the parameter, so this would get interpreted as parameter 
"5Gbps" with no value.  ("force" gets lost.)

To reproduce this safely, add "testmodule.testparam=1.5G" to the end of 
the kernel command line at boot time.  Then:

$ /sbin/modprobe -c |grep 5G
options testmodule 5G

This problem prevented me from using the wheezy beta 2 debian-installer 
on a machine that needed libata.force=1.5Gbps to work properly with my 
new SSD.  See https://lists.debian.org/debian-boot/2012/10/msg00049.html

I'm including a very simple at the end of the report that fixes the 
problem.  Feel free to modify/edit as necessary.  With this patch:

$ /sbin/modprobe -c |grep 5G
options testmodule testparam=1.5G


-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-3-686-pae (SMP w/1 CPU core)
Locale: LANG=tr_TR.UTF-8, LC_CTYPE=tr_TR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libkmod2 depends on:
ii  libc6              2.13-35
ii  multiarch-support  2.13-35

libkmod2 recommends no packages.

libkmod2 suggests no packages.

-- no debconf information

*** kcmdline-option-parsing
Description: Fixes parsing of module parameters on the kernel command 
 line.  Before this patch, if the parameter value had a '.' in it, that 
 would break things.
Author: Selim T. Erdoğan <selim@alumni.cs.utexas.edu>

--- kmod-9.orig/libkmod/libkmod-config.c
+++ kmod-9/libkmod/libkmod-config.c
@@ -542,6 +542,7 @@ static int kmod_config_parse_kcmdline(st
 	char buf[KCMD_LINE_SIZE];
 	int fd, err;
 	char *p, *modname,  *param = NULL, *value = NULL;
+	int in_value_text = 0;
 
 	fd = open("/proc/cmdline", O_RDONLY|O_CLOEXEC);
 	if (fd < 0) {
@@ -564,15 +565,20 @@ static int kmod_config_parse_kcmdline(st
 			*p = '\0';
 			kcmdline_parse_result(config, modname, param, value);
 			param = value = NULL;
+			in_value_text = 0;
 			modname = p + 1;
 			break;
 		case '.':
-			*p = '\0';
-			param = p + 1;
-			break;
+			if (in_value_text == 0) {
+				*p = '\0';
+				param = p + 1;
+				break;
+			}
 		case '=':
-			if (param != NULL)
+			if (param != NULL) {
 				value = p + 1;
+				in_value_text=1;
+			}
 			break;
 		}
 	}



Information forwarded to debian-bugs-dist@lists.debian.org, Marco d'Itri <md@linux.it>:
Bug#689872; Package libkmod2. (Mon, 08 Oct 2012 22:00:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lucas De Marchi <lucas.demarchi@profusion.mobi>:
Extra info received and forwarded to list. Copy sent to Marco d'Itri <md@linux.it>. (Mon, 08 Oct 2012 22:00:09 GMT) Full text and rfc822 format available.

Message #10 received at 689872@bugs.debian.org (full text, mbox):

From: Lucas De Marchi <lucas.demarchi@profusion.mobi>
To: "Marco d'Itri" <md@linux.it>
Subject: Re: Bug#689872: libkmod2: module parameters on kernel command line parsed wrong
Date: Mon, 8 Oct 2012 18:56:05 -0300
On Mon, Oct 8, 2012 at 6:52 PM, Lucas De Marchi
<lucas.demarchi@profusion.mobi> wrote:
> On Sun, Oct 7, 2012 at 2:35 PM, Marco d'Itri <md@linux.it> wrote:
>> Any objections?
>>
>> ----- Forwarded message from "Selim T. Erdogan" <selim@alumni.cs.utexas.edu> -----
>>
>> From: "Selim T. Erdogan" <selim@alumni.cs.utexas.edu>
>> To: Debian Bug Tracking System <submit@bugs.debian.org>
>> Subject: Bug#689872: libkmod2: module parameters on kernel command line parsed
>>         wrong
>>
>> Package: libkmod2
>> Version: 9-2
>> Severity: important
>> Tags: d-i patch
>>
>> This problem only affects module parameters given on the kernel command
>> line at boot time which include a '.' as part of their value.  For
>> example "libata.force=1.5Gbps".  The bug causes such values to
>> overwrite the parameter, so this would get interpreted as parameter
>> "5Gbps" with no value.  ("force" gets lost.)
>>
>> To reproduce this safely, add "testmodule.testparam=1.5G" to the end of
>> the kernel command line at boot time.  Then:
>>
>> $ /sbin/modprobe -c |grep 5G
>> options testmodule 5G
>>
>> This problem prevented me from using the wheezy beta 2 debian-installer
>> on a machine that needed libata.force=1.5Gbps to work properly with my
>> new SSD.  See https://lists.debian.org/debian-boot/2012/10/msg00049.html
>>
>> I'm including a very simple at the end of the report that fixes the
>> problem.  Feel free to modify/edit as necessary.  With this patch:
>>
>> $ /sbin/modprobe -c |grep 5G
>> options testmodule testparam=1.5G
>>
>>
>> -- System Information:
>> Debian Release: wheezy/sid
>>   APT prefers unstable
>>   APT policy: (500, 'unstable'), (1, 'experimental')
>> Architecture: i386 (i686)
>>
>> Kernel: Linux 3.2.0-3-686-pae (SMP w/1 CPU core)
>> Locale: LANG=tr_TR.UTF-8, LC_CTYPE=tr_TR.UTF-8 (charmap=UTF-8)
>> Shell: /bin/sh linked to /bin/dash
>>
>> Versions of packages libkmod2 depends on:
>> ii  libc6              2.13-35
>> ii  multiarch-support  2.13-35
>>
>> libkmod2 recommends no packages.
>>
>> libkmod2 suggests no packages.
>>
>> -- no debconf information
>>
>> *** kcmdline-option-parsing
>> Description: Fixes parsing of module parameters on the kernel command
>>  line.  Before this patch, if the parameter value had a '.' in it, that
>>  would break things.
>> Author: Selim T. Erdoğan <selim@alumni.cs.utexas.edu>
>>
>> --- kmod-9.orig/libkmod/libkmod-config.c
>> +++ kmod-9/libkmod/libkmod-config.c
>> @@ -542,6 +542,7 @@ static int kmod_config_parse_kcmdline(st
>>         char buf[KCMD_LINE_SIZE];
>>         int fd, err;
>>         char *p, *modname,  *param = NULL, *value = NULL;
>> +       int in_value_text = 0;
>>
>>         fd = open("/proc/cmdline", O_RDONLY|O_CLOEXEC);
>>         if (fd < 0) {
>> @@ -564,15 +565,20 @@ static int kmod_config_parse_kcmdline(st
>>                         *p = '\0';
>>                         kcmdline_parse_result(config, modname, param, value);
>>                         param = value = NULL;
>> +                       in_value_text = 0;
>>                         modname = p + 1;
>>                         break;
>>                 case '.':
>> -                       *p = '\0';
>> -                       param = p + 1;
>> -                       break;
>> +                       if (in_value_text == 0) {
>> +                               *p = '\0';
>> +                               param = p + 1;
>> +                               break;
>> +                       }
>
> this fall-through here doesn't seem intentional
>
>
>>                 case '=':
>> -                       if (param != NULL)
>> +                       if (param != NULL) {
>>                                 value = p + 1;
>> +                               in_value_text=1;
>> +                       }
>>                         break;
>>                 }
>>         }
>>
>
> Why adding another var? Isn't something like below (whitespace
> damaged) sufficient?
>
>
> Lucas De Marchi
>
> diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
> index 70044f0..398468e 100644
> --- a/libkmod/libkmod-config.c
> +++ b/libkmod/libkmod-config.c
> @@ -567,8 +567,10 @@ static int kmod_config_parse_kcmdline(struct
> kmod_config *config)
>                         modname = p + 1;
>                         break;
>                 case '.':
> -                       *p = '\0';
> -                       param = p + 1;
> +                       if (param == NULL) {
> +                               *p = '\0';
> +                               param = p + 1;
> +                       }
>                         break;
>                 case '=':
>                         if (param != NULL)

Just made a quick test here and it works:

└ kmod ➤ ./tools/modprobe -c | grep testmodule
options testmodule testparam=1.5G

Lucas De Marchi



Information forwarded to debian-bugs-dist@lists.debian.org, Marco d'Itri <md@linux.it>:
Bug#689872; Package libkmod2. (Mon, 08 Oct 2012 22:00:11 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lucas De Marchi <lucas.demarchi@profusion.mobi>:
Extra info received and forwarded to list. Copy sent to Marco d'Itri <md@linux.it>. (Mon, 08 Oct 2012 22:00:11 GMT) Full text and rfc822 format available.

Message #15 received at 689872@bugs.debian.org (full text, mbox):

From: Lucas De Marchi <lucas.demarchi@profusion.mobi>
To: "Marco d'Itri" <md@linux.it>
Subject: Re: Bug#689872: libkmod2: module parameters on kernel command line parsed wrong
Date: Mon, 8 Oct 2012 18:52:55 -0300
On Sun, Oct 7, 2012 at 2:35 PM, Marco d'Itri <md@linux.it> wrote:
> Any objections?
>
> ----- Forwarded message from "Selim T. Erdogan" <selim@alumni.cs.utexas.edu> -----
>
> From: "Selim T. Erdogan" <selim@alumni.cs.utexas.edu>
> To: Debian Bug Tracking System <submit@bugs.debian.org>
> Subject: Bug#689872: libkmod2: module parameters on kernel command line parsed
>         wrong
>
> Package: libkmod2
> Version: 9-2
> Severity: important
> Tags: d-i patch
>
> This problem only affects module parameters given on the kernel command
> line at boot time which include a '.' as part of their value.  For
> example "libata.force=1.5Gbps".  The bug causes such values to
> overwrite the parameter, so this would get interpreted as parameter
> "5Gbps" with no value.  ("force" gets lost.)
>
> To reproduce this safely, add "testmodule.testparam=1.5G" to the end of
> the kernel command line at boot time.  Then:
>
> $ /sbin/modprobe -c |grep 5G
> options testmodule 5G
>
> This problem prevented me from using the wheezy beta 2 debian-installer
> on a machine that needed libata.force=1.5Gbps to work properly with my
> new SSD.  See https://lists.debian.org/debian-boot/2012/10/msg00049.html
>
> I'm including a very simple at the end of the report that fixes the
> problem.  Feel free to modify/edit as necessary.  With this patch:
>
> $ /sbin/modprobe -c |grep 5G
> options testmodule testparam=1.5G
>
>
> -- System Information:
> Debian Release: wheezy/sid
>   APT prefers unstable
>   APT policy: (500, 'unstable'), (1, 'experimental')
> Architecture: i386 (i686)
>
> Kernel: Linux 3.2.0-3-686-pae (SMP w/1 CPU core)
> Locale: LANG=tr_TR.UTF-8, LC_CTYPE=tr_TR.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
>
> Versions of packages libkmod2 depends on:
> ii  libc6              2.13-35
> ii  multiarch-support  2.13-35
>
> libkmod2 recommends no packages.
>
> libkmod2 suggests no packages.
>
> -- no debconf information
>
> *** kcmdline-option-parsing
> Description: Fixes parsing of module parameters on the kernel command
>  line.  Before this patch, if the parameter value had a '.' in it, that
>  would break things.
> Author: Selim T. Erdoğan <selim@alumni.cs.utexas.edu>
>
> --- kmod-9.orig/libkmod/libkmod-config.c
> +++ kmod-9/libkmod/libkmod-config.c
> @@ -542,6 +542,7 @@ static int kmod_config_parse_kcmdline(st
>         char buf[KCMD_LINE_SIZE];
>         int fd, err;
>         char *p, *modname,  *param = NULL, *value = NULL;
> +       int in_value_text = 0;
>
>         fd = open("/proc/cmdline", O_RDONLY|O_CLOEXEC);
>         if (fd < 0) {
> @@ -564,15 +565,20 @@ static int kmod_config_parse_kcmdline(st
>                         *p = '\0';
>                         kcmdline_parse_result(config, modname, param, value);
>                         param = value = NULL;
> +                       in_value_text = 0;
>                         modname = p + 1;
>                         break;
>                 case '.':
> -                       *p = '\0';
> -                       param = p + 1;
> -                       break;
> +                       if (in_value_text == 0) {
> +                               *p = '\0';
> +                               param = p + 1;
> +                               break;
> +                       }

this fall-through here doesn't seem intentional


>                 case '=':
> -                       if (param != NULL)
> +                       if (param != NULL) {
>                                 value = p + 1;
> +                               in_value_text=1;
> +                       }
>                         break;
>                 }
>         }
>

Why adding another var? Isn't something like below (whitespace
damaged) sufficient?


Lucas De Marchi

diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
index 70044f0..398468e 100644
--- a/libkmod/libkmod-config.c
+++ b/libkmod/libkmod-config.c
@@ -567,8 +567,10 @@ static int kmod_config_parse_kcmdline(struct
kmod_config *config)
 			modname = p + 1;
 			break;
 		case '.':
-			*p = '\0';
-			param = p + 1;
+			if (param == NULL) {
+				*p = '\0';
+				param = p + 1;
+			}
 			break;
 		case '=':
 			if (param != NULL)



Information forwarded to debian-bugs-dist@lists.debian.org, Marco d'Itri <md@linux.it>:
Bug#689872; Package libkmod2. (Mon, 08 Oct 2012 23:00:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Selim T. Erdogan" <selim@alumni.cs.utexas.edu>:
Extra info received and forwarded to list. Copy sent to Marco d'Itri <md@linux.it>. (Mon, 08 Oct 2012 23:00:03 GMT) Full text and rfc822 format available.

Message #20 received at 689872@bugs.debian.org (full text, mbox):

From: "Selim T. Erdogan" <selim@alumni.cs.utexas.edu>
To: Lucas De Marchi <lucas.demarchi@profusion.mobi>, 689872@bugs.debian.org
Cc: "Marco d'Itri" <md@linux.it>
Subject: Re: Bug#689872: libkmod2: module parameters on kernel command line parsed wrong
Date: Mon, 8 Oct 2012 17:39:58 -0500
On Mon, Oct 08, 2012 at 06:56:05PM -0300, Lucas De Marchi wrote:
> On Mon, Oct 8, 2012 at 6:52 PM, Lucas De Marchi
> <lucas.demarchi@profusion.mobi> wrote:
> > On Sun, Oct 7, 2012 at 2:35 PM, Marco d'Itri <md@linux.it> wrote:
> >> Any objections?
> >>
> >> ----- Forwarded message from "Selim T. Erdogan" <selim@alumni.cs.utexas.edu> -----
> >>
> >> From: "Selim T. Erdogan" <selim@alumni.cs.utexas.edu>
> >> To: Debian Bug Tracking System <submit@bugs.debian.org>
> >> Subject: Bug#689872: libkmod2: module parameters on kernel command line parsed
> >>         wrong
> >>
> >> Package: libkmod2
> >> Version: 9-2
> >> Severity: important
> >> Tags: d-i patch
> >>
> >> This problem only affects module parameters given on the kernel command
> >> line at boot time which include a '.' as part of their value.  For
> >> example "libata.force=1.5Gbps".  The bug causes such values to
> >> overwrite the parameter, so this would get interpreted as parameter
> >> "5Gbps" with no value.  ("force" gets lost.)
> >>
> >> To reproduce this safely, add "testmodule.testparam=1.5G" to the end of
> >> the kernel command line at boot time.  Then:
> >>
> >> $ /sbin/modprobe -c |grep 5G
> >> options testmodule 5G
> >>
> >> This problem prevented me from using the wheezy beta 2 debian-installer
> >> on a machine that needed libata.force=1.5Gbps to work properly with my
> >> new SSD.  See https://lists.debian.org/debian-boot/2012/10/msg00049.html
> >>
> >> I'm including a very simple at the end of the report that fixes the
> >> problem.  Feel free to modify/edit as necessary.  With this patch:
> >>
> >> $ /sbin/modprobe -c |grep 5G
> >> options testmodule testparam=1.5G
> >>
> >>
> >> -- System Information:
> >> Debian Release: wheezy/sid
> >>   APT prefers unstable
> >>   APT policy: (500, 'unstable'), (1, 'experimental')
> >> Architecture: i386 (i686)
> >>
> >> Kernel: Linux 3.2.0-3-686-pae (SMP w/1 CPU core)
> >> Locale: LANG=tr_TR.UTF-8, LC_CTYPE=tr_TR.UTF-8 (charmap=UTF-8)
> >> Shell: /bin/sh linked to /bin/dash
> >>
> >> Versions of packages libkmod2 depends on:
> >> ii  libc6              2.13-35
> >> ii  multiarch-support  2.13-35
> >>
> >> libkmod2 recommends no packages.
> >>
> >> libkmod2 suggests no packages.
> >>
> >> -- no debconf information
> >>
> >> *** kcmdline-option-parsing
> >> Description: Fixes parsing of module parameters on the kernel command
> >>  line.  Before this patch, if the parameter value had a '.' in it, that
> >>  would break things.
> >> Author: Selim T. Erdoğan <selim@alumni.cs.utexas.edu>
> >>
> >> --- kmod-9.orig/libkmod/libkmod-config.c
> >> +++ kmod-9/libkmod/libkmod-config.c
> >> @@ -542,6 +542,7 @@ static int kmod_config_parse_kcmdline(st
> >>         char buf[KCMD_LINE_SIZE];
> >>         int fd, err;
> >>         char *p, *modname,  *param = NULL, *value = NULL;
> >> +       int in_value_text = 0;
> >>
> >>         fd = open("/proc/cmdline", O_RDONLY|O_CLOEXEC);
> >>         if (fd < 0) {
> >> @@ -564,15 +565,20 @@ static int kmod_config_parse_kcmdline(st
> >>                         *p = '\0';
> >>                         kcmdline_parse_result(config, modname, param, value);
> >>                         param = value = NULL;
> >> +                       in_value_text = 0;
> >>                         modname = p + 1;
> >>                         break;
> >>                 case '.':
> >> -                       *p = '\0';
> >> -                       param = p + 1;
> >> -                       break;
> >> +                       if (in_value_text == 0) {
> >> +                               *p = '\0';
> >> +                               param = p + 1;
> >> +                               break;
> >> +                       }
> >
> > this fall-through here doesn't seem intentional

You're correct.

> >
> >
> >>                 case '=':
> >> -                       if (param != NULL)
> >> +                       if (param != NULL) {
> >>                                 value = p + 1;
> >> +                               in_value_text=1;
> >> +                       }
> >>                         break;
> >>                 }
> >>         }
> >>
> >
> > Why adding another var? Isn't something like below (whitespace
> > damaged) sufficient?

The version below looks good to me.  (Not being familiar with how 
module loading works, it took me quite some time to figure out where the 
problem was: looked in the kernel, then in the debian-installer and 
finally in kmod.  At that point I just wanted to get a quick fix to 
distinguish the two situations in which we may get a '.' and didn't 
notice that param being non-NULL would be sufficient for signaling.)

> >
> >
> > Lucas De Marchi
> >
> > diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
> > index 70044f0..398468e 100644
> > --- a/libkmod/libkmod-config.c
> > +++ b/libkmod/libkmod-config.c
> > @@ -567,8 +567,10 @@ static int kmod_config_parse_kcmdline(struct
> > kmod_config *config)
> >                         modname = p + 1;
> >                         break;
> >                 case '.':
> > -                       *p = '\0';
> > -                       param = p + 1;
> > +                       if (param == NULL) {
> > +                               *p = '\0';
> > +                               param = p + 1;
> > +                       }
> >                         break;
> >                 case '=':
> >                         if (param != NULL)
> 
> Just made a quick test here and it works:
> 
> └ kmod ➤ ./tools/modprobe -c | grep testmodule
> options testmodule testparam=1.5G
> 
> Lucas De Marchi

Thanks!

Selim




Information forwarded to debian-bugs-dist@lists.debian.org, Marco d'Itri <md@linux.it>:
Bug#689872; Package libkmod2. (Mon, 08 Oct 2012 23:00:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lucas De Marchi <lucas.demarchi@profusion.mobi>:
Extra info received and forwarded to list. Copy sent to Marco d'Itri <md@linux.it>. (Mon, 08 Oct 2012 23:00:06 GMT) Full text and rfc822 format available.

Message #25 received at 689872@bugs.debian.org (full text, mbox):

From: Lucas De Marchi <lucas.demarchi@profusion.mobi>
To: "Selim T. Erdogan" <selim@alumni.cs.utexas.edu>
Cc: 689872@bugs.debian.org, "Marco d'Itri" <md@linux.it>
Subject: Re: Bug#689872: libkmod2: module parameters on kernel command line parsed wrong
Date: Mon, 8 Oct 2012 19:57:17 -0300
On Mon, Oct 8, 2012 at 7:39 PM, Selim T. Erdogan
<selim@alumni.cs.utexas.edu> wrote:
> On Mon, Oct 08, 2012 at 06:56:05PM -0300, Lucas De Marchi wrote:
>> On Mon, Oct 8, 2012 at 6:52 PM, Lucas De Marchi
>> <lucas.demarchi@profusion.mobi> wrote:
>> > On Sun, Oct 7, 2012 at 2:35 PM, Marco d'Itri <md@linux.it> wrote:
>> >> Any objections?
>> >>
>> >> ----- Forwarded message from "Selim T. Erdogan" <selim@alumni.cs.utexas.edu> -----
>> >>
>> >> From: "Selim T. Erdogan" <selim@alumni.cs.utexas.edu>
>> >> To: Debian Bug Tracking System <submit@bugs.debian.org>
>> >> Subject: Bug#689872: libkmod2: module parameters on kernel command line parsed
>> >>         wrong
>> >>
>> >> Package: libkmod2
>> >> Version: 9-2
>> >> Severity: important
>> >> Tags: d-i patch
>> >>
>> >> This problem only affects module parameters given on the kernel command
>> >> line at boot time which include a '.' as part of their value.  For
>> >> example "libata.force=1.5Gbps".  The bug causes such values to
>> >> overwrite the parameter, so this would get interpreted as parameter
>> >> "5Gbps" with no value.  ("force" gets lost.)
>> >>
>> >> To reproduce this safely, add "testmodule.testparam=1.5G" to the end of
>> >> the kernel command line at boot time.  Then:
>> >>
>> >> $ /sbin/modprobe -c |grep 5G
>> >> options testmodule 5G
>> >>
>> >> This problem prevented me from using the wheezy beta 2 debian-installer
>> >> on a machine that needed libata.force=1.5Gbps to work properly with my
>> >> new SSD.  See https://lists.debian.org/debian-boot/2012/10/msg00049.html
>> >>
>> >> I'm including a very simple at the end of the report that fixes the
>> >> problem.  Feel free to modify/edit as necessary.  With this patch:
>> >>
>> >> $ /sbin/modprobe -c |grep 5G
>> >> options testmodule testparam=1.5G
>> >>
>> >>
>> >> -- System Information:
>> >> Debian Release: wheezy/sid
>> >>   APT prefers unstable
>> >>   APT policy: (500, 'unstable'), (1, 'experimental')
>> >> Architecture: i386 (i686)
>> >>
>> >> Kernel: Linux 3.2.0-3-686-pae (SMP w/1 CPU core)
>> >> Locale: LANG=tr_TR.UTF-8, LC_CTYPE=tr_TR.UTF-8 (charmap=UTF-8)
>> >> Shell: /bin/sh linked to /bin/dash
>> >>
>> >> Versions of packages libkmod2 depends on:
>> >> ii  libc6              2.13-35
>> >> ii  multiarch-support  2.13-35
>> >>
>> >> libkmod2 recommends no packages.
>> >>
>> >> libkmod2 suggests no packages.
>> >>
>> >> -- no debconf information
>> >>
>> >> *** kcmdline-option-parsing
>> >> Description: Fixes parsing of module parameters on the kernel command
>> >>  line.  Before this patch, if the parameter value had a '.' in it, that
>> >>  would break things.
>> >> Author: Selim T. Erdoğan <selim@alumni.cs.utexas.edu>
>> >>
>> >> --- kmod-9.orig/libkmod/libkmod-config.c
>> >> +++ kmod-9/libkmod/libkmod-config.c
>> >> @@ -542,6 +542,7 @@ static int kmod_config_parse_kcmdline(st
>> >>         char buf[KCMD_LINE_SIZE];
>> >>         int fd, err;
>> >>         char *p, *modname,  *param = NULL, *value = NULL;
>> >> +       int in_value_text = 0;
>> >>
>> >>         fd = open("/proc/cmdline", O_RDONLY|O_CLOEXEC);
>> >>         if (fd < 0) {
>> >> @@ -564,15 +565,20 @@ static int kmod_config_parse_kcmdline(st
>> >>                         *p = '\0';
>> >>                         kcmdline_parse_result(config, modname, param, value);
>> >>                         param = value = NULL;
>> >> +                       in_value_text = 0;
>> >>                         modname = p + 1;
>> >>                         break;
>> >>                 case '.':
>> >> -                       *p = '\0';
>> >> -                       param = p + 1;
>> >> -                       break;
>> >> +                       if (in_value_text == 0) {
>> >> +                               *p = '\0';
>> >> +                               param = p + 1;
>> >> +                               break;
>> >> +                       }
>> >
>> > this fall-through here doesn't seem intentional
>
> You're correct.
>
>> >
>> >
>> >>                 case '=':
>> >> -                       if (param != NULL)
>> >> +                       if (param != NULL) {
>> >>                                 value = p + 1;
>> >> +                               in_value_text=1;
>> >> +                       }
>> >>                         break;
>> >>                 }
>> >>         }
>> >>
>> >
>> > Why adding another var? Isn't something like below (whitespace
>> > damaged) sufficient?
>
> The version below looks good to me.  (Not being familiar with how
> module loading works, it took me quite some time to figure out where the
> problem was: looked in the kernel, then in the debian-installer and
> finally in kmod.  At that point I just wanted to get a quick fix to
> distinguish the two situations in which we may get a '.' and didn't
> notice that param being non-NULL would be sufficient for signaling.)


Thanks a lot for debugging this. Really appreciated. At the time I
wrote this function I thought a "." was not valid inside the value
param (partially because not using fp in kernel). Now I realize how
naive this assumption was and that it's even written in
Documentation/kernel-parameters.txt that we can have values with dots.


Lucas De Marchi



Reply sent to Marco d'Itri <md@linux.it>:
You have taken responsibility. (Sun, 07 Apr 2013 17:06:12 GMT) Full text and rfc822 format available.

Notification sent to "Selim T. Erdogan" <selim@alumni.cs.utexas.edu>:
Bug acknowledged by developer. (Sun, 07 Apr 2013 17:06:12 GMT) Full text and rfc822 format available.

Message #30 received at 689872-close@bugs.debian.org (full text, mbox):

From: Marco d'Itri <md@linux.it>
To: 689872-close@bugs.debian.org
Subject: Bug#689872: fixed in kmod 9-3
Date: Sun, 07 Apr 2013 17:02:46 +0000
Source: kmod
Source-Version: 9-3

We believe that the bug you reported is fixed in the latest version of
kmod, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 689872@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Marco d'Itri <md@linux.it> (supplier of updated kmod package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sun, 07 Apr 2013 18:19:01 +0200
Source: kmod
Binary: kmod module-init-tools libkmod2 libkmod-dev libkmod2-udeb
Architecture: source i386 all
Version: 9-3
Distribution: unstable
Urgency: low
Maintainer: Marco d'Itri <md@linux.it>
Changed-By: Marco d'Itri <md@linux.it>
Description: 
 kmod       - tools for managing Linux kernel modules
 libkmod-dev - libkmod development files
 libkmod2   - libkmod shared library
 libkmod2-udeb - libkmod shared library (udeb)
 module-init-tools - transitional dummy package (module-init-tools to kmod)
Closes: 674110 683972 689872 697750
Changes: 
 kmod (9-3) unstable; urgency=low
 .
   * Added backported patch dot_kcmdline: correctly parse kcmdline parameters
     containing a dot. (Closes: #689872)
   * Added backported patch bad_alias_assertion: stop modprobe from aborting
     from an assertion because of some invalid but common configuration
     directives. (Closes: #674110)
   * Removed the nfs4 alias from aliases.conf as requested by the kernel
     team. (Closes: #683972)
   * Removed the unnecessary build-dependency on perl. (Closes: #697750)
Checksums-Sha1: 
 541e7315d15660d741001677355836f818e2fad9 1175 kmod_9-3.dsc
 abccd812b0519b97b50e69ff7e7c4d89f9f48e57 11865 kmod_9-3.debian.tar.gz
 c6dc3140eee2485ce593ab9ec138bee05d5dd399 59808 kmod_9-3_i386.deb
 dbd6c119ba4aaf6b1fa73d5bec1b96d65bdad063 1796 module-init-tools_9-3_all.deb
 4c08a00af3b2ed9cc023be59bef172b055b2119f 50272 libkmod2_9-3_i386.deb
 c17a679d7356eefa817985acfefd9ed0938e4446 61662 libkmod-dev_9-3_i386.deb
 b40e0fe70bf219d4e94434ec0ca190a94483a580 44948 libkmod2-udeb_9-3_i386.udeb
Checksums-Sha256: 
 29a07475e4bae028658b8c9755f8f48b6689be8eb4d263fcbfda589f95a09e7c 1175 kmod_9-3.dsc
 fbdc378d3e768fbfea53ce3291d7fd685428ce90df2dfc78c1e7a28fe500738a 11865 kmod_9-3.debian.tar.gz
 270fd30f29fa7d23584f6090800d72c622ca1f7c2970a11582e5dc6aa590e1ea 59808 kmod_9-3_i386.deb
 9750139fc6bd1d2e373993e20a74d68221c00243a9754acbf24a1f755a3f8ad8 1796 module-init-tools_9-3_all.deb
 0f1b7d9f76c01bc3a1c522f0344f5cb3d18b5319b3b4db4271f027f6d79f2b0a 50272 libkmod2_9-3_i386.deb
 b7a417abeb6a1010f157b9f4ec1bb189e41deff5e7ab6cce523de1b8bc423bc1 61662 libkmod-dev_9-3_i386.deb
 4560875773fc77e05d642b956a058aca835ed30cbd64c446b23aa2416833f1ba 44948 libkmod2-udeb_9-3_i386.udeb
Files: 
 2b470d376e64ed4994a0941ea5cb7b88 1175 admin important kmod_9-3.dsc
 01307447ce082b883e3ce1383d344eec 11865 admin important kmod_9-3.debian.tar.gz
 7b6ebf629060fcc9aea85688df562a56 59808 admin important kmod_9-3_i386.deb
 4f49f79ebbca80c0629daba26e762cd2 1796 admin extra module-init-tools_9-3_all.deb
 3b334ddf39bda167366c54fee6417b75 50272 libs important libkmod2_9-3_i386.deb
 cf8df7cec0e6b837dcae0e1198a6a57d 61662 libdevel optional libkmod-dev_9-3_i386.deb
 696a46df0aeb93967b7504a2da5bfc20 44948 debian-installer important libkmod2-udeb_9-3_i386.udeb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlFho8sACgkQFGfw2OHuP7Hc7gCfUa6XwwPCyvH88bm8eU88XyXy
gdAAoJ5ih98tNFaVvUeoZj5ljFwdRBjK
=Qq69
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Mon, 27 May 2013 07:33:03 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 09:05:45 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.