Whamcloud - gitweb
e2fsck: check for xattr value size integer wraparound
authorTheodore Ts'o <tytso@mit.edu>
Mon, 6 Jun 2022 17:34:08 +0000 (13:34 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 6 Jun 2022 17:34:08 +0000 (13:34 -0400)
commitf0c405f8b7bdabaf07284f1b52ba42b551152229
treefbd6345ecff95a879d484cc973cb27ca32f2e078
parentd497224dfbfdc1313136488cd7fb196885d40dfb
e2fsck: check for xattr value size integer wraparound

When checking an extended attrbiute block for correctness, we check if
the starting offset plus the value size exceeds the end of the block.
However, we weren't checking if the size was too large, and if it is
so large that it triggers a wraparound when we added the starting
offset, we won't notice the problem.  Add the missing check.

Reported-by: Nils Bars <nils.bars@rub.de>
Reported-by: Moritz Schlögel <moritz.schloegel@rub.de>
Reported-by: Nico Schiller <nico.schiller@rub.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass1.c
lib/ext2fs/ext2_ext_attr.h