From: Haimin Zhang <redacted>
syzbot report an array-index-out-of-bounds in taprio_change
index 16 is out of range for type '__u16 [16]'
that's because mqprio->num_tc is lager than TC_MAX_QUEUE,so we check
the return value of netdev_set_num_tc.
Reported-by: syzbot+2b3e5fb6c7ef285a94f6@syzkaller.appspotmail.com
Signed-off-by: Haimin Zhang <redacted>
---
net/sched/sch_taprio.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Mon, 30 Aug 2021 11:47:01 +0800 you wrote:
From: Haimin Zhang <redacted>
syzbot report an array-index-out-of-bounds in taprio_change
index 16 is out of range for type '__u16 [16]'
that's because mqprio->num_tc is lager than TC_MAX_QUEUE,so we check
the return value of netdev_set_num_tc.
[...]
From: Jakub Kicinski <kuba@kernel.org> Date: 2021-08-30 17:15:01
On Mon, 30 Aug 2021 11:30:06 +0000 patchwork-bot+netdevbpf@kernel.org
wrote:
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Mon, 30 Aug 2021 11:47:01 +0800 you wrote:
quoted
From: Haimin Zhang <redacted>
syzbot report an array-index-out-of-bounds in taprio_change
index 16 is out of range for type '__u16 [16]'
that's because mqprio->num_tc is lager than TC_MAX_QUEUE,so we check
the return value of netdev_set_num_tc.
[...]
From: Cong Wang <hidden> Date: 2021-08-31 05:56:37
On Mon, Aug 30, 2021 at 10:14 AM Jakub Kicinski [off-list ref] wrote:
On Mon, 30 Aug 2021 11:30:06 +0000 patchwork-bot+netdevbpf@kernel.org
wrote:
quoted
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Mon, 30 Aug 2021 11:47:01 +0800 you wrote:
quoted
From: Haimin Zhang <redacted>
syzbot report an array-index-out-of-bounds in taprio_change
index 16 is out of range for type '__u16 [16]'
that's because mqprio->num_tc is lager than TC_MAX_QUEUE,so we check
the return value of netdev_set_num_tc.
[...]
I agree it is slightly better to make the check work in
taprio_parse_mqprio_opt(), but this patch is not bad either, we
need to check the return value of netdev_set_num_tc() for
completeness at least.
BTW, this patch should be landed in -net, not -net-next, as it
fixes a real bug reported by syzbot.
Thanks.