[B.A.T.M.A.N.] Missing list checks for *list_add*
sven at narfation.org
Sun Jul 26 02:41:58 CEST 2015
On Friday 26 June 2015 16:45:01 Sven Eckelmann wrote:
> Simon debugged the refcnt problem and submitted some patches to fix them. I
> had a brief look and noticed that there are possible more problems similar
> to the *list_del* ones - just with *list_add*. Basically some functions use
> some kind of get function, notice that the element does not exist and then
> create a new one to add to the list. Only the "list_add" is protected. The
> result may be that an element in twice in a list when only a single
> occurrence is allowed.
> The problem I saw is batadv_gw_node_update. It first calls
> batadv_gw_node_get to check if an object with this value already exists and
> then uses batadv_gw_node_add to add a node (which may already be added
> between these two calls). So it has to be made sure that nothing modifies
> the list between these two calls).
> Similar looking functions are for example:
> * batadv_tvlv_handler_register
> * batadv_nc_get_nc_node
> * batadv_softif_create_vlan
> * batadv_tt_global_orig_entry_add
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: This is a digitally signed message part.
More information about the B.A.T.M.A.N