linux-stable/net/core
Joanne Koong d249081b51 bpf: Fix bpf_xdp_pointer return pointer
[ Upstream commit bbd52178e2 ]

For the case where offset + len == size, bpf_xdp_pointer should return a
valid pointer to the addr because that access is permitted. We should
only return NULL in the case where offset + len exceeds size.

Fixes: 3f364222d0 ("net: xdp: introduce bpf_xdp_pointer utility routine")
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/bpf/20220722220105.2065466-1-joannelkoong@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-17 14:41:11 +02:00
..
bpf_sk_storage.c bpf: Fix usage of trace RCU in local storage. 2022-06-06 08:48:59 +02:00
datagram.c net: remove noblock parameter from skb_recv_datagram() 2022-06-22 14:28:02 +02:00
datagram.h
dev.c net: fix data-race in dev_isalive() 2022-06-29 09:04:30 +02:00
dev_addr_lists.c dev_addr_list: put the first addr on the tree 2021-11-20 12:25:57 +00:00
dev_addr_lists_test.c net: kunit: add a test for dev_addr_lists 2021-11-20 12:25:57 +00:00
dev_ioctl.c net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
devlink.c devlink: hold the instance lock during eswitch_mode callbacks 2022-03-21 14:11:38 +00:00
drop_monitor.c drop_monitor: remove quadratic behavior 2022-02-23 12:39:58 +00:00
dst.c net: dst: add net device refcount tracking to dst_entry 2021-12-06 16:05:10 -08:00
dst_cache.c wireguard: device: reset peer src endpoint when netns exits 2021-11-29 19:50:45 -08:00
failover.c net: failover: add net device refcount tracker 2021-12-06 16:06:02 -08:00
fib_notifier.c
fib_rules.c fib: expand fib_rule_policy 2021-12-16 07:18:35 -08:00
filter.c bpf: Fix bpf_xdp_pointer return pointer 2022-08-17 14:41:11 +02:00
flow_dissector.c flow_dissector: fix false-positive __read_overflow2_field() warning 2022-04-08 12:16:59 +01:00
flow_offload.c netfilter: nf_tables: bail out early if hardware offload is not supported 2022-06-14 18:45:05 +02:00
gen_estimator.c net: sched: Remove Qdisc::running sequence counter 2021-10-18 12:54:41 +01:00
gen_stats.c net: stats: Read the statistics in ___gnet_stats_copy_basic() instead of adding. 2021-10-21 12:47:56 +01:00
gro.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-03-10 17:16:56 -08:00
gro_cells.c net: add per-cpu storage and net->core_stats 2022-03-11 23:17:24 -08:00
hwbm.c
link_watch.c net: refine dev_put()/dev_hold() debugging 2022-02-05 15:22:45 +00:00
lwt_bpf.c bpf, lwt: Fix crash when using bpf_skb_set_tunnel_key() from bpf_xmit lwt hook 2022-04-22 17:45:25 +02:00
lwtunnel.c lwtunnel: Validate RTA_ENCAP_TYPE attribute length 2021-12-31 14:31:59 +00:00
Makefile net: kunit: add a test for dev_addr_lists 2021-11-20 12:25:57 +00:00
neighbour.c net, neigh: Set lower cap for neigh_managed_work rearming 2022-06-14 18:45:12 +02:00
net-procfs.c net-procfs: show net devices bound packet types 2022-01-24 11:58:46 +00:00
net-sysfs.c net: fix data-race in dev_isalive() 2022-06-29 09:04:30 +02:00
net-sysfs.h
net-traces.c tcp: add tracepoint for checksum errors 2021-05-14 15:26:03 -07:00
net_namespace.c net: initialize init_net earlier 2022-02-06 11:04:29 +00:00
netclassid_cgroup.c bpf, cgroups: Fix cgroup v2 fallback on v1/v2 mixed mode 2021-09-13 16:35:58 -07:00
netevent.c net: core: Correct function name netevent_unregister_notifier() in the kerneldoc 2021-03-28 17:56:56 -07:00
netpoll.c netpoll: add net device refcount tracker to struct netpoll 2021-12-06 16:06:02 -08:00
netprio_cgroup.c bpf, cgroups: Fix cgroup v2 fallback on v1/v2 mixed mode 2021-09-13 16:35:58 -07:00
of_net.c Revert "of: net: support NVMEM cells with MAC in text format" 2022-01-12 14:14:36 +00:00
page_pool.c page_pool: Add function to batch and return stats 2022-03-03 09:55:28 +00:00
pktgen.c proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
ptp_classifier.c ptp: Add generic PTP is_sync() function 2022-03-07 11:31:34 +00:00
request_sock.c
rtnetlink.c rtnetlink: Fix handling of disabled L3 stats in RTM_GETSTATS replies 2022-04-14 09:01:26 +02:00
scm.c memcg: enable accounting for scm_fp_list objects 2021-07-20 06:00:38 -07:00
secure_seq.c tcp: Fix data-races around sysctl knobs related to SYN option. 2022-07-29 17:28:11 +02:00
selftests.c net: core: constify mac addrs in selftests 2021-10-24 13:59:44 +01:00
skbuff.c net: fix wrong network header length 2022-05-09 10:48:49 +01:00
skmsg.c skmsg: Fix invalid last sg check in sk_msg_recvmsg() 2022-08-17 14:41:04 +02:00
sock.c SO_ZEROCOPY should return -EOPNOTSUPP rather than -ENOTSUPP 2022-03-08 22:14:49 -08:00
sock_destructor.h skb_expand_head() adjust skb->truesize incorrectly 2021-10-22 12:35:51 -07:00
sock_diag.c net: Don't include filter.h from net/sock.h 2021-12-29 08:48:14 -08:00
sock_map.c bpf: support BPF_PROG_QUERY for progs attached to sockmap 2022-01-20 21:30:58 -08:00
sock_reuseport.c tcp: Fix data-races around sysctl_tcp_migrate_req. 2022-07-29 17:28:05 +02:00
stream.c net: stream: don't purge sk_error_queue in sk_stream_kill_queues() 2021-10-16 09:06:09 +01:00
sysctl_net_core.c net/sysctl: avoid two synchronize_rcu() calls 2022-02-28 11:40:47 +00:00
timestamping.c
tso.c
utils.c net: core: Use csum_replace_by_diff() and csum_sub() instead of opencoding 2022-02-21 11:40:44 +00:00
xdp.c Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2022-03-22 11:18:49 -07:00