Re: [patch 03/26] sysfs: zero terminate sysfs write buffers (CVE-2006-1055)
[Posted April 5, 2006 by corbet]
| From: |
| Al Viro <viro-AT-ftp.linux.org.uk> |
| To: |
| Jon Smirl <jonsmirl-AT-gmail.com> |
| Subject: |
| Re: [patch 03/26] sysfs: zero terminate sysfs write buffers (CVE-2006-1055) |
| Date: |
| Wed, 5 Apr 2006 18:02:26 +0100 |
| Cc: |
| gregkh-AT-suse.de, linux-kernel-AT-vger.kernel.org, stable-AT-kernel.org |
On Wed, Apr 05, 2006 at 12:34:49PM -0400, Jon Smirl wrote:
> On 4/5/06, Al Viro <viro@ftp.linux.org.uk> wrote:
> > On Wed, Apr 05, 2006 at 07:09:28PM +0400, Sergey Vlasov wrote:
> > > This will break the "color_map" sysfs file for framebuffers -
> > > drivers/video/fbsysfs.c:store_cmap() expects to get exactly 4096 bytes
> > > for a colormap with 256 entries. In fact, the original patch which
> > > changed PAGE_SIZE - 1 to PAGE_SIZE:
> >
> > ... cheerfully assuming that nobody assumes NUL-termination and
> > everyone (sysfs patch writers!) certainly uses the length argument.
> > Fscking brilliant, that.
>
> Why does sysfs have two string length determination methods - both
> NULL termination and a length parameter. It should be one or the
> other, not both. Having both simply cause problems when some
> developers implement one scheme and others only implement the other.
Which part of "sysfs patches can be written by idiots and usually are"
is too hard to understand? Oh, wait. I see... Well, nevermind, then...