linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: Jiri Slaby <jirislaby@kernel.org>
Cc: linux-modules@vger.kernel.org
Subject: Re: libkmod mishandles parameters re-quoted by grub2
Date: Fri, 12 Feb 2021 01:42:23 -0800	[thread overview]
Message-ID: <20210212094223.yxxnnswhqhczk5an@ldmartin-desk1> (raw)
In-Reply-To: <70f1ef6c-d016-de57-82a8-db9d9cc414ef@kernel.org>

On Mon, Jan 25, 2021 at 09:49:13AM +0100, Jiri Slaby wrote:
>Hi,
>
>when one passes to the kernel a module parameter from grub2 such as:
>  parport.dyndbg="file drivers/parport/ieee1284_ops.c +mpf"
>the kernel receives:
>  "parport.dyndbg=file drivers/parport/ieee1284_ops.c +mpf"
>as grub2 handles quotes this way. It may be a bug in grub2, it was 
>even tried to be fixed, but there is no all-cases-working fix yet:
>  https://bugzilla.suse.com/show_bug.cgi?id=1181111#c10
>
>The kernel parses the parameter correctly, though:
>  parse_one: doing dyndbg params: parport.dyndbg='file 
>drivers/parport/ieee1284_ops.c +mpf'
>
>But libkmod doesn't. When parport is modprobe-d, this parameter is not 
>passed to it.
>
>kmod_config_parse_kcmdline ignores the parameter as:
>  if (is_quoted) {
>    /* don't consider a module until closing quotes */
>
>I am not sure how to fix this, can someone look into it and make the 
>parser similar to kernel's?

We have to ignore ill-formed kernel cmdline and that makes it harder.

I threw out the current implementation and rewrote it into a state
machine. It passes the tests, but it's unfortunate we have to do this,
particularly because we have to re-quote it the "right way" to pass back
to kernel, unmangling it.

I will share the patch shortly.

Lucas De Marchi
>
>thanks,
>-- 
>js
>suse labs

      parent reply	other threads:[~2021-02-12  9:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-25  8:49 libkmod mishandles parameters re-quoted by grub2 Jiri Slaby
2021-01-28  4:05 ` Lucas De Marchi
2021-02-12  9:42 ` Lucas De Marchi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210212094223.yxxnnswhqhczk5an@ldmartin-desk1 \
    --to=lucas.demarchi@intel.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-modules@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).