]> git.baikalelectronics.ru Git - kernel.git/commit
bonding: Fix negative jump label count on nested bonding
authorJussi Maki <joamaki@gmail.com>
Mon, 6 Sep 2021 08:56:37 +0000 (10:56 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Sep 2021 12:12:09 +0000 (13:12 +0100)
commita7e7c544bd5d639d5da21c9fd7e2c45995a66511
tree07244aaf7352b018d8229d2cf1c7bfce577daaed
parentcbe2d422aee4c8d70a93f84de0b0028cfb8dd7c2
bonding: Fix negative jump label count on nested bonding

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: 1a76c6905f9c ("net, bonding: Add XDP support to the bonding driver")
Reported-by: syzbot+30622fb04ddd72a4d167@syzkaller.appspotmail.com
Signed-off-by: Jussi Maki <joamaki@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c