linux-stable/fs/sysfs
Geert Uytterhoeven 59deaa364a sysfs: sysfs_pathname/sysfs_add_one: Use strlcat() instead of strcat()
commit 66081a7251 upstream.

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.

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.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
2013-06-10 11:43:08 +02:00
..
bin.c const: mark struct vm_struct_operations 2009-09-27 11:39:25 -07:00
dir.c sysfs: sysfs_pathname/sysfs_add_one: Use strlcat() instead of strcat() 2013-06-10 11:43:08 +02:00
file.c sysfs: checking for NULL instead of ERR_PTR 2010-09-20 13:17:50 -07:00
group.c Use WARN() in fs/sysfs 2008-07-26 12:00:07 -07:00
inode.c sysfs: sysfs_sd_setattr set iattrs unconditionally 2010-02-23 07:37:56 -08:00
Kconfig fs/Kconfig: move sysfs out 2009-01-22 13:15:56 +03:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mount.c sysfs: reference sysfs_dirent from sysfs inodes 2009-03-24 16:38:25 -07:00
symlink.c sysfs: Add labeling support for sysfs 2009-09-10 10:11:29 +10:00
sysfs.h sysfs: Add labeling support for sysfs 2009-09-10 10:11:29 +10:00