quota: Don't overflow quota file offsets
authorJan Kara <jack@suse.cz>
Mon, 2 Nov 2020 15:32:10 +0000 (16:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Jan 2021 13:56:53 +0000 (14:56 +0100)
commit26058c397b9f67708d9d8b9207ab005da627c665
tree4bea3a7b2573462c35ecef598c38f8164aa6c81e
parentbb2ab902f6f0ff0be64c3d81a39795c54c8c45f3
quota: Don't overflow quota file offsets

[ Upstream commit 10f04d40a9fa29785206c619f80d8beedb778837 ]

The on-disk quota format supports quota files with upto 2^32 blocks. Be
careful when computing quota file offsets in the quota files from block
numbers as they can overflow 32-bit types. Since quota files larger than
4GB would require ~26 millions of quota users, this is mostly a
theoretical concern now but better be careful, fuzzers would find the
problem sooner or later anyway...

Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/quota/quota_tree.c