[syzbot] WARNING in __i2c_transfer

14 views
Skip to first unread message

syzbot

unread,
Mar 12, 2021, 2:47:18ā€ÆAM3/12/21
to linu...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com, w...@kernel.org
Hello,

syzbot found the following issue on:

HEAD commit: 28806e4d Merge tag 'media/v5.12-2' of git://git.kernel.org..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=11192342d00000
kernel config: https://syzkaller.appspot.com/x/.config?x=6bcf96204c1b8e77
dashboard link: https://syzkaller.appspot.com/bug?extid=ffb0b3ffa6cfbc7d7b3f
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1083223ad00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14345f0ad00000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+ffb0b3...@syzkaller.appspotmail.com

------------[ cut here ]------------
WARNING: CPU: 1 PID: 8406 at drivers/i2c/i2c-core-base.c:2021 __i2c_transfer+0xa87/0x17d0 drivers/i2c/i2c-core-base.c:2021
Modules linked in:
CPU: 0 PID: 8406 Comm: syz-executor613 Not tainted 5.12.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__i2c_transfer+0xa87/0x17d0 drivers/i2c/i2c-core-base.c:2021
Code: 0f 94 c7 31 ff 44 89 fe e8 96 ba c2 fb 45 84 ff 0f 84 b3 fc ff ff e8 d8 b3 c2 fb e8 b2 5a 4f fb e9 a4 fc ff ff e8 c9 b3 c2 fb <0f> 0b 41 bc ea ff ff ff e9 2b fd ff ff e8 b7 b3 c2 fb 44 89 ee bf
RSP: 0018:ffffc900018cfd48 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 0000000000000010 RCX: 0000000000000000
RDX: ffff88801e4e5340 RSI: ffffffff85b0ea97 RDI: 0000000000000003
RBP: ffff888020870b58 R08: 0000000000000000 R09: ffffffff8faa792f
R10: ffffffff85b0e048 R11: 1ffffffff1ed6964 R12: 0000000000000010
R13: 0000000000000000 R14: ffff888020870b78 R15: 0000000000000000
FS: 000000000226f300(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fcccc5096c0 CR3: 0000000012e13000 CR4: 0000000000350ef0
Call Trace:
i2c_transfer+0x1e6/0x3e0 drivers/i2c/i2c-core-base.c:2112
i2cdev_ioctl_rdwr+0x583/0x6a0 drivers/i2c/i2c-dev.c:297
i2cdev_ioctl+0x46c/0x780 drivers/i2c/i2c-dev.c:453
vfs_ioctl fs/ioctl.c:48 [inline]
__do_sys_ioctl fs/ioctl.c:753 [inline]
__se_sys_ioctl fs/ioctl.c:739 [inline]
__x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739
do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x443469
Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fffb0c53048 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000004004a0 RCX: 0000000000443469
RDX: 0000000020004480 RSI: 0000000000000707 RDI: 0000000000000003
RBP: 0000000000403010 R08: 00232d6332692f76 R09: 00000000004004a0
R10: 000000000000001f R11: 0000000000000246 R12: 00000000004030a0
R13: 0000000000000000 R14: 00000000004b1018 R15: 00000000004004a0


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

Wolfram Sang

unread,
Mar 12, 2021, 4:23:43ā€ÆAM3/12/21
to syzbot, linu...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On Thu, Mar 11, 2021 at 11:47:17PM -0800, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 28806e4d Merge tag 'media/v5.12-2' of git://git.kernel.org..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=11192342d00000
> kernel config: https://syzkaller.appspot.com/x/.config?x=6bcf96204c1b8e77
> dashboard link: https://syzkaller.appspot.com/bug?extid=ffb0b3ffa6cfbc7d7b3f
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1083223ad00000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14345f0ad00000
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+ffb0b3...@syzkaller.appspotmail.com
>
> ------------[ cut here ]------------
> WARNING: CPU: 1 PID: 8406 at drivers/i2c/i2c-core-base.c:2021 __i2c_transfer+0xa87/0x17d0 drivers/i2c/i2c-core-base.c:2021

Yes, it can be argued that userspace should not be able to trigger a
WARNING. For in-kernel users, the WARN is really helpful, though. I will
add sanity checks much earlier to i2c-dev.c which will not be that
noisy.

signature.asc

Wolfram Sang

unread,
Mar 12, 2021, 4:38:06ā€ÆAM3/12/21
to syzbot, syzkall...@googlegroups.com

Can I just say "#syz test" and it will test the attached patch on top of
the tree which was used when creating the bug report?

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

0001-i2c-bail-out-early-when-RDWR-parameters-are-wrong.patch
signature.asc

syzbot

unread,
Mar 12, 2021, 5:09:10ā€ÆAM3/12/21
to dwlsa...@gmail.com, linu...@vger.kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, mchehab...@kernel.org, mch...@kernel.org, paskr...@gmail.com, syzkall...@googlegroups.com, w...@kernel.org
syzbot has bisected this issue to:

commit f90cf6079bf67988f8b1ad1ade70fc89d0080905
Author: Daniel W. S. Almeida <dwlsa...@gmail.com>
Date: Fri Aug 21 12:58:47 2020 +0000

media: vidtv: add a bridge driver

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1136cf66d00000
start commit: 28806e4d Merge tag 'media/v5.12-2' of git://git.kernel.org..
git tree: upstream
final oops: https://syzkaller.appspot.com/x/report.txt?x=1336cf66d00000
console output: https://syzkaller.appspot.com/x/log.txt?x=1536cf66d00000
Reported-by: syzbot+ffb0b3...@syzkaller.appspotmail.com
Fixes: f90cf6079bf6 ("media: vidtv: add a bridge driver")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

syzbot

unread,
Mar 12, 2021, 5:54:06ā€ÆAM3/12/21
to paskr...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+ffb0b3...@syzkaller.appspotmail.com

Tested on:

commit: dc2b6170 i2c: fix warning in __i2c_transfer
git tree: https://linux.googlesource.com/linux/kernel/git/torvalds/linux refs/changes/77/9077/1
kernel config: https://syzkaller.appspot.com/x/.config?x=edd992d6afe4fd5e
dashboard link: https://syzkaller.appspot.com/bug?extid=ffb0b3ffa6cfbc7d7b3f
compiler:

Note: testing is done by a robot and is best-effort only.

Dmitry Vyukov

unread,
Mar 12, 2021, 6:05:46ā€ÆAM3/12/21
to Wolfram Sang, syzbot, syzkaller-bugs, paskr...@gmail.com
Hi Wolfram,

Yes, this is correct and it's running now as far as I can tell.

But FWIW +Pavel already tested a patch for this:
https://groups.google.com/g/syzkaller-bugs/c/VRRQsSWfjxE/m/Vc6SFtUyGgAJ
https://linux-review.googlesource.com/c/linux/kernel/git/torvalds/linux/+/9077

Consequence of stripping CC list...

Patch testing requests are always recorded on the dashboard:
https://syzkaller.appspot.com/bug?extid=ffb0b3ffa6cfbc7d7b3f
and on the syzkaller-bugs@ mailing list.

syzbot

unread,
Mar 12, 2021, 6:10:06ā€ÆAM3/12/21
to syzkall...@googlegroups.com, w...@kernel.org
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+ffb0b3...@syzkaller.appspotmail.com

Tested on:

commit: f78d76e7 Merge tag 'drm-fixes-2021-03-12-1' of git://anong..
git tree: upstream
patch: https://syzkaller.appspot.com/x/patch.diff?x=1551aab2d00000

Wolfram Sang

unread,
Mar 12, 2021, 6:46:43ā€ÆAM3/12/21
to syzbot, dwlsa...@gmail.com, linu...@vger.kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, mchehab...@kernel.org, mch...@kernel.org, paskr...@gmail.com, syzkall...@googlegroups.com
On Fri, Mar 12, 2021 at 02:09:08AM -0800, syzbot wrote:
> syzbot has bisected this issue to:
>
> commit f90cf6079bf67988f8b1ad1ade70fc89d0080905
> Author: Daniel W. S. Almeida <dwlsa...@gmail.com>
> Date: Fri Aug 21 12:58:47 2020 +0000
>
> media: vidtv: add a bridge driver

This is a false positive.

signature.asc

Wolfram Sang

unread,
Mar 12, 2021, 6:51:23ā€ÆAM3/12/21
to Dmitry Vyukov, syzbot, syzkaller-bugs, paskr...@gmail.com
Hi Dmitry,

long time no see! :)

