Commit b0522303 authored by Yuezhang Mo's avatar Yuezhang Mo Committed by Namjae Jeon
Browse files

exfat: fix the infinite loop in exfat_find_last_cluster()



In exfat_find_last_cluster(), the cluster chain is traversed until
the EOF cluster. If the cluster chain includes a loop due to file
system corruption, the EOF cluster cannot be traversed, resulting
in an infinite loop.

If the number of clusters indicated by the file size is inconsistent
with the cluster chain length, exfat_find_last_cluster() will return
an error, so if this inconsistency is found, the traversal can be
aborted without traversing to the EOF cluster.

Reported-by: default avatar <syzbot+f7d147e6db52b1e09dba@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=f7d147e6db52b1e09dba


Tested-by: default avatar <syzbot+f7d147e6db52b1e09dba@syzkaller.appspotmail.com>
Fixes: 31023864 ("exfat: add fat entry operations")
Signed-off-by: default avatarYuezhang Mo <Yuezhang.Mo@sony.com>
Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
parent 1bb7ff42
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment