bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/4] Fix /proc/*/cmdline.


From: Jeremie Koenig
Subject: Re: [PATCH 1/4] Fix /proc/*/cmdline.
Date: Wed, 18 Aug 2010 17:48:28 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

Hi Samuel, thanks for the review.

On Wed, Aug 18, 2010 at 01:22:03AM +0200, Samuel Thibault wrote:
> Jeremie Koenig, le Fri 13 Aug 2010 19:05:12 +0200, a écrit :
> > On Linux, /proc/NNNN/cmdline is a NUL-separated list of arguments.
> > We used to truncate after the first one and add some whitespace.
> 
> You can now drop the cmdline_data variable.

Oh, right. Somehow I didn't see the warning :-P

> > +    {
> > +      memcpy (data, ps->args, ps->args_len);
> > +      *len = ps->args_len;
> > +    }
> 
> Mmm, isn't there a potential `data' buffer overflow?  I guess *len
> contains the size of the `data' buffer and should be taken into account?

Yes. I think this also applies to the other procfs_read_*_file() functions.
Also, 'offset' is completely ignored.

I'm working on a major rewrite of procfs right now, which should fix
these problems.

-- 
Jeremie Koenig <address@hidden>
http://jk.fr.eu.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]