netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Zhengchao Shao <shaozhengchao@huawei.com>
Cc: <linux-wireless@vger.kernel.org>,  <netdev@vger.kernel.org>,
	<johannes@sipsolutions.net>,  <davem@davemloft.net>,
	<edumazet@google.com>,  <kuba@kernel.org>,  <pabeni@redhat.com>,
	<weiyongjun1@huawei.com>,  <yuehaibing@huawei.com>
Subject: Re: [PATCH net,v2] wifi: mac80211: fix WARNING in ieee80211_link_info_change_notify()
Date: Fri, 01 Sep 2023 07:38:58 +0300	[thread overview]
Message-ID: <871qfitsm5.fsf@kernel.org> (raw)
In-Reply-To: <20230901035301.3473463-1-shaozhengchao@huawei.com> (Zhengchao Shao's message of "Fri, 1 Sep 2023 11:53:01 +0800")

Zhengchao Shao <shaozhengchao@huawei.com> writes:

> Syz reports the following WARNING:
> wlan0: Failed check-sdata-in-driver check, flags: 0x0
> WARNING: CPU: 3 PID: 5384 at net/mac80211/main.c:287
> ieee80211_link_info_change_notify+0x1c2/0x230
> Modules linked in:
> RIP: 0010:ieee80211_link_info_change_notify+0x1c2/0x230
> Call Trace:
> <TASK>
> ieee80211_set_mcast_rate+0x3e/0x50
> nl80211_set_mcast_rate+0x316/0x650
> genl_family_rcv_msg_doit+0x20b/0x300
> genl_rcv_msg+0x39f/0x6a0
> netlink_rcv_skb+0x13b/0x3b0
> genl_rcv+0x24/0x40
> netlink_unicast+0x4a2/0x740
> netlink_sendmsg+0x83e/0xce0
> sock_sendmsg+0xc5/0x100
> ____sys_sendmsg+0x583/0x690
> ___sys_sendmsg+0xe8/0x160
> __sys_sendmsg+0xbf/0x160
> do_syscall_64+0x35/0x80
> entry_SYSCALL_64_after_hwframe+0x46/0xb0
> </TASK>
>
> The execution process is as follows:
> Thread A:
> ieee80211_open()
>     ieee80211_do_open()
>         drv_add_interface()     //set IEEE80211_SDATA_IN_DRIVER flag
> ...
> rtnl_newlink
>     do_setlink
> 	dev_change_flags
>             ...
>             __dev_close_many
>                 ieee80211_stop()
>                     ieee80211_do_stop()
>                         drv_remove_interface() //clear flag
> ...
> nl80211_set_mcast_rate()
>     ieee80211_set_mcast_rate()
>         ieee80211_link_info_change_notify()
>             check_sdata_in_driver() //WARNING because flag is cleared
>
> When the wlan device stops, the IEEE80211_SDATA_IN_ DRIVER flag is cleared.
> And then after the set mcast rate command is executed, WARNING is generated
> because the flag bit has been already cleared.
>
> Fixes: 591e73ee3f73 ("wifi: mac80211: properly skip link info driver update")
> Reported-by: syzbot+bce2ca140cc00578ed07@syzkaller.appspotmail.com
> Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>

Wireless patches (ie. anything which starts with "wifi:") go to wireless
and wireless-next trees, not to net tree.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

  reply	other threads:[~2023-09-01  4:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-01  3:53 [PATCH net,v2] wifi: mac80211: fix WARNING in ieee80211_link_info_change_notify() Zhengchao Shao
2023-09-01  4:38 ` Kalle Valo [this message]
2023-09-01  6:12   ` shaozhengchao
2023-09-01  6:32 ` Johannes Berg
2023-09-01  9:17   ` shaozhengchao
2023-09-01  9:19     ` Johannes Berg
2023-09-01 10:13       ` shaozhengchao

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=871qfitsm5.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shaozhengchao@huawei.com \
    --cc=weiyongjun1@huawei.com \
    --cc=yuehaibing@huawei.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;
as well as URLs for NNTP newsgroup(s).