[B.A.T.M.A.N.] [PATCH v2] batman-adv: Fix use-after-free/double-free of tt_req_node

2016-05-29 Thread Sven Eckelmann
The tt_req_node is added and removed from a list inside a spinlock. But the locking is sometimes removed even when the object is still referenced and will be used later via this reference. For example batadv_send_tt_request can create a new tt_req_node (including add to a list) and later re-acquire

Re: [B.A.T.M.A.N.] [PATCH maint] batman-adv: Fix use-after-free of tt_req_node

2016-05-29 Thread Sven Eckelmann
On Sunday 29 May 2016 22:33:39 Sven Eckelmann wrote: > The tt_req_node is added and removed from a list inside a spinlock. But the > locking is sometimes removed even when the object is still referenced and > will be used later via this reference. For example batadv_send_tt_request > can create a n

[B.A.T.M.A.N.] [PATCH maint] batman-adv: Fix use-after-free of tt_req_node

2016-05-29 Thread Sven Eckelmann
The tt_req_node is added and removed from a list inside a spinlock. But the locking is sometimes removed even when the object is still referenced and will be used later via this reference. For example batadv_send_tt_request can create a new tt_req_node (including add to a list) and later re-acquire

[B.A.T.M.A.N.] [PATCH-maint] batman-adv: Fix ICMP RR ethernet access after skb_linearize

2016-05-29 Thread Sven Eckelmann
The skb_linearize may reallocate the skb. This makes the calculated pointer for ethhdr invalid. But it the pointer is used later to fill in the RR field of the batadv_icmp_packet_rr packet. Instead re-evaluate eth_hdr after the skb_linearize+skb_cow to fix the pointer and avoid the invalid read.

[B.A.T.M.A.N.] [PATCH 6/6] batman-adv: Avoid sysfs name collision for netns moves

2016-05-29 Thread Sven Eckelmann
The kobject_put is only removing the sysfs entry and corresponding entries when its reference counter becomes zero. This tends to lead to collisions when a device is moved between two different network namespaces because some of the sysfs files have to be removed first and then added again to the a