linux-uconsole/fs/fat
Nikolaus Schulz 46049d3840 fat: fix buffer overflow in vfat_create_shortname()
commit 30d1872d9e upstream.

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>
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-26 07:41:13 -07:00
..
cache.c FAT: add 'errors' mount option 2009-06-04 02:34:51 +09:00
dir.c headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
fat.h fat: Check s_dirt in fat_sync_fs() 2009-09-20 01:35:25 +09:00
fatent.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/hirofumi/fatfs-2.6 2009-06-16 11:29:44 -07:00
file.c fat: Opencode sync_page_range_nolock() 2009-09-14 17:08:17 +02:00
inode.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/hirofumi/fatfs-2.6 2009-09-30 09:31:14 -07:00
Kconfig vfat: Note the NLS requirement 2009-04-17 09:32:11 -07:00
Makefile fat: move fs/vfat/* and fs/msdos/* to fs/fat 2008-11-06 15:41:20 -08:00
misc.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/hirofumi/fatfs-2.6 2009-09-30 09:31:14 -07:00
namei_msdos.c headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
namei_vfat.c fat: fix buffer overflow in vfat_create_shortname() 2010-04-26 07:41:13 -07:00