linux_dsm_epyc7002/net/core
John Fastabend 3e104c2381 bpf, sockmap: msg_pop_data can incorrecty set an sge length
When sk_msg_pop() is called where the pop operation is working on
the end of a sge element and there is no additional trailing data
and there _is_ data in front of pop, like the following case,

   |____________a_____________|__pop__|

We have out of order operations where we incorrectly set the pop
variable so that instead of zero'ing pop we incorrectly leave it
untouched, effectively. This can cause later logic to shift the
buffers around believing it should pop extra space. The result is
we have 'popped' more data then we expected potentially breaking
program logic.

It took us a while to hit this case because typically we pop headers
which seem to rarely be at the end of a scatterlist elements but
we can't rely on this.

Fixes: 7246d8ed4d ("bpf: helper to pop data from messages")
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/158861288359.14306.7654891716919968144.stgit@john-Precision-5820-Tower
2020-05-06 00:22:15 +02:00
..
bpf_sk_storage.c
datagram.c
datagram.h
dev_addr_lists.c
dev_ioctl.c
dev.c xdp: Reset prog in dev_change_xdp_fd when fd is negative 2020-04-14 21:38:02 +02:00
devlink.c
drop_monitor.c
dst_cache.c
dst.c
failover.c
fib_notifier.c
fib_rules.c
filter.c bpf, sockmap: msg_pop_data can incorrecty set an sge length 2020-05-06 00:22:15 +02:00
flow_dissector.c
flow_offload.c
gen_estimator.c
gen_stats.c
gro_cells.c
hwbm.c
link_watch.c
lwt_bpf.c
lwtunnel.c
Makefile
neighbour.c neigh: support smaller retrans_time settting 2020-04-02 17:55:26 -07:00
net_namespace.c
net-procfs.c
net-sysfs.c net-sysfs: remove redundant assignment to variable ret 2020-04-09 10:14:53 -07:00
net-sysfs.h
net-traces.c
netclassid_cgroup.c cgroup, netclassid: remove double cond_resched 2020-04-21 15:44:30 -07:00
netevent.c
netpoll.c
netprio_cgroup.c
page_pool.c
pktgen.c
ptp_classifier.c
request_sock.c
rtnetlink.c
scm.c
secure_seq.c
skbuff.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-03-30 20:48:43 -07:00
skmsg.c
sock_diag.c
sock_map.c
sock_reuseport.c
sock.c net: remove obsolete comment 2020-04-25 20:49:32 -07:00
stream.c
sysctl_net_core.c
timestamping.c
tso.c
utils.c
xdp.c