Re: [PATCH] erofs: fix potential overflow calculating xattr_isize

From: Chao Yu
Date: Sun Apr 16 2023 - 10:47:08 EST


On 2023/4/14 14:18, Jingbo Xu wrote:
Given on-disk i_xattr_icount is 16 bits and xattr_isize is calculated
from i_xattr_icount multiplying 4, xattr_isize has a theoretical maximum
of 256K (64K * 4).

Thus declare xattr_isize as unsigned int to avoid the potential overflow.

Fixes: bfb8674dc044 ("staging: erofs: add erofs in-memory stuffs")
Signed-off-by: Jingbo Xu <jefflexu@xxxxxxxxxxxxxxxxx>

Good catch!

Reviewed-by: Chao Yu <chao@xxxxxxxxxx>

Thanks,