linux-stable/net/packet
Congyu Liu c38023032a net: fix information leakage in /proc/net/ptype
commit 47934e06b6 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: 2feb27dbe0 ("[NETNS]: Minor information leak via /proc/net/ptype file.")
Signed-off-by: Congyu Liu <liu3101@purdue.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-02-08 18:16:26 +01:00
..
af_packet.c net: fix information leakage in /proc/net/ptype 2022-02-08 18:16:26 +01:00
diag.c packet: pdiag_put_ring() should return TX_RING info for TPACKET_V3 2017-01-10 21:02:42 -05:00
internal.h net/packet: tpacket_rcv: avoid a producer race condition 2020-04-02 16:34:24 +02:00
Kconfig
Makefile