> > Can I just say "#syz test" and it will test the attached patch on top of
> > the tree which was used when creating the bug report?

What about this, is this possible?

> Yes, this is correct and it's running now as far as I can tell.

Yep, I will send out the patch now.

> Patch testing requests are always recorded on the dashboard:
> https://syzkaller.appspot.com/bug?extid=ffb0b3ffa6cfbc7d7b3f
> and on the syzkaller-bugs@ mailing list.

Yeah, I saw Pavel's patch (which is incomplete BTW) on the dashboard,
but there were no clickable links provided. So, I didn't know how to
have a look. What should I have done?

Thanks for the bugreport!

Wolfram

signature.asc

Dmitry Vyukov

unread,
Mar 12, 2021, 7:04:53ā€ÆAM3/12/21
to Wolfram Sang, syzbot, syzkaller-bugs, paskr...@gmail.com, syzkaller
On Fri, Mar 12, 2021 at 12:51 PM Wolfram Sang <w...@kernel.org> wrote:
>
> Hi Dmitry,
>
> long time no see! :)
>
> > > Can I just say "#syz test" and it will test the attached patch on top of
> > > the tree which was used when creating the bug report?
>
> What about this, is this possible?

Requiring base tree/commit is intentional, generally a patch can't be
applied to a random code. Applying it to a random tree can result in
failure to apply or bugs introduced by automatic merging.

