From: Victor Nogueira <victor@mojatatu.com>
To: syzbot <syzbot+84339b9e7330daae4d66@syzkaller.appspotmail.com>,
davem@davemloft.net, edumazet@google.com, jhs@mojatatu.com,
jiri@resnulli.us, kuba@kernel.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, pabeni@redhat.com,
pctammela@mojatatu.com, syzkaller-bugs@googlegroups.com,
xiyou.wangcong@gmail.com
Subject: Re: [syzbot] [net?] general protection fault in qdisc_create
Date: Sun, 31 Dec 2023 11:10:23 -0300 [thread overview]
Message-ID: <675e418f-ef2f-4bb7-9fde-337171aea92e@mojatatu.com> (raw)
In-Reply-To: <0000000000007c85f5060dcc3a28@google.com>
[-- Attachment #1: Type: text/plain, Size: 226 bytes --]
On 31/12/2023 08:04, syzbot wrote:
> HEAD commit: c2b2ee36250d bridge: cfm: fix enum typo in br_cc_ccm_tx_pa..
> git tree: net-next
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15fed8f6e80000
#syz test
[-- Attachment #2: 0001-net-sched-We-should-only-add-appropriate-qdiscs-bloc.patch --]
[-- Type: text/x-patch, Size: 2109 bytes --]
From e63340707ce85f8608e3c3ae3cec1340ef17eede Mon Sep 17 00:00:00 2001
From: Victor Nogueira <victor@mojatatu.com>
Date: Thu, 28 Dec 2023 13:18:49 +0000
Subject: [PATCH net-next 1/1] net/sched: We should only add appropriate qdiscs
blocks to ports' xarray
We should only add qdiscs to the blocks ports' xarray in ingress that
support ingress_block_set/get or in egress that support
egress_block_set/get.
Fixes: 913b47d3424e ("net/sched: Introduce tc block netdev tracking infra")
Signed-off-by: Victor Nogueira <victor@mojatatu.com>
Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
net/sched/sch_api.c | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 299086bb6205..426be81276f1 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -1187,23 +1187,29 @@ static int qdisc_block_add_dev(struct Qdisc *sch, struct net_device *dev,
struct tcf_block *block;
int err;
- block = cl_ops->tcf_block(sch, TC_H_MIN_INGRESS, NULL);
- if (block) {
- err = xa_insert(&block->ports, dev->ifindex, dev, GFP_KERNEL);
- if (err) {
- NL_SET_ERR_MSG(extack,
- "ingress block dev insert failed");
- return err;
+ if (sch->ops->ingress_block_get) {
+ block = cl_ops->tcf_block(sch, TC_H_MIN_INGRESS, NULL);
+ if (block) {
+ err = xa_insert(&block->ports, dev->ifindex, dev,
+ GFP_KERNEL);
+ if (err) {
+ NL_SET_ERR_MSG(extack,
+ "ingress block dev insert failed");
+ return err;
+ }
}
}
- block = cl_ops->tcf_block(sch, TC_H_MIN_EGRESS, NULL);
- if (block) {
- err = xa_insert(&block->ports, dev->ifindex, dev, GFP_KERNEL);
- if (err) {
- NL_SET_ERR_MSG(extack,
- "Egress block dev insert failed");
- goto err_out;
+ if (sch->ops->egress_block_get) {
+ block = cl_ops->tcf_block(sch, TC_H_MIN_EGRESS, NULL);
+ if (block) {
+ err = xa_insert(&block->ports, dev->ifindex, dev,
+ GFP_KERNEL);
+ if (err) {
+ NL_SET_ERR_MSG(extack,
+ "Egress block dev insert failed");
+ goto err_out;
+ }
}
}
--
2.25.1
next prev parent reply other threads:[~2023-12-31 14:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-31 11:04 syzbot
2023-12-31 14:10 ` Victor Nogueira [this message]
2023-12-31 14:35 ` syzbot
2024-01-04 11:42 ` [syzbot] " syzbot
[not found] <ZZaZtg3GrtfspDko@nanopsycho>
2024-01-04 12:15 ` 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=675e418f-ef2f-4bb7-9fde-337171aea92e@mojatatu.com \
--to=victor@mojatatu.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pctammela@mojatatu.com \
--cc=syzbot+84339b9e7330daae4d66@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®