]> git.baikalelectronics.ru Git - kernel.git/commit
fat: fix fat_ra_init() for data clusters == 0
authorOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Wed, 12 Aug 2020 01:36:01 +0000 (18:36 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 12 Aug 2020 17:58:01 +0000 (10:58 -0700)
commitcfa8dd13b8a22b3f441764c2bf5a7306fad85de5
tree28512bf55a2f7984d183e4738b974d1fc7414ba1
parent655bbcc3a2905b442e80eef9d5f90956dfcdf485
fat: fix fat_ra_init() for data clusters == 0

If data clusters == 0, fat_ra_init() calls the ->ent_blocknr() for the
cluster beyond ->max_clusters.

This checks the limit before initialization to suppress the warning.

Reported-by: syzbot+756199124937b31a9b7e@syzkaller.appspotmail.com
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/87mu462sv4.fsf@mail.parknet.co.jp
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/fat/fatent.c