net: fix info leak in compat dev_ifconf()
authorMathias Krause <minipli@googlemail.com>
Wed, 15 Aug 2012 11:31:57 +0000 (11:31 +0000)
committerWilly Tarreau <w@1wt.eu>
Mon, 10 Jun 2013 09:43:30 +0000 (11:43 +0200)
commit66096e8915ce1ff5daa23362dc890651b160be7d
tree8ee2a90f9926b6d7f1fa6f84834217fcdb6e2e1b
parentf2e244fabae264798ac7980a3d3056ba1684a187
net: fix info leak in compat dev_ifconf()

commit 43da5f2e0d0c69ded3d51907d9552310a6b545e8 upstream.

The implementation of dev_ifconf() for the compat ioctl interface uses
an intermediate ifc structure allocated in userland for the duration of
the syscall. Though, it fails to initialize the padding bytes inserted
for alignment and that for leaks four bytes of kernel stack. Add an
explicit memset(0) before filling the structure to avoid the info leak.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 2.6.32: adjust filename, context]
Signed-off-by: Willy Tarreau <w@1wt.eu>
fs/compat_ioctl.c