netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Hillf Danton <hdanton@sina.com>
Cc: syzbot <syzbot+ca740b95a16399ceb9a5@syzkaller.appspotmail.com>,
	davem@davemloft.net, hchunhui@mail.ustc.edu.cn, hdanton@sina.com,
	ja@ssi.bg, jmorris@namei.org, kuznet@ms2.inr.ac.ru,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	syzkaller-bugs@googlegroups.com, yoshfuji@linux-ipv6.org,
	Johannes Berg <johannes.berg@intel.com>
Subject: Re: WARNING in hrtimer_forward
Date: Mon, 28 Sep 2020 20:35:58 +0200	[thread overview]
Message-ID: <87mu19kaup.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20200928171137.16804-1-hdanton@sina.com>

On Tue, Sep 29 2020 at 01:11, Hillf Danton wrote:
> On Mon, 28 Sep 2020 18:13:42 +0200 Thomas Gleixner wrote:
>> So the timer was armed at some point and then the expiry which does the
>> forward races with the ioctl which starts the timer. Lack of
>> serialization or such ...
>
> To make syzbot happy, s/hrtimer_is_queued/hrtimer_active/ can close
> that race but this warning looks benign.

Why only make sysbot happy? It's clearly an issue and the warning is not
benign simply because forwarding a queued timer is an absolute NONO.
timers (both timer_list and hrtimer) need external synchronization.

> --- a/drivers/net/wireless/mac80211_hwsim.c
> +++ b/drivers/net/wireless/mac80211_hwsim.c
> @@ -1698,7 +1698,7 @@ static int mac80211_hwsim_config(struct
>  
>  	if (!data->started || !data->beacon_int)
>  		hrtimer_cancel(&data->beacon_timer);
> -	else if (!hrtimer_is_queued(&data->beacon_timer)) {
> +	else if (!hrtimer_active(&data->beacon_timer)) {
>  		u64 tsf = mac80211_hwsim_get_tsf(hw, NULL);
>  		u32 bcn_int = data->beacon_int;
>  		u64 until_tbtt = bcn_int - do_div(tsf, bcn_int);
> @@ -1768,7 +1768,7 @@ static void mac80211_hwsim_bss_info_chan
>  			  info->enable_beacon, info->beacon_int);
>  		vp->bcn_en = info->enable_beacon;
>  		if (data->started &&
> -		    !hrtimer_is_queued(&data->beacon_timer) &&
> +		    !hrtimer_active(&data->beacon_timer) &&
>  		    info->enable_beacon) {
>  			u64 tsf, until_tbtt;
>  			u32 bcn_int;

Looks about right.

Thanks,

        tglx


   

  parent reply	other threads:[~2020-09-28 18:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25  8:48 WARNING in hrtimer_forward syzbot
2020-09-27  0:38 ` syzbot
2020-09-27 14:29 ` syzbot
2020-09-28 16:13   ` Thomas Gleixner
     [not found]   ` <20200928171137.16804-1-hdanton@sina.com>
2020-09-28 18:35     ` Thomas Gleixner [this message]
2020-09-30  7:26       ` Dmitry Vyukov
     [not found] ` <20200927080452.18340-1-hdanton@sina.com>
2020-09-28 14:18   ` Thomas Gleixner
2021-11-03  9:21 ` [syzbot] " syzbot
2021-12-04 10:19   ` Dmitry Vyukov

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=87mu19kaup.fsf@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=davem@davemloft.net \
    --cc=hchunhui@mail.ustc.edu.cn \
    --cc=hdanton@sina.com \
    --cc=ja@ssi.bg \
    --cc=jmorris@namei.org \
    --cc=johannes.berg@intel.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=syzbot+ca740b95a16399ceb9a5@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=yoshfuji@linux-ipv6.org \
    /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).