From: Andrey Borzenkov <arvidjaar@mail.ru>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] fix buffer overflow in util_run_program()
Date: Sat, 05 Sep 2009 19:07:09 +0000 [thread overview]
Message-ID: <200909052307.09815.arvidjaar@mail.ru> (raw)
In-Reply-To: <20090904195414.GS4363@florz.florz.dyndns.org>
[-- Attachment #1: Type: Text/Plain, Size: 1532 bytes --]
On Saturday 05 of September 2009 22:41:27 Alan Jenkins wrote:
> On 9/5/09, Florian Zumbiehl <florz@florz.de> wrote:
> > Hi,
> >
> >> > Now, what am I missing? I obviously do not understand much of
> >> > how udev works, but if the code of this function is not somewhat
> >> > pointless, then how would there not be a potential buffer
> >> > overflow?
> >> >
> >> > Florian
> >>
> >> Running "ls -l" (two spaces) should be equivalent to "ls -l" (one
> >> space). arg filled with spaces should be more or less equivalent
> >> to arg = "". If it's not - then that's the real bug.
> >
> > well, I don't want to get into fixing semantic bugs, as there
> > generally doesn't seem to be much of a hint as to what the intended
> > semantics are - except that you wonder how the code's semantics
> > could actually be intentional. So I would suggest fixing the buffer
> > overflow for now, until someone feels like taking care of the
> > semantic bug.
>
> My point was that I don't see any such semantic bug; I can't see
> where the overflow would come from.
>
> As far as I can see, the code uses strsep() which will correctly
> interpret a string of spaces as containing no tokens - and return
> NULL.
>
> If I'm right, there's a different semantic bug - the use of strsep()
> to find a closing quote, which will fail for strings like
>
> ' a '' b '
>
If this is assumed to be two arguments ' a ' and ' b ', this function
works correctly. What is really not possible, is to quote the quote.
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2009-09-05 19:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-04 19:54 [PATCH] fix buffer overflow in util_run_program() Florian Zumbiehl
2009-09-05 3:29 ` Andrey Borzenkov
2009-09-05 4:25 ` Florian Zumbiehl
2009-09-05 4:34 ` Andrey Borzenkov
2009-09-05 4:49 ` Florian Zumbiehl
2009-09-05 10:50 ` Alan Jenkins
2009-09-05 17:21 ` Florian Zumbiehl
2009-09-05 18:41 ` Alan Jenkins
2009-09-05 19:07 ` Andrey Borzenkov [this message]
2009-09-05 20:39 ` Florian Zumbiehl
2009-09-06 16:34 ` Kay Sievers
2009-09-07 18:18 ` [PATCH] fix buffer overflow in util_run_program(), #2 Florian Zumbiehl
2009-09-08 19:43 ` Kay Sievers
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=200909052307.09815.arvidjaar@mail.ru \
--to=arvidjaar@mail.ru \
--cc=linux-hotplug@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.