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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120930144930.GA27329@kroah.com>
Date:	Sun, 30 Sep 2012 07:49:30 -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 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?

> Since strlcat() doesn't return a pointer to the passed buffer, unlike
> strcat(), I had to convert the nested concatenation in sysfs_add_one() to
> an admittedly more obscure comma operator construct, to avoid emitting code
> for the concatenation if CONFIG_BUG is disabled.

That's a fun construct, nice work.

> Signed-off-by: Geert Uytterhoeven <geert@...ux-m68k.org>
> 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?

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