WSL2-Linux-Kernel/include/net
YOSHIFUJI Hideaki / 吉藤英明 ecd9883724 ipv6: fix race condition regarding dst->expires and dst->from.
Eric Dumazet wrote:
| Some strange crashes happen in rt6_check_expired(), with access
| to random addresses.
|
| At first glance, it looks like the RTF_EXPIRES and
| stuff added in commit 1716a96101
| (ipv6: fix problem with expired dst cache)
| are racy : same dst could be manipulated at the same time
| on different cpus.
|
| At some point, our stack believes rt->dst.from contains a dst pointer,
| while its really a jiffie value (as rt->dst.expires shares the same area
| of memory)
|
| rt6_update_expires() should be fixed, or am I missing something ?
|
| CC Neil because of https://bugzilla.redhat.com/show_bug.cgi?id=892060

Because we do not have any locks for dst_entry, we cannot change
essential structure in the entry; e.g., we cannot change reference
to other entity.

To fix this issue, split 'from' and 'expires' field in dst_entry
out of union.  Once it is 'from' is assigned in the constructor,
keep the reference until the very last stage of the life time of
the object.

Of course, it is unsafe to change 'from', so make rt6_set_from simple
just for fresh entries.

Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Reported-by: Neil Horman <nhorman@tuxdriver.com>
CC: Gao Feng <gaofeng@cn.fujitsu.com>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reported-by: Steinar H. Gunderson <sesse@google.com>
Reviewed-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-02-20 15:11:45 -05:00
..
9p
bluetooth Bluetooth: Keep track of UUID type upon addition 2013-02-01 15:50:17 -02:00
caif
irda various: Fix spelling of "registered" in comments. 2012-11-19 14:29:46 +01:00
iucv
netfilter netfilter: nf_ct_helper: better logging for dropped packets 2013-02-19 02:48:05 +01:00
netns xfrm: make gc_thresh configurable in all namespaces 2013-02-06 11:36:29 +01:00
nfc NFC: Initial Secure Element API 2013-01-10 00:51:54 +01:00
phonet
sctp net: sctp: remove unused multiple cookie keys 2013-02-12 16:05:11 -05:00
tc_act
act_api.h act_police: move struct tcf_police to act_police.c 2013-02-12 18:59:45 -05:00
addrconf.h ipv4: introduce address lifetime 2013-01-29 13:59:57 -05:00
af_ieee802154.h
af_rxrpc.h
af_unix.h unix: Remove unused field from unix_sock 2012-10-21 20:37:06 -04:00
ah.h
arp.h
atmclip.h
ax25.h
ax88796.h
cfg80211-wext.h
cfg80211.h Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem 2013-02-18 13:47:13 -05:00
checksum.h
cipso_ipv4.h
cls_cgroup.h net: Update args to dummy sock_update_classid(). 2012-10-26 05:07:00 -04:00
codel.h
compat.h
datalink.h
dcbevent.h
dcbnl.h
dn.h
dn_dev.h
dn_fib.h
dn_neigh.h
dn_nsp.h
dn_route.h decnet: use correct RCU API to deref sk_dst_cache field 2013-01-28 00:15:27 -05:00
dsa.h
dsfield.h ipv6: Optimize ipv6_change_dsfield(). 2013-01-09 23:59:53 -08:00
dst.h ipv6: fix race condition regarding dst->expires and dst->from. 2013-02-20 15:11:45 -05:00
dst_ops.h
esp.h
ethoc.h
fib_rules.h
flow.h ipv4: Add FLOWI_FLAG_KNOWN_NH 2012-10-08 17:42:36 -04:00
flow_keys.h
garp.h
gen_stats.h
genetlink.h
gre.h
gro_cells.h gro: Fix kcalloc argument order 2013-01-27 22:46:33 -05:00
icmp.h
ieee80211_radiotap.h mac80211: support (partial) VHT radiotap information 2012-11-27 11:56:18 +01:00
ieee802154.h
ieee802154_netdev.h
if_inet6.h
inet6_connection_sock.h
inet6_hashtables.h soreuseport: TCP/IPv6 implementation 2013-01-23 13:44:01 -05:00
inet_common.h
inet_connection_sock.h inet: Fix kmemleak in tcp_v4/6_syn_recv_sock and dccp_v4/6_request_recv_sock 2012-12-14 13:14:07 -05:00
inet_ecn.h tunnel: drop packet if ECN present with not-ECT 2012-09-27 18:12:37 -04:00
inet_frag.h net: frag, move LRU list maintenance outside of rwlock 2013-01-29 13:36:24 -05:00
inet_hashtables.h soreuseport: TCP/IPv4 implementation 2013-01-23 13:44:01 -05:00
inet_sock.h net: move inet_dport/inet_num in sock_common 2012-11-30 15:02:56 -05:00
inet_timewait_sock.h net: move inet_dport/inet_num in sock_common 2012-11-30 15:02:56 -05:00
inetpeer.h
ip.h ipv4: Add a socket release callback for datagram sockets 2013-01-21 14:17:05 -05:00
ip6_checksum.h ipv6: move csum_ipv6_magic() and udp6_csum_init() into static library 2013-01-08 17:56:10 -08:00
ip6_fib.h ipv6: fix race condition regarding dst->expires and dst->from. 2013-02-20 15:11:45 -05:00
ip6_route.h ipv6: Remove unused neigh argument for icmp6_dst_alloc() and its callers. 2013-01-18 14:41:13 -05:00
ip6_tunnel.h
ip_fib.h ipv4: add a fib_type to fib_info 2012-10-04 13:58:26 -04:00
ip_vs.h ipvs: fix build errors related to config option combinations 2012-10-23 09:23:40 +09:00
ipcomp.h
ipconfig.h
ipip.h net: convert __IPTUNNEL_XMIT() to an inline function 2012-11-14 18:49:50 -05:00
ipv6.h ipv6 flowlabel: Convert np->ipv6_fl_list to RCU. 2013-01-30 22:41:13 -05:00
ipx.h
iw_handler.h
lapb.h
lib80211.h
llc.h
llc_c_ac.h
llc_c_ev.h
llc_c_st.h
llc_conn.h
llc_if.h
llc_pdu.h
llc_s_ac.h
llc_s_ev.h
llc_s_st.h
llc_sap.h
mac80211.h mac80211: stop modifying HT SMPS capability 2013-02-15 09:41:41 +01:00
mac802154.h
mip6.h
mld.h
mrp.h net/802: Implement Multiple Registration Protocol (MRP) 2013-02-10 20:37:22 -05:00
ndisc.h ndisc: Move ndisc_opt_addr_space() to include/net/ndisc.h. 2013-01-21 13:33:14 -05:00
neighbour.h net neighbour, decnet: Ensure to align device private data on preferred alignment. 2013-02-11 00:21:44 -05:00
net_namespace.h proc: Usable inode numbers for the namespace file descriptors. 2012-11-20 04:19:49 -08:00
net_ratelimit.h
netdma.h
netevent.h ipv6 netevent: Remove old_neigh from netevent_redirect. 2013-01-14 15:04:59 -05:00
netlabel.h
netlink.h
netprio_cgroup.h netprio_cgroup: use cgroup->id instead of cgroup_netprio_state->prioidx 2012-11-22 07:32:47 -08:00
netrom.h
nexthop.h
nl802154.h
p8022.h
ping.h
pkt_cls.h pkt_sched: namespace aware act_mirred 2013-01-14 15:09:36 -05:00
pkt_sched.h sch_api: introduce qdisc_watchdog_schedule_ns() 2013-02-12 18:59:45 -05:00
protocol.h net: Remove code duplication between offload structures 2012-11-15 17:39:51 -05:00
psnap.h
raw.h
rawv6.h
red.h
regulatory.h regulatory: use RCU to protect last_request 2013-01-03 13:01:30 +01:00
request_sock.h tcp: better retrans tracking for defer-accept 2012-11-03 14:45:00 -04:00
rose.h
route.h ipv4: avoid a test in ip_rt_put() 2012-11-03 14:59:04 -04:00
rtnetlink.h rtnelink: remove unused parameter from rtnl_create_link(). 2012-11-30 12:24:40 -05:00
sch_generic.h sch: make htb_rate_cfg and functions around that generic 2013-02-12 18:59:45 -05:00
scm.h net: Remove unnecessary NULL check in scm_destroy(). 2012-09-24 15:52:33 -04:00
secure_seq.h
slhc_vj.h
snmp.h
sock.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net into net 2013-02-18 23:34:21 -05:00
stp.h
tcp.h tcp: remove Appropriate Byte Count support 2013-02-05 14:51:16 -05:00
tcp_memcontrol.h
tcp_states.h
timewait_sock.h
transp_v6.h ipv6: rename datagram_send_ctl and datagram_recv_ctl 2013-01-31 13:53:08 -05:00
udp.h
udplite.h
wext.h
wimax.h
wpan-phy.h
x25.h
x25device.h
xfrm.h Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next 2013-02-14 13:29:20 -05:00