Message ID | 20211227151320.383972525@linuxfoundation.org |
---|---|
State | Superseded |
Headers | show |
Series | None | expand |
Hi! > From: Chao Yu <chao@kernel.org> > > commit 5598b24efaf4892741c798b425d543e4bed357a1 upstream. Not sure what went wrong here, but as far as I can tell, this patch is _not_ yet in upstream. git log: commit eec4df26e24e978e49ccf9bcf49ca0f2ccdaeffe Merge: e7c124bd0463 4eb1782eaa9f Author: Linus Torvalds <torvalds@linux-foundation.org> Date: Wed Dec 29 10:07:20 2021 -0800 pavel@amd:/data/l/clean-cg$ git show 5598b24efaf4892741c798b425d543e4bed357a1 fatal: bad object 5598b24efaf4892741c798b425d543e4bed357a1 Best regards, Pavel
--- a/fs/f2fs/xattr.c +++ b/fs/f2fs/xattr.c @@ -658,8 +658,15 @@ static int __f2fs_setxattr(struct inode } last = here; - while (!IS_XATTR_LAST_ENTRY(last)) + while (!IS_XATTR_LAST_ENTRY(last)) { + if ((void *)(last) + sizeof(__u32) > last_base_addr || + (void *)XATTR_NEXT_ENTRY(last) > last_base_addr) { + set_sbi_flag(F2FS_I_SB(inode), SBI_NEED_FSCK); + error = -EFSCORRUPTED; + goto exit; + } last = XATTR_NEXT_ENTRY(last); + } newsize = XATTR_ALIGN(sizeof(struct f2fs_xattr_entry) + len + size);