Re: [PATCH] erofs: reject inodes with negative i_size

From: Chao Yu
Date: Thu Sep 12 2024 - 05:09:09 EST


On 2024/9/12 16:35, Gao Xiang wrote:
Negative i_size is never supported, although crafted images with inodes
having negative i_size will not lead to security issues in our current
codebase:

The following image can verify this (gzip+base64 encoded):

H4sICCmk4mYAA3Rlc3QuaW1nAGNgGAWjYBSMVPDo4dcH3jP2aTED2TwMKgxMUHHNJY/SQDQX
LxcDIw3tZwXit44MDNpQ/n8gQJZ/vxjijosPuSyZ0DUDgQqcZoKzVYFsDShbHeh6PT29ktTi
Eqz2g/y2pBFiLxDMh4lhs5+W4TAKRsEoGAWjYBSMglEwCkYBPQAAS2DbowAQAAA=

Mark as bad inodes for such corrupted inodes explicitly.

Signed-off-by: Gao Xiang <hsiangkao@xxxxxxxxxxxxxxxxx>

Reviewed-by: Chao Yu <chao@xxxxxxxxxx>

Thanks,