diff options
author | David S. Miller <davem@davemloft.net> | 2016-04-28 16:42:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-28 16:42:40 -0400 |
commit | 956a7ffe00b4e8b75d98881ae4d0bd1b580648cb (patch) | |
tree | 0ab08c63c6952eaf07e1f50bf80226334c27afd4 /net/batman-adv/routing.c | |
parent | eb63efb4f263f1f4c2375731d3a9e2040030bc6a (diff) | |
parent | c4fdb6cff2aa0ae740c5f19b6f745cbbe786d42f (diff) |
Merge tag 'batman-adv-fix-for-davem' of git://git.open-mesh.org/linux-merge
Antonio Quartulli says:
====================
In this patchset you can find the following fixes:
1) check skb size to avoid reading beyond its border when delivering
payloads, by Sven Eckelmann
2) initialize last_seen time in neigh_node object to prevent cleanup
routine from accidentally purge it, by Marek Lindner
3) release "recently added" slave interfaces upon virtual/batman
interface shutdown, by Sven Eckelmann
4) properly decrease router object reference counter upon routing table
update, by Sven Eckelmann
5) release queue slots when purging OGM packets of deactivating slave
interface, by Linus Lüssing
Patch 2 and 3 have no "Fixes:" tag because the offending commits date
back to when batman-adv was not yet officially in the net tree.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/batman-adv/routing.c')
-rw-r--r-- | net/batman-adv/routing.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 4dd646a52f1a..b781bf753250 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -105,6 +105,15 @@ static void _batadv_update_route(struct batadv_priv *bat_priv, | |||
105 | neigh_node = NULL; | 105 | neigh_node = NULL; |
106 | 106 | ||
107 | spin_lock_bh(&orig_node->neigh_list_lock); | 107 | spin_lock_bh(&orig_node->neigh_list_lock); |
108 | /* curr_router used earlier may not be the current orig_ifinfo->router | ||
109 | * anymore because it was dereferenced outside of the neigh_list_lock | ||
110 | * protected region. After the new best neighbor has replace the current | ||
111 | * best neighbor the reference counter needs to decrease. Consequently, | ||
112 | * the code needs to ensure the curr_router variable contains a pointer | ||
113 | * to the replaced best neighbor. | ||
114 | */ | ||
115 | curr_router = rcu_dereference_protected(orig_ifinfo->router, true); | ||
116 | |||
108 | rcu_assign_pointer(orig_ifinfo->router, neigh_node); | 117 | rcu_assign_pointer(orig_ifinfo->router, neigh_node); |
109 | spin_unlock_bh(&orig_node->neigh_list_lock); | 118 | spin_unlock_bh(&orig_node->neigh_list_lock); |
110 | batadv_orig_ifinfo_put(orig_ifinfo); | 119 | batadv_orig_ifinfo_put(orig_ifinfo); |