From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+2eab87cf3100f45423ec@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [net?] [s390?] KASAN: slab-use-after-free Read in netdev_walk_all_lower_dev
Date: Sat, 7 Dec 2024 10:57:31 +0800 [thread overview]
Message-ID: <20241207025731.839-1-hdanton@sina.com> (raw)
In-Reply-To: <67531f5d.050a0220.2477f.0006.GAE@google.com>
On Fri, 06 Dec 2024 07:59:25 -0800
> syzbot found the following issue on:
>
> HEAD commit: 896d8946da97 Merge tag 'net-6.13-rc2' of git://git.kernel...
> git tree: net
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10de5330580000
#syz test
--- x/net/smc/smc_core.c
+++ y/net/smc/smc_core.c
@@ -1893,10 +1893,22 @@ int smc_vlan_by_tcpsk(struct socket *clc
ini->vlan_id = vlan_dev_vlan_id(ndev);
goto out_rel;
}
+ rcu_read_lock();
+ if (ndev->reg_state == NETREG_UNREGISTERING || ndev->reg_state == NETREG_UNREGISTERED) {
+ rcu_read_unlock();
+ rc = -ENODEV;
+ goto out_rel;
+ }
+ rcu_read_unlock();
priv.data = (void *)&ini->vlan_id;
rtnl_lock();
- netdev_walk_all_lower_dev(ndev, smc_vlan_by_tcpsk_walk, &priv);
+ rcu_read_lock();
+ if (ndev->reg_state == NETREG_UNREGISTERING || ndev->reg_state == NETREG_UNREGISTERED)
+ rc = -ENODEV;
+ else
+ netdev_walk_all_lower_dev(ndev, smc_vlan_by_tcpsk_walk, &priv);
+ rcu_read_unlock();
rtnl_unlock();
out_rel:
--
next prev parent reply other threads:[~2024-12-07 2:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-06 15:59 [syzbot] [net?] [s390?] KASAN: slab-use-after-free Read in netdev_walk_all_lower_dev syzbot
2024-12-07 0:05 ` Hillf Danton
2024-12-07 0:34 ` syzbot
2024-12-07 1:38 ` Hillf Danton
2024-12-07 2:09 ` syzbot
2024-12-07 2:57 ` Hillf Danton [this message]
2024-12-07 3:22 ` syzbot
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=20241207025731.839-1-hdanton@sina.com \
--to=hdanton@sina.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+2eab87cf3100f45423ec@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