Commit c44b3c82 authored by sunshijie's avatar sunshijie Committed by ting wang
Browse files

UPSTREAM: erofs: fix potential overflow calculating xattr_isize



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: bfb8674d ("staging: erofs: add erofs in-memory stuffs")
Signed-off-by: default avatarJingbo Xu <jefflexu@linux.alibaba.com>
Reviewed-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Link: https://lore.kernel.org/r/20230414061810.6479-1-jefflexu@linux.alibaba.com


Signed-off-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
(cherry picked from commit 1b3567a1
    https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git

 dev)
Bug: 296824280
Bug: 301017317
Bug: 301378679

Change-Id: I43d88c7ebc3b320e226ab4d7bc6717432ef5ad82
Signed-off-by: default avatarsunshijie <sunshijie@xiaomi.corp-partner.google.com>
Signed-off-by: default avatarsunshijie <sunshijie@xiaomi.com>
parent 3791fd3e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment