Commit d660f4f4 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

staging: rtl8712: unterminated string leads to read overflow

The memdup_user() function does not necessarily return a NUL terminated
string so this can lead to a read overflow.  Switch from memdup_user()
to strndup_user() to fix this bug.

Fixes: c6dc001f ("staging: r8712u: Merging Realtek's latest (v2.6.6). Various fixes.")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YDYSR+1rj26NRhvb@mwandaSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7c361945
...@@ -924,7 +924,7 @@ static int r871x_wx_set_priv(struct net_device *dev, ...@@ -924,7 +924,7 @@ static int r871x_wx_set_priv(struct net_device *dev,
struct iw_point *dwrq = (struct iw_point *)awrq; struct iw_point *dwrq = (struct iw_point *)awrq;
len = dwrq->length; len = dwrq->length;
ext = memdup_user(dwrq->pointer, len); ext = strndup_user(dwrq->pointer, len);
if (IS_ERR(ext)) if (IS_ERR(ext))
return PTR_ERR(ext); return PTR_ERR(ext);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment