[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20121001235152.GC15924@kroah.com>
Date: Mon, 1 Oct 2012 16:51:52 -0700
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Alex Williamson <alex.williamson@...com>,
Alex Chiang <achiang@...com>, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH] sysfs: sysfs_pathname/sysfs_add_one: Use strlcat()
instead of strcat()
On Sun, Sep 30, 2012 at 08:59:05PM +0200, Geert Uytterhoeven wrote:
> Hi Greg,
>
> On Sun, Sep 30, 2012 at 4:49 PM, Greg Kroah-Hartman
> <gregkh@...uxfoundation.org> wrote:
> > On Sat, Sep 29, 2012 at 10:23:19PM +0200, Geert Uytterhoeven wrote:
> >> The warning check for duplicate sysfs entries can cause a buffer overflow
> >> when printing the warning, as strcat() doesn't check buffer sizes.
> >> Use strlcat() instead.
> >
> > As the comment said, we knew about this, but I have never seen it, do
> > you know of a way to trigger it?
>
> I expected there would be a check somewhere else in the code, so we can
> never overflow here. But I did manage to overflow the buffer by having a real
> long name (4060 characters) in a conflicting mfd_cell.
> There may be other ways.
>
> I don't know how likely it is to trigger in a real world scenario. Is
> there a limit
> on the depth of sysfs? Or can it go unbounded, e.g. by cascading USB hubs?
You can only go so deep with USB hubs (5 I think.)
> >> Cc: stable@...r.kernel.org
> >
> > Given that I don't know of any way to actually hit this problem, is it
> > really needed for older kernel releases?
>
> That's up to you to decide...
Ok, I'll queue this up after 3.7-rc1 is out, thanks.
greg k-h
--
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