mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 13:27:06 +09:00
net: fix information leakage in /proc/net/ptype
commit47934e06b6upstream. 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d32a15cbc0
commit
be1ca30331
@@ -2237,6 +2237,7 @@ struct packet_type {
|
||||
struct net_device *);
|
||||
bool (*id_match)(struct packet_type *ptype,
|
||||
struct sock *sk);
|
||||
struct net *af_packet_net;
|
||||
void *af_packet_priv;
|
||||
struct list_head list;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user