]> git.baikalelectronics.ru Git - kernel.git/commit
quota: check block number when reading the block in quota file
authorZhang Yi <yi.zhang@huawei.com>
Fri, 8 Oct 2021 09:38:20 +0000 (17:38 +0800)
committerJan Kara <jack@suse.cz>
Mon, 11 Oct 2021 08:55:47 +0000 (10:55 +0200)
commitf4f864992f1c4f2260bc285146b33d81e30beb88
tree2f3f6e8e8fa3d5fe79e092c152b3fedff25d259a
parent60648e158363166a3a7d3e261a02a19022ea3024
quota: check block number when reading the block in quota file

The block number in the quota tree on disk should be smaller than the
v2_disk_dqinfo.dqi_blocks. If the quota file was corrupted, we may be
allocating an 'allocated' block and that would lead to a loop in a tree,
which will probably trigger oops later. This patch adds a check for the
block number in the quota tree to prevent such potential issue.

Link: https://lore.kernel.org/r/20211008093821.1001186-2-yi.zhang@huawei.com
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Cc: stable@kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
fs/quota/quota_tree.c