dcbnl: fix various netlink info leaks
authorMathias Krause <minipli@googlemail.com>
Sat, 9 Mar 2013 05:52:21 +0000 (05:52 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 27 Mar 2013 02:40:59 +0000 (02:40 +0000)
commit42d4afd275648c190ec1efc13491c294dadfa49d
treea9ce3bd69b895e88be58d435bec84167fb604f8e
parent2ed5a1be59dc5c54b33581031584e9bd35a3a3ab
dcbnl: fix various netlink info leaks

[ Upstream commit 29cd8ae0e1a39e239a3a7b67da1986add1199fc0 ]

The dcb netlink interface leaks stack memory in various places:
* perm_addr[] buffer is only filled at max with 12 of the 32 bytes but
  copied completely,
* no in-kernel driver fills all fields of an IEEE 802.1Qaz subcommand,
  so we're leaking up to 58 bytes for ieee_ets structs, up to 136 bytes
  for ieee_pfc structs, etc.,
* the same is true for CEE -- no in-kernel driver fills the whole
  struct,

Prevent all of the above stack info leaks by properly initializing the
buffers/structures involved.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/dcb/dcbnl.c