Skip to content

Commit 36f4415

Browse files
nicstangegregkh
authored andcommitted
libertas: make lbs_ibss_join_existing() return error code on rates overflow
[ Upstream commit 1754c4f ] Commit e5e884b ("libertas: Fix two buffer overflows at parsing bss descriptor") introduced a bounds check on the number of supplied rates to lbs_ibss_join_existing() and made it to return on overflow. However, the aforementioned commit doesn't set the return value accordingly and thus, lbs_ibss_join_existing() would return with zero even though it failed. Make lbs_ibss_join_existing return -EINVAL in case the bounds check on the number of supplied rates fails. Fixes: e5e884b ("libertas: Fix two buffer overflows at parsing bss descriptor") Signed-off-by: Nicolai Stange <nstange@suse.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 847e6a7 commit 36f4415

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • drivers/net/wireless/marvell/libertas

‎drivers/net/wireless/marvell/libertas/cfg.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,6 +1786,7 @@ static int lbs_ibss_join_existing(struct lbs_private *priv,
17861786
if (rates_max > MAX_RATES) {
17871787
lbs_deb_join("invalid rates");
17881788
rcu_read_unlock();
1789+
ret = -EINVAL;
17891790
goto out;
17901791
}
17911792
rates = cmd.bss.rates;

0 commit comments

Comments
 (0)