Re: [PATCH] fs/erofs: fix an integer overflow in symlink resolution

2025-02-12 Thread Jonathan Bar Or
Got it, looks good. Jonathan On Wed, Feb 12, 2025, 7:33 AM Gao Xiang wrote: > > > On 2025/2/12 22:17, Jonathan Bar Or wrote: > > This is good, but may I suggest using __builtin_add_overflow instead? > > They are just the same. > > erofs-utils follows the kernel style, mostly the kernel doesn't

Re: [PATCH] fs/erofs: fix an integer overflow in symlink resolution

2025-02-12 Thread Gao Xiang
On 2025/2/12 22:17, Jonathan Bar Or wrote: This is good, but may I suggest using __builtin_add_overflow instead? They are just the same. erofs-utils follows the kernel style, mostly the kernel doesn't directly use __builtin_add_overflow, instead it has a wrapper check_add_overflow(). I cou

Re: [PATCH] fs/erofs: fix an integer overflow in symlink resolution

2025-02-12 Thread Jonathan Bar Or
This is good, but may I suggest using __builtin_add_overflow instead? Jonathan On Wed, Feb 12, 2025, 1:31 AM Gao Xiang wrote: > See the original report [1], otherwise len + 1 will be overflowed. > > Note that EROFS archive can record arbitary symlink sizes in principle, > so we don't assume a s