tcp: sysctl interface leaks 16 bytes of kernel memory
Subsystems (2)
PATCH 1/1 tcp: sysctl interface leaks 16 bytes of kernel memory
From: Alan Cox <[email protected]>
If the rc_dereference of tcp_fastopen_ctx ever fails then we copy 16 bytes of kernel stack into the proc result.
Signed-off-by Alan Cox <[email protected]>
---
net/ipv4/sysctl_net_ipv4.c | 2 ++ 1 file changed, 2 insertions(+)
net/ipv4/sysctl_net_ipv4.c +2 -0
@@ -248,6 +248,8 @@ int proc_tcp_fastopen_key(ctl_table *ctl, int write, void __user *buffer, ctxt =rcu_dereference (tcp_fastopen_ctx);if (ctxt)memcpy (user_key, ctxt->key,TCP_FASTOPEN_KEY_LENGTH ); +else +memset (user_key,0 ,sizeof (user_key));rcu_read_unlock (); snprintf(tbl.data, tbl.maxlen, "%08x-%08x-%08x-%08x",
David Miller
maintainerFrom: Alan Cox <[email protected]>
Date: Thu, 11 Oct 2012 17:24:14 +0100
Quoted 6 lines
From: Alan Cox <[email protected]>
If the
rc_dereferenceoftcp_fastopen_ctxever fails then we copy 16 bytes of kernel stack into the proc result.Signed-off-by Alan Cox <[email protected]>
Applied and queued up for -stable.