Commit 323ca2c2 authored by Jussi Maki's avatar Jussi Maki Committed by Zhengchao Shao
Browse files

bonding: Fix negative jump label count on nested bonding

mainline inclusion
from mainline-v5.15-rc1
commit 6d5f1ef8
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I7NDRB
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6d5f1ef838683efba01bacb7854f6516fbcbae17



----------------------------------------

With nested bonding devices the nested bond device's ndo_bpf was
called without a program causing it to decrement the static key
without a prior increment leading to negative count.

Fix the issue by 1) only calling slave's ndo_bpf when there's a
program to be loaded and 2) only decrement the count when a program
is unloaded.

Fixes: 9e2ee5c7 ("net, bonding: Add XDP support to the bonding driver")
Reported-by: default avatar <syzbot+30622fb04ddd72a4d167@syzkaller.appspotmail.com>
Signed-off-by: default avatarJussi Maki <joamaki@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
parent 7080a636
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment