mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+ec9b5cce58002d184fb6@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [net?] WARNING: ODEBUG bug in advance_sched
Date: Fri, 22 Dec 2023 19:07:13 +0800	[thread overview]
Message-ID: <20231222110713.1245-1-hdanton@sina.com> (raw)
In-Reply-To: <000000000000f3d57d060d0556a1@google.com>

On Thu, 21 Dec 2023 05:47:25 -0800
> HEAD commit:    1a44b0073b92 Merge tag 'ovl-fixes-6.7-rc7' of git://git.ke..
> git tree:       upstream
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1465cbd6e80000

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

--- x/net/sched/sch_taprio.c
+++ y/net/sched/sch_taprio.c
@@ -1941,6 +1941,9 @@ static int taprio_change(struct Qdisc *s
 
 	/* Protects against enqueue()/dequeue() */
 	spin_lock_bh(qdisc_lock(sch));
+	spin_lock_irqsave(&q->current_entry_lock, flags);
+	oper = rtnl_dereference(q->oper_sched);
+	admin = rtnl_dereference(q->admin_sched);
 
 	if (tb[TCA_TAPRIO_ATTR_TXTIME_DELAY]) {
 		if (!TXTIME_ASSIST_IS_ENABLED(q->flags)) {
@@ -1981,17 +1984,12 @@ static int taprio_change(struct Qdisc *s
 	} else {
 		setup_first_end_time(q, new_admin, start);
 
-		/* Protects against advance_sched() */
-		spin_lock_irqsave(&q->current_entry_lock, flags);
-
 		taprio_start_sched(sch, start, new_admin);
 
 		rcu_assign_pointer(q->admin_sched, new_admin);
 		if (admin)
 			call_rcu(&admin->rcu, taprio_free_sched_cb);
 
-		spin_unlock_irqrestore(&q->current_entry_lock, flags);
-
 		if (FULL_OFFLOAD_IS_ENABLED(q->flags))
 			taprio_offload_config_changed(q);
 	}
@@ -2004,6 +2002,7 @@ static int taprio_change(struct Qdisc *s
 				   "Size table not specified, frame length estimations may be inaccurate");
 
 unlock:
+	spin_unlock_irqrestore(&q->current_entry_lock, flags);
 	spin_unlock_bh(qdisc_lock(sch));
 
 free_sched:
@@ -2393,7 +2392,9 @@ static int taprio_dump(struct Qdisc *sch
 	struct sched_gate_list *oper, *admin;
 	struct tc_mqprio_qopt opt = { 0 };
 	struct nlattr *nest, *sched_nest;
+	unsigned long flags;
 
+	spin_lock_irqsave(&q->current_entry_lock, flags);
 	oper = rtnl_dereference(q->oper_sched);
 	admin = rtnl_dereference(q->admin_sched);
 
@@ -2436,6 +2437,7 @@ static int taprio_dump(struct Qdisc *sch
 	nla_nest_end(skb, sched_nest);
 
 done:
+	spin_unlock_irqrestore(&q->current_entry_lock, flags);
 	return nla_nest_end(skb, nest);
 
 admin_error:
@@ -2445,6 +2447,7 @@ options_error:
 	nla_nest_cancel(skb, nest);
 
 start_error:
+	spin_unlock_irqrestore(&q->current_entry_lock, flags);
 	return -ENOSPC;
 }
 
--

  parent reply	other threads:[~2023-12-22 11:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21 13:47 syzbot
2023-12-21 19:33 ` syzbot
2023-12-22 11:07 ` Hillf Danton [this message]
2023-12-22 11:37   ` syzbot
2024-11-11 19:31 ` syzbot
2026-05-11 21:06 ` Forwarded: 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=20231222110713.1245-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+ec9b5cce58002d184fb6@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

all inboxes | Powered by JetHome®