diff options
author | Hangbin Liu <liuhangbin@gmail.com> | 2023-05-09 11:11:57 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-06-05 09:21:19 +0200 |
commit | c88d21c0ae323a415e23470d0525724cc5da6ae1 (patch) | |
tree | eacadcfc572b2d43f069945d361bd49f5acfed4a /include | |
parent | 7ee611fc85adbb82e63501e7cb517163bacb0086 (diff) | |
download | linux-stable-c88d21c0ae323a415e23470d0525724cc5da6ae1.tar.gz linux-stable-c88d21c0ae323a415e23470d0525724cc5da6ae1.tar.bz2 linux-stable-c88d21c0ae323a415e23470d0525724cc5da6ae1.zip |
bonding: fix send_peer_notif overflow
[ Upstream commit 9949e2efb54eb3001cb2f6512ff3166dddbfb75d ]
Bonding send_peer_notif was defined as u8. Since commit 07a4ddec3ce9
("bonding: add an option to specify a delay between peer notifications").
the bond->send_peer_notif will be num_peer_notif multiplied by
peer_notif_delay, which is u8 * u32. This would cause the send_peer_notif
overflow easily. e.g.
ip link add bond0 type bond mode 1 miimon 100 num_grat_arp 30 peer_notify_delay 1000
To fix the overflow, let's set the send_peer_notif to u32 and limit
peer_notif_delay to 300s.
Reported-by: Liang Li <liali@redhat.com>
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2090053
Fixes: 07a4ddec3ce9 ("bonding: add an option to specify a delay between peer notifications")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/bonding.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/bonding.h b/include/net/bonding.h index 0db3c5f36868..e4453cf4f017 100644 --- a/include/net/bonding.h +++ b/include/net/bonding.h @@ -228,7 +228,7 @@ struct bonding { */ spinlock_t mode_lock; spinlock_t stats_lock; - u8 send_peer_notif; + u32 send_peer_notif; u8 igmp_retrans; #ifdef CONFIG_PROC_FS struct proc_dir_entry *proc_entry; |