linux/net/core
Willem de Bruijn f72c4ac695 skbuff: in skb_copy_ubufs unclone before releasing zerocopy
skb_copy_ubufs must unclone before it is safe to modify its
skb_shared_info with skb_zcopy_clear.

Commit b90ddd5687 ("skbuff: skb_copy_ubufs must release uarg even
without user frags") ensures that all skbs release their zerocopy
state, even those without frags.

But I forgot an edge case where such an skb arrives that is cloned.

The stack does not build such packets. Vhost/tun skbs have their
frags orphaned before cloning. TCP skbs only attach zerocopy state
when a frag is added.

But if TCP packets can be trimmed or linearized, this might occur.
Tracing the code I found no instance so far (e.g., skb_linearize
ends up calling skb_zcopy_clear if !skb->data_len).

Still, it is non-obvious that no path exists. And it is fragile to
rely on this.

Fixes: b90ddd5687 ("skbuff: skb_copy_ubufs must release uarg even without user frags")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-12-28 14:26:22 -05:00
..
datagram.c
dev_addr_lists.c
dev_ioctl.c
dev.c xdp: linearize skb in netif_receive_generic_xdp() 2017-12-15 14:34:36 +01:00
devlink.c
drop_monitor.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
dst_cache.c
dst.c
ethtool.c
fib_notifier.c net: Protect iterations over net::fib_notifier_ops in fib_seq_sum() 2017-11-15 14:01:30 +09:00
fib_rules.c
filter.c bpf: introduce ARG_PTR_TO_MEM_OR_NULL 2017-11-22 21:40:54 +01:00
flow_dissector.c
gen_estimator.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
gen_stats.c
gro_cells.c
hwbm.c
link_watch.c
lwt_bpf.c
lwtunnel.c
Makefile
neighbour.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
net_namespace.c net: Fix double free and memory corruption in get_net_ns_by_id() 2017-12-20 12:42:22 -05:00
net-procfs.c
net-sysfs.c net-sysfs: trigger netlink notification on ifalias change via sysfs 2017-11-14 22:03:21 +09:00
net-sysfs.h
net-traces.c
netclassid_cgroup.c
netevent.c
netpoll.c
netprio_cgroup.c net: remove duplicate includes 2017-12-13 13:18:46 -05:00
pktgen.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2017-11-15 11:56:19 -08:00
ptp_classifier.c
request_sock.c
rtnetlink.c
scm.c
secure_seq.c
skbuff.c skbuff: in skb_copy_ubufs unclone before releasing zerocopy 2017-12-28 14:26:22 -05:00
sock_diag.c
sock_reuseport.c
sock.c Merge branch 'akpm' (patches from Andrew) 2017-11-15 19:42:40 -08:00
stream.c
sysctl_net_core.c
timestamping.c
tso.c
utils.c