staging: wlags49_h2: buffer overflow setting station name
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 29 Oct 2013 20:00:15 +0000 (23:00 +0300)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 28 Nov 2013 14:02:06 +0000 (14:02 +0000)
commit840834b578803d8153b6fd8526d23e615916208b
tree369240f9f017d1646a946b92cab0808de5d4e262
parenta88f5ccd2ac9798c046609a8aec18c3f522a6334
staging: wlags49_h2: buffer overflow setting station name

commit b5e2f339865fb443107e5b10603e53bbc92dc054 upstream.

We need to check the length parameter before doing the memcpy().  I've
actually changed it to strlcpy() as well so that it's NUL terminated.

You need CAP_NET_ADMIN to trigger these so it's not the end of the
world.

Reported-by: Nico Golde <nico@ngolde.de>
Reported-by: Fabian Yamaguchi <fabs@goesec.de>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/staging/wlags49_h2/wl_priv.c