lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <OFB8E1FABA.52FC2AD3-ONC125756D.002F300A-C125756D.002F7086@de.ibm.com>
Date:	Mon, 2 Mar 2009 09:38:09 +0100
From:	Christof Schmitt <christof.schmitt@...ibm.com>
To:	Rusty Russell <rusty@...tcorp.com.au>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: Command line parameter not passed to module in linux-next

Rusty Russell <rusty@...tcorp.com.au> wrote on 03/02/2009 01:45:23 AM:

> On Saturday 28 February 2009 03:31:05 Christof Schmitt wrote:
> > The linux-next kernel does not pass charp parameters from the kernel
> > command line to modules:
> > 
> > # cat /proc/cmdline 
> > dasd=4d70-4d73 root=/dev/dasdc1 zfcp.device=0.0.181d,
> 0x500507630310c562,0x401040C300000000 zfcp.dbfsize=4096  BOOT_IMAGE=0 
> > 
> > # cat /sys/module/zfcp/parameters/device 
> > <NULL>
> 
> Thanks:
> 
> param: fix charp parameters set via sysfs: FIX
> 
> We can't kmalloc at early cmdline parsing.
> 
> Reported-by: Christof Schmitt <christof.schmitt@...ibm.com>
> Signed-off-by: Rusty Russell <rusty@...tcorp.com.au>
> 
> diff --git a/kernel/params.c b/kernel/params.c
> --- a/kernel/params.c
> +++ b/kernel/params.c
> @@ -223,10 +223,16 @@ int param_set_charp(const char *val, str
>     if (kp->perm & KPARAM_KMALLOCED)
>        kfree(*(char **)kp->arg);
> 
> -   kp->perm |= KPARAM_KMALLOCED;
> -   *(char **)kp->arg = kstrdup(val, GFP_KERNEL);
> -   if (!kp->arg)
> -      return -ENOMEM;
> +   /* This is a hack.  We can't need to strdup in early boot, and we
> +    * don't need to; this mangled commandline is preserved. */
> +   if (slab_is_available()) {
> +      kp->perm |= KPARAM_KMALLOCED;
> +      *(char **)kp->arg = kstrdup(val, GFP_KERNEL);
> +      if (!kp->arg)
> +         return -ENOMEM;
> +   } else
> +      *(const char **)kp->arg = val;
> +
>     return 0;
>  }

Thanks, the patch works for me.
Tested-by: Christof Schmitt <christof.schmitt@...ibm.com>

--
Christof Schmitt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