alistair23-linux/net/ipv4
Qian Cai dddeb30bfc ipv4: fix a RCU-list lock in inet_dump_fib()
There is a place,

inet_dump_fib()
  fib_table_dump
    fn_trie_dump_leaf()
      hlist_for_each_entry_rcu()

without rcu_read_lock() will trigger a warning,

 WARNING: suspicious RCU usage
 -----------------------------
 net/ipv4/fib_trie.c:2216 RCU-list traversed in non-reader section!!

 other info that might help us debug this:

 rcu_scheduler_active = 2, debug_locks = 1
 1 lock held by ip/1923:
  #0: ffffffff8ce76e40 (rtnl_mutex){+.+.}, at: netlink_dump+0xd6/0x840

 Call Trace:
  dump_stack+0xa1/0xea
  lockdep_rcu_suspicious+0x103/0x10d
  fn_trie_dump_leaf+0x581/0x590
  fib_table_dump+0x15f/0x220
  inet_dump_fib+0x4ad/0x5d0
  netlink_dump+0x350/0x840
  __netlink_dump_start+0x315/0x3e0
  rtnetlink_rcv_msg+0x4d1/0x720
  netlink_rcv_skb+0xf0/0x220
  rtnetlink_rcv+0x15/0x20
  netlink_unicast+0x306/0x460
  netlink_sendmsg+0x44b/0x770
  __sys_sendto+0x259/0x270
  __x64_sys_sendto+0x80/0xa0
  do_syscall_64+0x69/0xf4
  entry_SYSCALL_64_after_hwframe+0x49/0xb3

Fixes: 18a8021a7b ("net/ipv4: Plumb support for filtering route dumps")
Signed-off-by: Qian Cai <cai@lca.pw>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-03-23 20:59:40 -07:00
..
bpfilter
netfilter proc: convert everything to "struct proc_ops" 2020-02-04 03:05:26 +00:00
af_inet.c net: port < inet_prot_sock(net) --> inet_port_requires_bind_service(net, port) 2019-11-26 13:20:46 -08:00
ah4.c
arp.c
bpf_tcp_ca.c bpf: Add BPF_FUNC_tcp_send_ack helper 2020-01-09 08:46:18 -08:00
cipso_ipv4.c ipv4: ensure rcu_read_lock() in cipso_v4_error() 2020-02-22 21:45:55 -08:00
datagram.c inet: stop leaking jiffies on the wire 2019-11-01 14:57:52 -07:00
devinet.c inet: protect against too small mtu values. 2019-12-07 11:55:11 -08:00
esp4.c xfrm: add espintcp (RFC 8229) 2019-12-09 09:59:07 +01:00
esp4_offload.c xfrm: support output_mark for offload ESP packets 2020-01-15 12:18:35 +01:00
fib_frontend.c ipv4: fix a RCU-list lock in inet_dump_fib() 2020-03-23 20:59:40 -07:00
fib_lookup.h ipv4: Add "offload" and "trap" indications to routes 2020-01-14 18:53:35 -08:00
fib_notifier.c net: fib_notifier: propagate extack down to the notifier block callback 2019-10-04 11:10:56 -07:00
fib_rules.c net: fib_notifier: propagate extack down to the notifier block callback 2019-10-04 11:10:56 -07:00
fib_semantics.c ipv4: Add "offload" and "trap" indications to routes 2020-01-14 18:53:35 -08:00
fib_trie.c Merge ra.kernel.org:/pub/scm/linux/kernel/git/netdev/net 2020-01-19 22:10:04 +01:00
fou.c fou: Fix IPv6 netlink policy 2020-01-23 14:32:52 +01:00
gre_demux.c gre: fix uninit-value in __iptunnel_pull_header 2020-03-08 21:25:37 -07:00
gre_offload.c net: remove the check argument from __skb_gro_checksum_convert 2020-01-03 12:24:34 -08:00
icmp.c icmp: introduce helper for nat'd source address in network device context 2020-02-13 14:19:00 -08:00
igmp.c igmp: uninline ip_mc_validate_checksum() 2019-10-04 14:26:46 -07:00
inet_connection_sock.c net: memcg: fix lockdep splat in inet_csk_accept() 2020-03-11 23:57:33 -07:00
inet_diag.c inet_diag: return classid for all socket types 2020-03-08 21:57:48 -07:00
inet_fragment.c
inet_hashtables.c tcp/dccp: fix possible race __inet_lookup_established() 2019-12-13 21:40:49 -08:00
inet_timewait_sock.c
inetpeer.c inetpeer: fix data-race in inet_putpeer / inet_putpeer 2019-11-07 16:15:56 -08:00
ip_forward.c ipv4: Revert removal of rt_uses_gateway 2019-09-20 18:23:33 -07:00
ip_fragment.c
ip_gre.c net: ip_gre: Accept IFLA_INFO_DATA-less configuration 2020-03-16 17:19:56 -07:00
ip_input.c ipv4: use dst hint for ipv4 list receive 2019-11-21 14:45:55 -08:00
ip_options.c
ip_output.c net: ipv4: use skb_list_walk_safe helper for gso segments 2020-01-14 11:48:41 -08:00
ip_sockglue.c
ip_tunnel.c net, ip_tunnel: fix namespaces move 2020-01-21 16:05:21 +01:00
ip_tunnel_core.c lwtunnel: check erspan options before allocating tun_info 2019-11-21 11:47:39 -08:00
ip_vti.c vti[6]: fix packet tx through bpf_redirect() 2020-01-14 08:55:38 +01:00
ipcomp.c
ipconfig.c proc: convert everything to "struct proc_ops" 2020-02-04 03:05:26 +00:00
ipip.c
ipmr.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-11-16 21:51:42 -08:00
ipmr_base.c net: fib_notifier: propagate extack down to the notifier block callback 2019-10-04 11:10:56 -07:00
Kconfig xfrm: add espintcp (RFC 8229) 2019-12-09 09:59:07 +01:00
Makefile bpf: tcp: Support tcp_congestion_ops in bpf 2020-01-09 08:46:18 -08:00
metrics.c
netfilter.c
netlink.c
nexthop.c net: include struct nhmsg size in nh nlmsg size 2020-01-27 10:54:08 +01:00
ping.c
proc.c tcp: export count for rehash attempts 2020-01-26 15:28:47 +01:00
protocol.c
raw.c netfilter: drop bridge nf reset from nf_reset 2019-10-01 18:42:15 +02:00
raw_diag.c inet_diag: return classid for all socket types 2020-03-08 21:57:48 -07:00
route.c proc: convert everything to "struct proc_ops" 2020-02-04 03:05:26 +00:00
syncookies.c mptcp: handle tcp fallback when using syn cookies 2020-01-29 17:45:20 +01:00
sysctl_net_ipv4.c net-tcp: Disable TCP ssthresh metrics cache by default 2019-12-09 20:17:48 -08:00
tcp.c tcp: repair: fix TCP_QUEUE_SEQ implementation 2020-03-23 13:02:01 -07:00
tcp_bbr.c tcp_bbr: improve arithmetic division in bbr_update_bw() 2020-01-21 10:45:49 +01:00
tcp_bic.c
tcp_bpf.c bpf: Sockmap/tls, fix pop data with SK_DROP return code 2020-01-15 23:26:13 +01:00
tcp_cdg.c
tcp_cong.c bpf: tcp: Support tcp_congestion_ops in bpf 2020-01-09 08:46:18 -08:00
tcp_cubic.c tcp_cubic: refactor code to perform a divide only when needed 2019-12-30 14:44:27 -08:00
tcp_dctcp.c
tcp_dctcp.h
tcp_diag.c net: annotate lockless accesses to sk->sk_max_ack_backlog 2019-11-06 16:14:48 -08:00
tcp_fastopen.c tcp: add TCP_INFO status for failed client TFO 2019-10-25 19:25:37 -07:00
tcp_highspeed.c
tcp_htcp.c
tcp_hybla.c
tcp_illinois.c
tcp_input.c tcp: fix TFO SYNACK undo to avoid double-timestamp-undo 2020-02-23 17:23:35 -08:00
tcp_ipv4.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2020-01-23 08:10:16 +01:00
tcp_lp.c
tcp_metrics.c net-tcp: Disable TCP ssthresh metrics cache by default 2019-12-09 20:17:48 -08:00
tcp_minisocks.c bpf: tcp: Support tcp_congestion_ops in bpf 2020-01-09 08:46:18 -08:00
tcp_nv.c
tcp_offload.c
tcp_output.c tcp: also NULL skb->dev when copy was needed 2020-03-20 19:36:38 -07:00
tcp_rate.c
tcp_recovery.c
tcp_scalable.c
tcp_timer.c tcp: export count for rehash attempts 2020-01-26 15:28:47 +01:00
tcp_ulp.c bpf: Sockmap/tls, push write_space updates through ulp updates 2020-01-15 23:26:13 +01:00
tcp_vegas.c
tcp_vegas.h
tcp_veno.c
tcp_westwood.c
tcp_yeah.c
tunnel4.c
udp.c udp: rehash on disconnect 2020-02-19 16:34:11 -08:00
udp_diag.c inet_diag: return classid for all socket types 2020-03-08 21:57:48 -07:00
udp_impl.h
udp_offload.c udp: Support UDP fraglist GRO/GSO. 2020-01-27 11:00:21 +01:00
udp_tunnel.c
udplite.c
xfrm4_input.c
xfrm4_output.c netfilter: Support iif matches in POSTROUTING 2019-11-15 23:44:48 +01:00
xfrm4_policy.c net: add bool confirm_neigh parameter for dst_ops.update_pmtu 2019-12-24 22:28:54 -08:00
xfrm4_protocol.c xfrm: add route lookup to xfrm4_rcv_encap 2019-12-09 09:59:07 +01:00
xfrm4_state.c
xfrm4_tunnel.c