linux-uconsole/fs/sysfs
Geert Uytterhoeven e17ce2ec38 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>
2012-10-31 09:51:35 -07:00
..
bin.c sysfs: only access bin file vm_ops with the active lock 2010-10-22 10:16:43 -07:00
dir.c sysfs: sysfs_pathname/sysfs_add_one: Use strlcat() instead of strcat() 2012-10-31 09:51:35 -07:00
file.c sysfs: remove "last sysfs file:" line from the oops messages 2011-05-13 16:05:51 -07:00
group.c SYSFS: Fix erroneous comments for sysfs_update_group(). 2011-05-10 14:22:00 -07:00
inode.c sysfs: Fix memory leak in sysfs_sd_setsecdata(). 2012-04-02 09:26:53 -07:00
Kconfig kconfig: rename CONFIG_EMBEDDED to CONFIG_EXPERT 2011-01-20 17:02:05 -08:00
Makefile
mount.c Delay struct net freeing while there's a sysfs instance refering to it 2011-06-12 17:45:41 -04:00
symlink.c sysfs: allow creating symlinks from untagged to tagged directories 2010-07-26 12:02:41 -07:00
sysfs.h Delay struct net freeing while there's a sysfs instance refering to it 2011-06-12 17:45:41 -04:00