> > Yes, this is correct and it's running now as far as I can tell.
>
> Yep, I will send out the patch now.
>
> > Patch testing requests are always recorded on the dashboard:
> > https://syzkaller.appspot.com/bug?extid=ffb0b3ffa6cfbc7d7b3f
> > and on the syzkaller-bugs@ mailing list.
>
> Yeah, I saw Pavel's patch (which is incomplete BTW) on the dashboard,
> but there were no clickable links provided. So, I didn't know how to
> have a look. What should I have done?

Good point.

It was tested w/o an additional patch on a git tree that already
includes the fix:
The git repo/branch are visible on the dashboard, but only as a hint
in the "Repo" column:
https://syzkaller.appspot.com/bug?extid=ffb0b3ffa6cfbc7d7b3f
because initially this wasn't supported (users were supposed to attach
a patch always, so the tree wasn't that important).

I think we need to make that Repo column wider to include the whole repo/branch.





> Thanks for the bugreport!
>
> Wolfram
>
> --
> You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bug...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/20210312115118.GB13150%40ninjato.

Wolfram Sang

unread,
Mar 12, 2021, 7:11:42ā€ÆAM3/12/21
to Dmitry Vyukov, syzbot, syzkaller-bugs, paskr...@gmail.com, syzkaller

> Requiring base tree/commit is intentional, generally a patch can't be
> applied to a random code. Applying it to a random tree can result in
> failure to apply or bugs introduced by automatic merging.

Well, it is not entirely random, I'd think, because the bug report is
based on a specific commit which could be reused. But I trust your
experience that an explicit link is better.

> I think we need to make that Repo column wider to include the whole repo/branch.

It would be most convenient if that could be turned into a clickable
link. Manually fetching a branch just to have a look is more work.

signature.asc

Pavel Skripkin

unread,
Mar 12, 2021, 7:13:44ā€ÆAM3/12/21
to Wolfram Sang, Dmitry Vyukov, syzbot, syzkaller-bugs
Hi, Wolfram.

On Fri, 2021-03-12 at 12:51 +0100, Wolfram Sang wrote:
> Hi Dmitry,
>
> long time no see! :)
>
> > > Can I just say "#syz test" and it will test the attached patch on
> > > top of
> > > the tree which was used when creating the bug report?
>
> What about this, is this possible?
>
> > Yes, this is correct and it's running now as far as I can tell.
>
> Yep, I will send out the patch now.
>
> > Patch testing requests are always recorded on the dashboard:
> > https://syzkaller.appspot.com/bug?extid=ffb0b3ffa6cfbc7d7b3f
> > and on the syzkaller-bugs@ mailing list.
>
> Yeah, I saw Pavel's patch (which is incomplete BTW) on the dashboard,

I just fixed that zero size, which caused that warning. Of course, your
patch is better than mine :)

>
> but there were no clickable links provided. So, I didn't know how to
> have a look. What should I have done?
>
> Thanks for the bugreport!
>
> Wolfram
>
--
With regards,
Pavel Skripkin

Dmitry Vyukov

unread,
Mar 13, 2021, 1:59:13ā€ÆAM3/13/21
to Wolfram Sang, syzbot, syzkaller-bugs, paskr...@gmail.com, syzkaller

Wolfram Sang

unread,
Mar 13, 2021, 5:05:27ā€ÆAM3/13/21
to Dmitry Vyukov, syzbot, syzkaller-bugs, paskr...@gmail.com, syzkaller

> > It would be most convenient if that could be turned into a clickable
> > link. Manually fetching a branch just to have a look is more work.
>
> This is now implemented and deployed:
> https://github.com/google/syzkaller/commit/4a003785c5484e99127a20e069a5edddcb8c24d5
> you can now see links to the patch on the bug page:
> https://syzkaller.appspot.com/bug?extid=ffb0b3ffa6cfbc7d7b3f

Yes, perfect! Great, thank you :)

signature.asc
Reply all
Reply to author
Forward
0 new messages