Eric Dumazet
0fcfaa8ed9
af_unix: fix races in sk_peer_pid and sk_peer_cred accesses
...
[ Upstream commit 35306eb23814444bd4021f8a1c3047d3cb0c8b2b ]
Jann Horn reported that SO_PEERCRED and SO_PEERGROUPS implementations
are racy, as af_unix can concurrently change sk_peer_pid and sk_peer_cred.
In order to fix this issue, this patch adds a new spinlock that needs
to be used whenever these fields are read or written.
Jann also pointed out that l2cap_sock_get_peer_pid_cb() is currently
reading sk->sk_peer_pid which makes no sense, as this field
is only possibly set by AF_UNIX sockets.
We will have to clean this in a separate patch.
This could be done by reverting b48596d1dc25 "Bluetooth: L2CAP: Add get_peer_pid callback"
or implementing what was truly expected.
Fixes: 109f6e39fa ("af_unix: Allow SO_PEERCRED to work across namespaces.")
Signed-off-by: Eric Dumazet <[email protected] >
Reported-by: Jann Horn <[email protected] >
Cc: Eric W. Biederman <[email protected] >
Cc: Luiz Augusto von Dentz <[email protected] >
Cc: Marcel Holtmann <[email protected] >
Signed-off-by: David S. Miller <[email protected] >
Signed-off-by: Sasha Levin <[email protected] >
2021-10-06 15:42:35 +02:00
..
6lowpan
6lowpan: iphc: Fix an off-by-one check of array index
2021-09-15 09:47:31 +02:00
9p
9p/trans_virtio: Remove sysfs file on probe failure
2021-09-26 14:07:08 +02:00
802
net/802/garp: fix memleak in garp_request_join()
2021-07-31 08:19:38 +02:00
8021q
appletalk
atm
ax25
batman-adv
batman-adv: Avoid WARN_ON timing related checks
2021-06-23 14:41:23 +02:00
bluetooth
Bluetooth: Fix handling of LE Enhanced Connection Complete
2021-09-22 12:26:33 +02:00
bpf
bpfilter
bpfilter: Specify the log level for the kmsg message
2021-07-14 16:53:33 +02:00
bridge
net: bridge: fix memleak in br_add_if()
2021-08-18 08:57:00 +02:00
caif
net-caif: avoid user-triggerable WARN_ON(1)
2021-09-22 12:26:40 +02:00
can
can: j1939: j1939_session_deactivate(): clarify lifetime of session object
2021-08-04 12:27:40 +02:00
ceph
core
af_unix: fix races in sk_peer_pid and sk_peer_cred accesses
2021-10-06 15:42:35 +02:00
dcb
dccp
dccp: don't duplicate ccid when cloning dccp sock
2021-09-22 12:26:40 +02:00
decnet
net: decnet: Fix sleeping inside in af_decnet
2021-07-28 13:30:56 +02:00
dns_resolver
dsa
net: dsa: destroy the phylink instance on any error in dsa_slave_phy_setup
2021-09-22 12:26:42 +02:00
ethernet
hsr
hsr: use netdev_err() instead of WARN_ONCE()
2021-05-14 09:44:10 +02:00
ieee802154
net: Fix memory leak in ieee802154_raw_deliver
2021-08-18 08:57:00 +02:00
ife
ipv4
net: ipv4: Fix rtnexthop len when RTA_FLOW is present
2021-10-06 15:42:33 +02:00
ipv6
net: ipv4: Fix rtnexthop len when RTA_FLOW is present
2021-10-06 15:42:33 +02:00
iucv
kcm
key
l2tp
net/l2tp: Fix reference count leak in l2tp_udp_recv_core
2021-09-22 12:26:41 +02:00
l3mdev
lapb
llc
net: llc: fix skb_over_panic
2021-08-04 12:27:39 +02:00
mac80211
mac80211: mesh: fix potentially unaligned access
2021-10-06 15:42:32 +02:00
mac802154
mpls
ncsi
netfilter
ipvs: check that ip_vs_conn_tab_bits is between 8 and 20
2021-10-06 15:42:32 +02:00
netlabel
net: fix NULL pointer reference in cipso_v4_doi_free
2021-09-22 12:26:36 +02:00
netlink
netlink: Deal with ESRCH error in nlmsg_notify()
2021-09-22 12:26:27 +02:00
netrom
netrom: Decrease sock refcount when sock timers expire
2021-07-28 13:30:56 +02:00
nfc
net/nfc/rawsock.c: fix a permission check bug
2021-06-16 11:59:33 +02:00
nsh
openvswitch
ovs: clear skb->tstamp in forwarding path
2021-08-26 08:36:19 -04:00
packet
net/packet: annotate accesses to po->ifindex
2021-06-30 08:47:48 -04:00
phonet
psample
qrtr
net: qrtr: fix another OOB Read in qrtr_endpoint_post
2021-09-03 10:08:12 +02:00
rds
net/rds: dma_map_sg is entitled to merge entries
2021-09-03 10:08:15 +02:00
rfkill
rose
rxrpc
sched
net: sched: flower: protect fl_walk() with rcu
2021-10-06 15:42:35 +02:00
sctp
sctp: break out if skb_header_pointer returns NULL in sctp_rcv_ootb
2021-10-06 15:42:33 +02:00
smc
net/smc: add missing error check in smc_clc_prfx_set()
2021-09-30 10:09:23 +02:00
strparser
sunrpc
rpc: fix gss_svc_init cleanup on failure
2021-09-22 12:26:33 +02:00
switchdev
tipc
tipc: increase timeout in tipc_sk_enqueue()
2021-09-22 12:26:41 +02:00
tls
tls: prevent oversized sendfile() hangs by ignoring MSG_MORE
2021-07-14 16:53:31 +02:00
unix
af_unix: fix races in sk_peer_pid and sk_peer_cred accesses
2021-10-06 15:42:35 +02:00
vmw_vsock
vsock/virtio: avoid potential deadlock when vsock device remove
2021-08-18 08:57:01 +02:00
wimax
wireless
cfg80211: Fix possible memory leak in function cfg80211_bss_update
2021-08-04 12:27:38 +02:00
x25
net/x25: Return the correct errno code
2021-06-18 09:59:00 +02:00
xdp
xsk: Simplify detection of empty and full rings
2021-05-22 11:38:27 +02:00
xfrm
xfrm: Fix error reporting in xfrm_state_construct.
2021-07-19 08:53:11 +02:00
compat.c
net: Return the correct errno code
2021-06-18 09:59:00 +02:00
Kconfig
Makefile
socket.c
net: don't unconditionally copy_from_user a struct ifreq for socket ioctls
2021-09-03 10:08:16 +02:00
sysctl_net.c