[PATCH] ext4: check for corrupted xattr entry

0 views
Skip to first unread message

Tadeusz Struk

unread,
Sep 15, 2022, 4:34:37 PM9/15/22
to syzbot+70627c...@syzkaller.appspotmail.com, syzkaller-a...@googlegroups.com, tadeus...@linaro.org
#syz test: https://android.googlesource.com/kernel/common android12-5.10-lts

diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index 38531c5e16c6..6562fad27dde 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -1583,6 +1583,11 @@ static int ext4_xattr_set_entry(struct ext4_xattr_info *i,

/* Compute min_offs and last. */
last = s->first;
+ if (!last) {
+ ret = -EFSCORRUPTED;
+ goto out;
+ }
+
for (; !IS_LAST_ENTRY(last); last = next) {
next = EXT4_XATTR_NEXT(last);
if ((void *)next >= s->end) {
--
2.37.3

syzbot

unread,
Sep 15, 2022, 4:58:21 PM9/15/22
to syzkaller-a...@googlegroups.com, tadeus...@linaro.org
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
SYZFATAL: executor failed NUM times: failed to create temp dir: mkdir ./syzkaller-testdir4ADDR: structure needs cleaning

2022/09/15 20:56:49 SYZFATAL: executor failed 11 times: failed to create temp dir: mkdir ./syzkaller-testdir4163212148: structure needs cleaning


Tested on:

commit: 59390358 Merge 5.10.140 into android12-5.10-lts
git tree: android12-5.10-lts
console output: https://syzkaller.appspot.com/x/log.txt?x=112874cf080000
kernel config: https://syzkaller.appspot.com/x/.config?x=710ac82b1e8d5ed2
dashboard link: https://syzkaller.appspot.com/bug?extid=70627ce76b4994c2e0b4
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
patch: https://syzkaller.appspot.com/x/patch.diff?x=163ff7bf080000

Tadeusz Struk

unread,
Sep 15, 2022, 5:18:23 PM9/15/22
to syzbot+70627c...@syzkaller.appspotmail.com, syzkaller-a...@googlegroups.com, tadeus...@linaro.org

syzbot

unread,
Sep 15, 2022, 5:53:23 PM9/15/22
to syzkaller-a...@googlegroups.com, tadeus...@linaro.org
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
SYZFATAL: executor failed NUM times: failed to create temp dir: mkdir ./syzkaller-testdir3ADDR: structure needs cleaning

2022/09/15 21:52:15 SYZFATAL: executor failed 11 times: failed to create temp dir: mkdir ./syzkaller-testdir3081240551: structure needs cleaning


Tested on:

commit: 59390358 Merge 5.10.140 into android12-5.10-lts
git tree: android12-5.10-lts
console output: https://syzkaller.appspot.com/x/log.txt?x=14a7bd5d080000
kernel config: https://syzkaller.appspot.com/x/.config?x=710ac82b1e8d5ed2
dashboard link: https://syzkaller.appspot.com/bug?extid=70627ce76b4994c2e0b4
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
patch: https://syzkaller.appspot.com/x/patch.diff?x=10e19937080000

Reply all
Reply to author
Forward
0 new messages