• R/O
  • HTTP
  • SSH
  • HTTPS

kernel_xiaomi_msm8998: 提交

Mirror: https://github.com/0ranko0P/kernel_xiaomi_msm8998/


Commit MetaInfo

修订版7bd751f1c30f6a2a870169c0501875f1ca2d9416 (tree)
时间2020-02-15 06:30:02
作者Nicolai Stange <nstange@suse...>
CommiterGreg Kroah-Hartman

Log Message

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>

更改概述

差异

--- 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,
18541854 if (rates_max > MAX_RATES) {
18551855 lbs_deb_join("invalid rates");
18561856 rcu_read_unlock();
1857+ ret = -EINVAL;
18571858 goto out;
18581859 }
18591860 rates = cmd.bss.rates;
Show on old repository browser