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: <20070810153728.7cf99fc1@gondolin.boeblingen.de.ibm.com>
Date:	Fri, 10 Aug 2007 15:37:28 +0200
From:	Cornelia Huck <cornelia.huck@...ibm.com>
To:	Pavel Emelyanov <xemul@...nvz.org>
Cc:	Kay Sievers <kay.sievers@...y.org>, Greg KH <gregkh@...e.de>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...l.org>, devel@...nvz.org
Subject: Re: [PATCH] Fix OOPS in show_uevent()

On Fri, 10 Aug 2007 17:21:51 +0400,
Pavel Emelyanov <xemul@...nvz.org> wrote:

> Cornelia Huck wrote:
> > On Fri, 10 Aug 2007 14:23:56 +0200,
> > "Kay Sievers" <kay.sievers@...y.org> wrote:
> > 
> >> 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.
> 
> isn't it better to change
>     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,
>                                  char **buffer);
> and alter the buffer pointer inside?

But the function wants to know the buffer_size, doesn't it?
(And the caller can make the adjustments easily; it saves duplicated
code.)
-
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