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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jul 2014 17:51:21 +0000 (10:51 -0700)
commit8f668a072fbac9357815ef8af5a3b468267929b3
tree4129e2dbf4a4fd238caff8d293b1c2e1c5a4fb47
parentd4a64a9257d84e326e36fb793f0541fa0595ac83
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>
Cc: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlags49_h2/wl_priv.c