linux/net/core
Soheil Hassas Yeganeh 83a1a1a70e sock: reset sk_err for ICMP packets read from error queue
Only when ICMP packets are enqueued onto the error queue,
sk_err is also set. Before f5f99309fa (sock: do not set sk_err
in sock_dequeue_err_skb), a subsequent error queue read
would set sk_err to the next error on the queue, or 0 if empty.
As no error types other than ICMP set this field, sk_err should
not be modified upon dequeuing them.

Only for ICMP errors, reset the (racy) sk_err. Some applications,
like traceroute, rely on it and go into a futile busy POLLERR
loop otherwise.

In principle, sk_err has to be set while an ICMP error is queued.
Testing is_icmp_err_skb(skb_next) approximates this without
requiring a full queue walk. Applications that receive both ICMP
and other errors cannot rely on this legacy behavior, as other
errors do not set sk_err in the first place.

Fixes: f5f99309fa (sock: do not set sk_err in sock_dequeue_err_skb)
Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-12-02 10:55:39 -05:00
..
datagram.c udp: do fwd memory scheduling on dequeue 2016-11-07 13:24:41 -05:00
dev_addr_lists.c
dev_ioctl.c
dev.c bpf, xdp: allow to pass flags to dev_change_xdp_fd 2016-11-30 10:27:20 -05:00
devlink.c devlink: Add E-Switch inline mode control 2016-11-24 16:01:14 -05:00
drop_monitor.c genetlink: mark families as __ro_after_init 2016-10-27 16:16:09 -04:00
dst_cache.c net: dst_cache_per_cpu_dst_set() can be static 2016-03-18 17:45:08 -04:00
dst.c
ethtool.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-11-26 23:42:21 -05:00
fib_rules.c net: core: add missing check for uid_range in rule_exists. 2016-11-09 13:28:10 -05:00
filter.c bpf: BPF for lightweight tunnel infrastructure 2016-12-02 10:51:49 -05:00
flow_dissector.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-11-26 23:42:21 -05:00
flow.c flowcache: Avoid OOM condition under preasure 2016-03-17 10:28:42 +01:00
gen_estimator.c net: sched: do not acquire qdisc spinlock in qdisc/class stats dump 2016-06-07 16:37:14 -07:00
gen_stats.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-06-10 11:52:24 -07:00
hwbm.c net: hwbm: Fix unbalanced spinlock in error case 2016-05-25 12:35:09 -07:00
link_watch.c
lwt_bpf.c bpf: BPF for lightweight tunnel infrastructure 2016-12-02 10:51:49 -05:00
lwtunnel.c bpf: BPF for lightweight tunnel infrastructure 2016-12-02 10:51:49 -05:00
Makefile bpf: BPF for lightweight tunnel infrastructure 2016-12-02 10:51:49 -05:00
neighbour.c neigh: remove duplicate check for same neigh 2016-11-30 13:46:16 -05:00
net_namespace.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-11-22 13:27:16 -05:00
net-procfs.c net: remove NETDEV_TX_LOCKED support 2016-04-26 15:53:05 -04:00
net-sysfs.c net: Add support for XPS with QoS via traffic classes 2016-10-31 15:00:48 -04:00
net-sysfs.h
net-traces.c
netclassid_cgroup.c core: remove unneded headers for net cgroup controllers. 2016-02-17 15:31:27 -05:00
netevent.c
netpoll.c netpoll: more efficient locking 2016-11-16 18:32:02 -05:00
netprio_cgroup.c core: remove unneded headers for net cgroup controllers. 2016-02-17 15:31:27 -05:00
pktgen.c netns: make struct pernet_operations::id unsigned int 2016-11-18 10:59:15 -05:00
ptp_classifier.c
request_sock.c
rtnetlink.c rtnetlink: return the correct error code 2016-12-01 14:36:03 -05:00
scm.c
secure_seq.c
skbuff.c sock: reset sk_err for ICMP packets read from error queue 2016-12-02 10:55:39 -05:00
sock_diag.c sock_diag: align nlattr properly when needed 2016-04-26 12:00:48 -04:00
sock_reuseport.c soreuseport: do not export reuseport_add_sock() 2016-10-18 14:18:23 -04:00
sock.c tcp: SOF_TIMESTAMPING_OPT_STATS option for SO_TIMESTAMPING 2016-11-30 10:04:25 -05:00
stream.c net: fix sleeping for sk_wait_event() 2016-11-14 13:17:21 -05:00
sysctl_net_core.c bpf: add generic constant blinding for use in jits 2016-05-16 13:49:32 -04:00
timestamping.c
tso.c
utils.c net: the space is required before the open parenthesis '(' 2016-06-29 05:15:14 -04:00