From: Nikolaus Schulz Date: Wed, 31 Mar 2010 17:21:10 +0000 (+0900) Subject: fat: fix buffer overflow in vfat_create_shortname() X-Git-Tag: v2.6.34-rc4~92 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30d1872d9eb3663b4cf7bdebcbf5cd465674cced;p=pandora-kernel.git 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 Cc: stable@kernel.org Signed-off-by: OGAWA Hirofumi Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed