Skip to content

Commit

Permalink
wil6210: missing length check in wmi_set_ie
Browse files Browse the repository at this point in the history
commit b5a8ffc upstream.

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>
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Lior David authored and Greg Kroah-Hartman committed Dec 21, 2018
1 parent fa3ec41 commit eac164f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/wireless/ath/wil6210/wmi.c
Original file line number Diff line number Diff line change
@@ -969,7 +969,12 @@ 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)
return -EINVAL;

cmd = kzalloc(len, GFP_KERNEL);

if (!cmd)
return -ENOMEM;

0 comments on commit eac164f

Please sign in to comment.