diff options
author | Nicolai Stange <nstange@suse.de> | 2020-01-14 13:39:03 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-02-15 00:30:02 +0300 |
commit | 7bd751f1c30f6a2a870169c0501875f1ca2d9416 (patch) | |
tree | 19d1e5ac8cb495651a9e6444f00b50430cde7337 | |
parent | 03b4aeda9b6f455d81d1147f0900f1320bc48a44 (diff) | |
download | linux-7bd751f1c30f6a2a870169c0501875f1ca2d9416.tar.xz |
libertas: make lbs_ibss_join_existing() return error code on rates overflow
[ Upstream commit 1754c4f60aaf1e17d886afefee97e94d7f27b4cb ]
Commit e5e884b42639 ("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: e5e884b42639 ("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>
-rw-r--r-- | drivers/net/wireless/libertas/cfg.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c index 803684eed142..7d55de21b190 100644 --- a/drivers/net/wireless/libertas/cfg.c +++ b/drivers/net/wireless/libertas/cfg.c @@ -1854,6 +1854,7 @@ static int lbs_ibss_join_existing(struct lbs_private *priv, if (rates_max > MAX_RATES) { lbs_deb_join("invalid rates"); rcu_read_unlock(); + ret = -EINVAL; goto out; } rates = cmd.bss.rates; |