Skip to content
Commit be1ca303 authored by Congyu Liu's avatar Congyu Liu Committed by Greg Kroah-Hartman
Browse files

net: fix information leakage in /proc/net/ptype

commit 47934e06 upstream.

In one net namespace, after creating a packet socket without binding
it to a device, users in other net namespaces can observe the new
`packet_type` added by this packet socket by reading `/proc/net/ptype`
file. This is minor information leakage as packet socket is
namespace aware.

Add a net pointer in `packet_type` to keep the net namespace of
of corresponding packet socket. In `ptype_seq_show`, this net pointer
must be checked when it is not NULL.

Fixes: 2feb27db

 ("[NETNS]: Minor information leak via /proc/net/ptype file.")
Signed-off-by: default avatarCongyu Liu <liu3101@purdue.edu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent d32a15cb
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment