mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
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:09:36 +0200	[thread overview]
Message-ID: <20070810140936.55f297b5@gondolin.boeblingen.de.ibm.com> (raw)
In-Reply-To: <46BC3A57.5070404@openvz.org>

On Fri, 10 Aug 2007 14:13:43 +0400,
Pavel Emelyanov <xemul@openvz.org> wrote:

> The last hunk in this patch fixes this.

Looks sane.

> 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?

I don't think so. 

> 
> This is for 2.6.23-rc2-mm1
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
> 
> ---
> 
> --- ./drivers/base/core.c.ubug	2007-08-10 14:07:26.000000000 +0400
> +++ ./drivers/base/core.c	2007-08-10 14:07:15.000000000 +0400
> @@ -222,6 +222,11 @@ static int dev_uevent(struct kset *kset,
>  		if (retval)
>  			pr_debug ("%s: bus uevent() returned %d\n",
>  				  __FUNCTION__, retval);
> +
> +		while (*envp != NULL) {
> +			envp++;
> +			num_envp--;
> +		}

Hm, we may also want to adjust the remaining buffer size here, but only
the ->uevent() method has that knowledge...

>  	}
> 
>  	if (dev->class && dev->class->dev_uevent) {
> @@ -230,6 +235,11 @@ static int dev_uevent(struct kset *kset,
>  		if (retval)
>  			pr_debug("%s: class uevent() returned %d\n",
>  				 __FUNCTION__, retval);
> +
> +		while (*envp != NULL) {
> +			envp++;
> +			num_envp--;
> +		}
>  	}
> 
>  	if (dev->type && dev->type->uevent) {
> @@ -238,6 +248,11 @@ static int dev_uevent(struct kset *kset,
>  		if (retval)
>  			pr_debug("%s: dev_type uevent() returned %d\n",
>  				 __FUNCTION__, retval);
> +
> +		while (*envp != NULL) {
> +			envp++;
> +			num_envp--;
> +		}
>  	}
> 
>  	return retval;
> --- ./drivers/base/platform.c.ubug	2007-08-10 14:07:44.000000000 +0400
> +++ ./drivers/base/platform.c	2007-08-10 13:58:55.000000000 +0400
> @@ -547,6 +547,7 @@ static int platform_uevent(struct device
> 
>  	envp[0] = buffer;
>  	snprintf(buffer, buffer_size, "MODALIAS=%s", pdev->name);
> +	envp[1] = NULL;
>  	return 0;
>  }
> 

  reply	other threads:[~2007-08-10 12:09 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 [this message]
2007-08-10 12:23 ` Kay Sievers
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=20070810140936.55f297b5@gondolin.boeblingen.de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --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®