Star64_linux/net
Hao Luo 14702f5441 bpf: Add MEM_RDONLY for helper args that are pointers to rdonly mem.
commit 216e3cd2f2 upstream.

Some helper functions may modify its arguments, for example,
bpf_d_path, bpf_get_stack etc. Previously, their argument types
were marked as ARG_PTR_TO_MEM, which is compatible with read-only
mem types, such as PTR_TO_RDONLY_BUF. Therefore it's legitimate,
but technically incorrect, to modify a read-only memory by passing
it into one of such helper functions.

This patch tags the bpf_args compatible with immutable memory with
MEM_RDONLY flag. The arguments that don't have this flag will be
only compatible with mutable memory types, preventing the helper
from modifying a read-only memory. The bpf_args that have
MEM_RDONLY are compatible with both mutable memory and immutable
memory.

Signed-off-by: Hao Luo <haoluo@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211217003152.48334-9-haoluo@google.com
Cc: stable@vger.kernel.org # 5.15.x
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-19 17:48:17 +08:00
..
6lowpan
9p
802
8021q
appletalk
atm
ax25 ax25: Fix UAF bugs in ax25 timers 2023-04-19 17:48:07 +08:00
batman-adv ipv6: make mc_forwarding atomic 2023-04-19 17:47:36 +08:00
bluetooth Bluetooth: Fix use after free in hci_send_acl 2023-04-19 17:47:40 +08:00
bpf bpf: Make remote_port field in struct bpf_sk_lookup 16-bit wide 2023-04-19 17:47:51 +08:00
bpfilter
bridge
caif
can can: isotp: stop timeout monitoring when no first frame was sent 2023-04-19 17:48:10 +08:00
ceph
core bpf: Add MEM_RDONLY for helper args that are pointers to rdonly mem. 2023-04-19 17:48:17 +08:00
dcb
dccp
decnet
dns_resolver
dsa net: dsa: hellcreek: Calculate checksums in tagger 2023-04-19 17:48:10 +08:00
ethernet
ethtool
hsr
ieee802154
ife
ipv4 esp: limit skb_page_frag_refill use to a single page 2023-04-19 17:48:09 +08:00
ipv6 ipv6: make ip6_rt_gc_expire an atomic_t 2023-04-19 17:48:10 +08:00
iucv
kcm
key af_key: add __GFP_ZERO flag for compose_sadb_supported in function pfkey_register 2023-04-19 17:46:27 +08:00
l2tp
l3mdev l3mdev: l3mdev_master_upper_ifindex_by_index_rcu should be using netdev_master_upper_dev_get_rcu 2023-04-19 17:48:10 +08:00
lapb
llc llc: only change llc->dev when bind() succeeds 2023-04-19 17:46:25 +08:00
mac80211 mac80211: limit bandwidth in HE capabilities 2023-04-19 17:46:57 +08:00
mac802154
mctp mctp: Fix check for dev_hard_header() result 2023-04-19 17:47:44 +08:00
mpls
mptcp
ncsi
netfilter netfilter: nft_ct: fix use after free when attaching zone template 2023-04-19 17:48:16 +08:00
netlabel netlabel: fix out-of-bounds memory accesses 2023-04-19 17:47:40 +08:00
netlink netlink: reset network and mac headers in netlink_dump() 2023-04-19 17:48:11 +08:00
netrom
nfc nfc: nci: add flush_workqueue to prevent uaf 2023-04-19 17:48:00 +08:00
nsh
openvswitch netfilter: conntrack: convert to refcount_t api 2023-04-19 17:48:16 +08:00
packet net/packet: fix packet_sock xmit return value checking 2023-04-19 17:48:10 +08:00
phonet
psample
qrtr
rds
rfkill rfkill: make new event layout opt-in 2023-04-19 17:46:36 +08:00
rose
rxrpc rxrpc: Restore removed timer deletion 2023-04-19 17:48:10 +08:00
sched netfilter: conntrack: convert to refcount_t api 2023-04-19 17:48:16 +08:00
sctp sctp: Initialize daddr on peeled off socket 2023-04-19 17:48:00 +08:00
smc net/smc: Fix sock leak when release after smc_shutdown() 2023-04-19 17:48:10 +08:00
strparser
sunrpc SUNRPC: Fix NFSD's request deferral on RDMA transports 2023-04-19 17:48:04 +08:00
switchdev
tipc tipc: fix the timer expires after interval 100ms 2023-04-19 17:47:07 +08:00
tls net/tls: fix slab-out-of-bounds bug in decrypt_internal 2023-04-19 17:47:44 +08:00
unix af_unix: Support POLLPRI for OOB. 2023-04-19 17:47:30 +08:00
vmw_vsock vsock/virtio: enable VQs early on probe 2023-04-19 17:47:13 +08:00
wireless nl80211: correctly check NL80211_ATTR_REG_ALPHA2 size 2023-04-19 17:48:05 +08:00
x25 net/x25: Fix null-ptr-deref caused by x25_disconnect 2023-04-19 17:47:14 +08:00
xdp xsk: Fix race at socket teardown 2023-04-19 17:47:02 +08:00
xfrm xfrm: fix tunnel model fragmentation behavior 2023-04-19 17:46:26 +08:00
compat.c
devres.c
Kconfig
Makefile
socket.c
sysctl_net.c