android_kernel_google_msm/fs/sysfs
Geert Uytterhoeven fa3b39b05f 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 10:02:57 -07:00
..
bin.c
dir.c sysfs: sysfs_pathname/sysfs_add_one: Use strlcat() instead of strcat() 2012-10-31 10:02:57 -07:00
file.c sysfs: Complain bitterly about attempts to remove files from nonexistent directories. 2012-01-24 12:12:32 -08:00
group.c sysfs: Prevent crash on unset sysfs group attributes 2012-04-10 14:48:51 -07:00
inode.c Revert "sysfs: Kill nlink counting." 2012-03-08 13:03:10 -08:00
Kconfig
Makefile
mount.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2012-03-21 13:36:41 -07:00
symlink.c
sysfs.h Revert "sysfs: Kill nlink counting." 2012-03-08 13:03:10 -08:00