Netdev List
 help / color / mirror / Atom feed
From: Sabrina Dubroca <sd@queasysnail.net>
To: Eric Dumazet <edumazet@google.com>
Cc: syzbot <syzbot+f2f6312ad1b5a0bfe316@syzkaller.appspotmail.com>,
	davem@davemloft.net, horms@kernel.org, kuba@kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	pabeni@redhat.com, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [net?] WARNING in rtmsg_ifinfo_build_skb
Date: Sat, 15 Aug 2026 01:14:01 +0200	[thread overview]
Message-ID: <an-hOd_nV-xUqpUq@krikkit> (raw)
In-Reply-To: <CANn89iLye45x8mhXm5-rcttmCqjDKEEXR70o9jJeFy0kOp0zbQ@mail.gmail.com>

2026-08-14, 17:35:00 +0200, Eric Dumazet wrote:
> On Fri, Aug 14, 2026 at 5:33 PM syzbot
> <syzbot+f2f6312ad1b5a0bfe316@syzkaller.appspotmail.com> wrote:
> >
> > Hello,
> >
> > syzbot found the following issue on:
> >
> > HEAD commit:    02dc699f83d0 Merge tag 'kbuild-fixes-7.2-1' of git://git.k..
> > git tree:       upstream
> > console output: https://syzkaller.appspot.com/x/log.txt?x=17320db9580000
> > kernel config:  https://syzkaller.appspot.com/x/.config?x=145fa60d73086782
> > dashboard link: https://syzkaller.appspot.com/bug?extid=f2f6312ad1b5a0bfe316
> > compiler:       gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
> > syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=12d0e5b9580000
> > C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=16f9cc9e580000
> >
> > Downloadable assets:
> > disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-02dc699f.raw.xz
> > vmlinux: https://storage.googleapis.com/syzbot-assets/faf03a1fb300/vmlinux-02dc699f.xz
> > kernel image: https://storage.googleapis.com/syzbot-assets/a48e50ceca1d/bzImage-02dc699f.xz
> >
> > IMPORTANT: if you fix the issue, please add the following tag to the commit:
> > Reported-by: syzbot+f2f6312ad1b5a0bfe316@syzkaller.appspotmail.com
> >
> > ------------[ cut here ]------------
> > err == -EMSGSIZE
> > WARNING: net/core/rtnetlink.c:4538 at rtmsg_ifinfo_build_skb+0x1c1/0x260 net/core/rtnetlink.c:4538, CPU#1: syz.0.17/5924
> > Modules linked in:
> > CPU: 1 UID: 0 PID: 5924 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full)
> > Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
> > RIP: 0010:rtmsg_ifinfo_build_skb+0x1c1/0x260 net/core/rtnetlink.c:4538
> > Code: ea 03 0f b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 80 00 00 00 45 8b 76 08 e9 3c ff ff ff e8 40 d7 73 f8 90 <0f> 0b 90 ba 02 00 00 00 48 89 ee 31 ff bb a6 ff ff ff e8 d8 8f f0
> > RSP: 0018:ffffc90004266df0 EFLAGS: 00010293
> > RAX: 0000000000000000 RBX: 00000000ffffffa6 RCX: ffffffff89968a40
> > RDX: ffff888034e5a540 RSI: ffffffff89968aa0 RDI: ffff888034e5a540
> > RBP: ffff88803d24db80 R08: 0000000000000005 R09: 0000000000000000
> > R10: 00000000ffffffa6 R11: 0000000000000000 R12: 0000000000000002
> > R13: 0000000000000000 R14: 0000000000000000 R15: ffff8880578ce108
> > FS:  000055558858a500(0000) GS:ffff8880d5ed8000(0000) knlGS:0000000000000000
> > CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > CR2: 0000200000001140 CR3: 0000000036c7c000 CR4: 0000000000352ef0
> > Call Trace:
> >  <TASK>
> >  rtmsg_ifinfo_event net/core/rtnetlink.c:4566 [inline]
> >  rtmsg_ifinfo_event net/core/rtnetlink.c:4556 [inline]
> >  rtnetlink_event+0x137/0x1f0 net/core/rtnetlink.c:7136
> >  notifier_call_chain+0x99/0x3f0 kernel/notifier.c:85
> >  call_netdevice_notifiers_info+0xbe/0x110 net/core/dev.c:2250
> >  call_netdevice_notifiers_extack net/core/dev.c:2288 [inline]
> >  call_netdevice_notifiers net/core/dev.c:2302 [inline]
> >  netdev_features_change net/core/dev.c:1590 [inline]
> >  netdev_update_features net/core/dev.c:11108 [inline]
> >  netdev_update_features net/core/dev.c:11105 [inline]
> >  netif_disable_lro+0x3e9/0x660 net/core/dev.c:1831
> >  inetdev_init+0x371/0x570 net/ipv4/devinet.c:284
> >  inetdev_event+0x7fa/0x17f0 net/ipv4/devinet.c:1590
> >  notifier_call_chain+0x99/0x3f0 kernel/notifier.c:85
> >  call_netdevice_notifiers_info+0xbe/0x110 net/core/dev.c:2250
> >  call_netdevice_notifiers_extack net/core/dev.c:2288 [inline]
> >  call_netdevice_notifiers net/core/dev.c:2302 [inline]
> >  register_netdevice+0x1998/0x25a0 net/core/dev.c:11484
> >  macsec_newlink+0x4fb/0x1c50 drivers/net/macsec.c:4221
> >  rtnl_newlink_create net/core/rtnetlink.c:3913 [inline]
> >  __rtnl_newlink net/core/rtnetlink.c:4044 [inline]
> >  rtnl_newlink+0x1499/0x2380 net/core/rtnetlink.c:4159
> >  rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:7076
> >  netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2556
> >  netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
> >  netlink_unicast+0x585/0x850 net/netlink/af_netlink.c:1345
> >  netlink_sendmsg+0x8b0/0xda0 net/netlink/af_netlink.c:1900
> >  sock_sendmsg_nosec net/socket.c:775 [inline]
> >  __sock_sendmsg net/socket.c:790 [inline]
> >  ____sys_sendmsg+0xa4d/0xbe0 net/socket.c:2684
> >  ___sys_sendmsg+0x190/0x1e0 net/socket.c:2738
> >  __sys_sendmsg+0x160/0x210 net/socket.c:2770
> >  do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
> >  do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
> >  entry_SYSCALL_64_after_hwframe+0x77/0x7f
> > RIP: 0033:0x7fbf0c99e019
> > Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 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 e8 ff ff ff f7 d8 64 89 01 48
> > RSP: 002b:00007fffe9eca118 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
> > RAX: ffffffffffffffda RBX: 00007fbf0cc25fa0 RCX: 00007fbf0c99e019
> > RDX: 0000000000000000 RSI: 0000200000000280 RDI: 0000000000000005
> > RBP: 00007fbf0ca3500c R08: 0000000000000000 R09: 0000000000000000
> > R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
> > R13: 00007fbf0cc25fac R14: 00007fbf0cc25fa0 R15: 00007fbf0cc25fa0
> >  </TASK>
> >
> >
> > ---
> > 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 syzkaller@googlegroups.com.
> >
> > syzbot will keep track of this issue. See:
> > https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
> >
> > If the report is already addressed, let syzbot know by replying with:
> > #syz fix: exact-commit-title
> >
> > If you want syzbot to run the reproducer, reply with:
> > #syz test: git://repo/address.git branch-or-commit-hash
> > If you attach or paste a git patch, syzbot will apply it before testing.
> >
> > If you want to overwrite report's subsystems, reply with:
> > #syz set subsystems: new-subsystem
> > (See the list of subsystem names on the web dashboard)
> >
> > If the report is a duplicate of another one, reply with:
> > #syz dup: exact-subject-of-another-report
> >
> > If you want to undo deduplication, reply with:
> > #syz undup
> 
> #syz test
> 
> diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
> index ee0e2eb7dbc61c1affe4b0203337f2fdaeaa031c..0844f551d3be696bad72a8322fa4ea1bf9ccf105
> 100644
> --- a/drivers/net/macsec.c
> +++ b/drivers/net/macsec.c
> @@ -4402,7 +4402,7 @@ static int macsec_fill_info(struct sk_buff *skb,
>                 csid = secy->xpn ? MACSEC_CIPHER_ID_GCM_AES_XPN_256 :
> MACSEC_CIPHER_ID_GCM_AES_256;
>                 break;
>         default:
> -               goto nla_put_failure;
> +               return 0;
>         }

It's not possible to create a macsec device with a key length other
than those 2, but it's true that returning -EMSGSIZE in this case is
not correct (-EINVAL + DEBUG_NET_WARN_ON_ONCE I guess).

The real problem is that we register the netdev before private data
has been fully initialized (macsec_newlink calls register_netdevice,
then macsec_add_dev), so we end up reaching fill_info before key_len
has been set.

So I think we should run macsec_add_dev before registering (and maybe
move those allocs to ndo_init), and possibly macsec_changelink_common
too. Setting the sci was intentionally done late, so this bit should
stay where it is.

-- 
Sabrina

      parent reply	other threads:[~2026-08-14 23:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14 15:33 [syzbot] [net?] WARNING in rtmsg_ifinfo_build_skb syzbot
2026-08-14 15:35 ` Eric Dumazet
2026-08-14 15:37   ` syzbot
2026-08-14 23:14   ` Sabrina Dubroca [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=an-hOd_nV-xUqpUq@krikkit \
    --to=sd@queasysnail.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=syzbot+f2f6312ad1b5a0bfe316@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox