kernel_optimize_test/net/decnet
Wei Wang 247488c0a4 decnet: always not take dst->__refcnt when inserting dst into hash table
In the existing dn_route.c code, dn_route_output_slow() takes
dst->__refcnt before calling dn_insert_route() while dn_route_input_slow()
does not take dst->__refcnt before calling dn_insert_route().
This makes the whole routing code very buggy.
In dn_dst_check_expire(), dnrt_free() is called when rt expires. This
makes the routes inserted by dn_route_output_slow() not able to be
freed as the refcnt is not released.
In dn_dst_gc(), dnrt_drop() is called to release rt which could
potentially cause the dst->__refcnt to be dropped to -1.
In dn_run_flush(), dst_free() is called to release all the dst. Again,
it makes the dst inserted by dn_route_output_slow() not able to be
released and also, it does not wait on the rcu and could potentially
cause crash in the path where other users still refer to this dst.

This patch makes sure both input and output path do not take
dst->__refcnt before calling dn_insert_route() and also makes sure
dnrt_free()/dst_free() is called when removing dst from the hash table.
The only difference between those 2 calls is that dnrt_free() waits on
the rcu while dst_free() does not.

Signed-off-by: Wei Wang <weiwan@google.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-16 15:00:00 -04:00
..
netfilter decnet: dn_rtmsg: Improve input length sanitization in dnrmg_receive_user_skb 2017-06-08 10:51:22 -04:00
af_decnet.c tcp: add TCPMemoryPressuresChrono counter 2017-06-08 11:26:19 -04:00
dn_dev.c networking: make skb_push & __skb_push return void pointers 2017-06-16 11:48:40 -04:00
dn_fib.c net: rtnetlink: plumb extended ack to doit function 2017-04-17 15:35:38 -04:00
dn_neigh.c DECnet: Use container_of() for embedded struct 2017-05-09 09:39:49 -04:00
dn_nsp_in.c netfilter: Pass net into okfn 2015-09-17 17:18:37 -07:00
dn_nsp_out.c networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
dn_route.c decnet: always not take dst->__refcnt when inserting dst into hash table 2017-06-16 15:00:00 -04:00
dn_rules.c net: ipv6: use common fib_default_rule_pref 2015-09-09 14:19:50 -07:00
dn_table.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
dn_timer.c decnet: Use time_after_eq 2014-08-22 12:23:11 -07:00
Kconfig
Makefile
README
sysctl_net_decnet.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
TODO

                       Linux DECnet Project
                      ======================

The documentation for this kernel subsystem is available in the
Documentation/networking subdirectory of this distribution and also
on line at http://www.chygwyn.com/DECnet/

Steve Whitehouse <SteveW@ACM.org>