]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mac80211: fix potential overflow when multiplying to u32 integers
authorColin Ian King <colin.king@canonical.com>
Fri, 5 Feb 2021 17:53:52 +0000 (17:53 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Mar 2021 17:22:40 +0000 (18:22 +0100)
commit14d12b1b9b5b7a051d46d34053a379982472455b
treee676725cb12b9df00bc97b5a6eac275dda392079
parentd6cd5498e652c737cfc25f907eda605e0724c464
mac80211: fix potential overflow when multiplying to u32 integers

[ Upstream commit 6194f7e6473be78acdc5d03edd116944bdbb2c4e ]

The multiplication of the u32 variables tx_time and estimated_retx is
performed using a 32 bit multiplication and the result is stored in
a u64 result. This has a potential u32 overflow issue, so avoid this
by casting tx_time to a u64 to force a 64 bit multiply.

Addresses-Coverity: ("Unintentional integer overflow")
Fixes: 050ac52cbe1f ("mac80211: code for on-demand Hybrid Wireless Mesh Protocol")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210205175352.208841-1-colin.king@canonical.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/mac80211/mesh_hwmp.c