diff options
author | Lior David | 2017-11-14 14:25:39 +0100 |
---|---|---|
committer | Kalle Valo | 2017-12-02 15:18:42 +0100 |
commit | b5a8ffcae4103a9d823ea3aa3a761f65779fbe2a (patch) | |
tree | 8cfcac3d4fa5ebfb68ead6a1a24f62d49e343f83 | |
parent | wil6210: add block size checks during FW load (diff) | |
download | kernel-qcow2-linux-b5a8ffcae4103a9d823ea3aa3a761f65779fbe2a.tar.gz kernel-qcow2-linux-b5a8ffcae4103a9d823ea3aa3a761f65779fbe2a.tar.xz kernel-qcow2-linux-b5a8ffcae4103a9d823ea3aa3a761f65779fbe2a.zip |
wil6210: missing length check in wmi_set_ie
Add a length check in wmi_set_ie to detect unsigned integer
overflow.
Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wmi.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c index 16aa624a986a..dd25f6369ce3 100644 --- a/drivers/net/wireless/ath/wil6210/wmi.c +++ b/drivers/net/wireless/ath/wil6210/wmi.c @@ -1616,8 +1616,14 @@ int wmi_set_ie(struct wil6210_priv *wil, u8 type, u16 ie_len, const void *ie) }; int rc; u16 len = sizeof(struct wmi_set_appie_cmd) + ie_len; - struct wmi_set_appie_cmd *cmd = kzalloc(len, GFP_KERNEL); + struct wmi_set_appie_cmd *cmd; + if (len < ie_len) { + rc = -EINVAL; + goto out; + } + + cmd = kzalloc(len, GFP_KERNEL); if (!cmd) { rc = -ENOMEM; goto out; |