mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+1261670bbdefc5485a06@syzkaller.appspotmail.com>
Cc: Cong Wang <xiyou.wangcong@gmail.com>,
	Lizhi Xu <lizhi.xu@windriver.com>,
	linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [net?] general protection fault in qdisc_tree_reduce_backlog
Date: Sat,  5 Jul 2025 16:42:12 +0800	[thread overview]
Message-ID: <20250705084214.2579-1-hdanton@sina.com> (raw)
In-Reply-To: <686764a5.a00a0220.c7b3.0013.GAE@google.com>

> > Date: Thu, 03 Jul 2025 22:20:37 -0700
> > syzbot found the following issue on:
> > 
> > HEAD commit:    bd475eeaaf3c Merge branch '200GbE' of git://git.kernel.org..
> > git tree:       net
> > console+strace: https://syzkaller.appspot.com/x/log.txt?x=12f0b3d4580000
> > kernel config:  https://syzkaller.appspot.com/x/.config?x=36b0e72cad5298f8
> > dashboard link: https://syzkaller.appspot.com/bug?extid=1261670bbdefc5485a06
> > syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=164d8c8c580000
> > C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=14839ebc580000
> 
> Date: Fri, 4 Jul 2025 22:07:34 -0700 Cong Wang wrote:
> Maybe I didn't make it clear, I think Victor's patch also fixes this
> bug.
> 
> https://lore.kernel.org/netdev/20250704163422.160424-1-victor@mojatatu.com/
> 
> Can you check if you still see the crash with his fix?

#syz test

--- x/net/sched/sch_api.c
+++ y/net/sched/sch_api.c
@@ -336,17 +336,22 @@ out:
 	return q;
 }
 
-static struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid)
+static struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid,
+				struct netlink_ext_ack *extack)
 {
 	unsigned long cl;
 	const struct Qdisc_class_ops *cops = p->ops->cl_ops;
 
-	if (cops == NULL)
-		return NULL;
+	if (cops == NULL) {
+		NL_SET_ERR_MSG(extack, "Parent qdisc is not classful");
+		return ERR_PTR(-EOPNOTSUPP);
+	}
 	cl = cops->find(p, classid);
 
-	if (cl == 0)
-		return NULL;
+	if (cl == 0) {
+		NL_SET_ERR_MSG(extack, "Specified class not found");
+		return ERR_PTR(-ENOENT);
+	}
 	return cops->leaf(p, cl);
 }
 
@@ -1490,16 +1495,20 @@ static int __tc_get_qdisc(struct sk_buff
 					NL_SET_ERR_MSG(extack, "Failed to find qdisc with specified classid");
 					return -ENOENT;
 				}
-				q = qdisc_leaf(p, clid);
+				q = qdisc_leaf(p, clid, extack);
 			} else if (dev_ingress_queue(dev)) {
 				q = rtnl_dereference(dev_ingress_queue(dev)->qdisc_sleeping);
 			}
 		} else {
 			q = rtnl_dereference(dev->qdisc);
 		}
-		if (!q) {
-			NL_SET_ERR_MSG(extack, "Cannot find specified qdisc on specified device");
-			return -ENOENT;
+		if (IS_ERR_OR_NULL(q)) {
+			if (!q) {
+				NL_SET_ERR_MSG(extack,
+					       "Cannot find specified qdisc on specified device");
+				return -ENOENT;
+			}
+			return PTR_ERR(q);
 		}
 
 		if (tcm->tcm_handle && q->handle != tcm->tcm_handle) {
@@ -1602,7 +1611,9 @@ static int __tc_modify_qdisc(struct sk_b
 					NL_SET_ERR_MSG(extack, "Failed to find specified qdisc");
 					return -ENOENT;
 				}
-				q = qdisc_leaf(p, clid);
+				q = qdisc_leaf(p, clid, extack);
+				if (IS_ERR(q))
+					return PTR_ERR(q);
 			} else if (dev_ingress_queue_create(dev)) {
 				q = rtnl_dereference(dev_ingress_queue(dev)->qdisc_sleeping);
 			}
--

  parent reply	other threads:[~2025-07-05  8:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-04  5:20 syzbot
2025-07-04  6:36 ` syzbot
2025-07-04  7:25 ` Hillf Danton
2025-07-04  7:53   ` syzbot
2025-07-04  8:04 ` [PATCH] net/sched: Prevent notify to parent who unsupport class ops Lizhi Xu
2025-07-04 14:01   ` Paolo Abeni
2025-07-05  0:03   ` Cong Wang
2025-07-05  1:18     ` [PATCH V2] " Lizhi Xu
2025-07-05  5:07       ` Cong Wang
2025-07-05 13:59         ` Jamal Hadi Salim
2025-07-04  8:34 ` [syzbot] [net?] general protection fault in qdisc_tree_reduce_backlog syzbot
2025-07-05  8:42 ` Hillf Danton [this message]
2025-07-05  9:12   ` syzbot
     [not found] <20250704063547.3973319-1-lizhi.xu@windriver.com>
2025-07-04  7:30 ` 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=20250705084214.2579-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizhi.xu@windriver.com \
    --cc=syzbot+1261670bbdefc5485a06@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=xiyou.wangcong@gmail.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®