mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Kay Sievers" <kay.sievers@vrfy.org>
To: "Pavel Emelyanov" <xemul@openvz.org>
Cc: "Greg KH" <gregkh@suse.de>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Andrew Morton" <akpm@osdl.org>,
	devel@openvz.org
Subject: Re: [PATCH] Fix OOPS in show_uevent()
Date: Fri, 10 Aug 2007 14:23:56 +0200	[thread overview]
Message-ID: <3ae72650708100523w45b4d5cbxf0ffbdc11cfb5e45@mail.gmail.com> (raw)
In-Reply-To: <46BC3A57.5070404@openvz.org>

On 8/10/07, Pavel Emelyanov <xemul@openvz.org> wrote:
> The platform_uevent() callback called via
>   show_uevent()
>   dev_uevent()
>   platform_uevent()
> forgot to set NULL to the last envp pointer and this caused the
> show_uevent() oops while printing all the envp pointers like this:

> The last hunk in this patch fixes this.

Looks like the right fix, yes.

> The other problem is that the envp passed to bus, type and platform callbacks
> from dev_uevent() is the same, so the callbacks can overwrite the info, written
> by the others. Did I miss something important?

Sounds like a bug, yes.

But we still don't update the remaining buffer size and the remaining
array fields which are left after the call. Shouldn't we instead just
change the:
   int (*dev_uevent)(struct device *dev,
                                char **envp, int num_envp,
                                char *buffer, int buffer_size);
to:
  int (*dev_uevent)(struct device *dev,
                               char **envp, int num_envp, int *cur_index,
                               char *buffer, int buffer_size, int *cur_len);

like we do for:
  int add_uevent_var(char **envp, int num_envp, int *cur_index,
                                  char *buffer, int buffer_size, int *cur_len,
                                  const char *format, ...)

and along with the change of the callers, we would update the values
properly, so the next call has the correct numbers? There are 6
classes and something like 12 buses using this method, so it shouldn't
be too much trouble.

Thanks,
Kay

  parent reply	other threads:[~2007-08-10 12:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-10 10:13 Pavel Emelyanov
2007-08-10 12:09 ` Cornelia Huck
2007-08-10 12:23 ` Kay Sievers [this message]
2007-08-10 12:39   ` Cornelia Huck
2007-08-10 13:21     ` Pavel Emelyanov
2007-08-10 13:37       ` Cornelia Huck

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=3ae72650708100523w45b4d5cbxf0ffbdc11cfb5e45@mail.gmail.com \
    --to=kay.sievers@vrfy.org \
    --cc=akpm@osdl.org \
    --cc=devel@openvz.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xemul@openvz.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

all inboxes | Powered by JetHome®