kernel-hacking-2024-linux-s.../fs/fat
Nikolaus Schulz 30d1872d9e fat: fix buffer overflow in vfat_create_shortname()
When using the string representation of a random counter as part of the base
name, ensure that it is no longer than 4 bytes.

Since we are repeatedly decrementing the counter in a loop until we have found a
unique base name, the counter may wrap around zero; therefore, it is not enough
to mask its higher bits before entering the loop, this must be done inside the
loop.

[hirofumi@mail.parknet.co.jp: use snprintf()]
Signed-off-by: Nikolaus Schulz <microschulz@web.de>
Cc: stable@kernel.org
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-03-31 10:34:11 -07:00
..
cache.c
dir.c
fat.h
fatent.c
file.c
inode.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/hirofumi/fatfs-2.6 2010-03-12 16:35:21 -08:00
Kconfig
Makefile
misc.c
namei_msdos.c
namei_vfat.c fat: fix buffer overflow in vfat_create_shortname() 2010-03-31 10:34:11 -07:00