• R/O
  • HTTP
  • SSH
  • HTTPS

kernel_xiaomi_msm8998: 提交

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


Commit MetaInfo

修订版4dd90d14f902074f18238dc104868debbd3cd250 (tree)
时间2020-02-15 06:30:02
作者Qing Xu <m1s5p6688@gmai...>
CommiterGreg Kroah-Hartman

Log Message

mwifiex: Fix possible buffer overflows in mwifiex_cmd_append_vsie_tlv()

[ Upstream commit b70261a288ea4d2f4ac7cd04be08a9f0f2de4f4d ]

mwifiex_cmd_append_vsie_tlv() calls memcpy() without checking
the destination size may trigger a buffer overflower,
which a local user could use to cause denial of service
or the execution of arbitrary code.
Fix it by putting the length check before calling memcpy().

Signed-off-by: Qing Xu <m1s5p6688@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>

更改概述

差异

--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -2568,6 +2568,13 @@ mwifiex_cmd_append_vsie_tlv(struct mwifiex_private *priv,
25682568 vs_param_set->header.len =
25692569 cpu_to_le16((((u16) priv->vs_ie[id].ie[1])
25702570 & 0x00FF) + 2);
2571+ if (le16_to_cpu(vs_param_set->header.len) >
2572+ MWIFIEX_MAX_VSIE_LEN) {
2573+ mwifiex_dbg(priv->adapter, ERROR,
2574+ "Invalid param length!\n");
2575+ break;
2576+ }
2577+
25712578 memcpy(vs_param_set->ie, priv->vs_ie[id].ie,
25722579 le16_to_cpu(vs_param_set->header.len));
25732580 *buffer += le16_to_cpu(vs_param_set->header.len) +
Show on old repository browser