Re: [PATCH RFC batadv] batman-adv: mcast: fix use-after-free in orig_node RCU release
Linus Lüssing <[email protected]>
| Newsgroups | org.open-mesh.lists.batman |
|---|---|
| Message-ID | <agoBLITjEyVPScvd@sellars> |
On Sun, May 17, 2026 at 06:54:09PM +0200, Sven Eckelmann wrote:
> But this looks super RCU-like (without locks):
>
> static int
> batadv_mcast_forw_want_all_ipv4(struct batadv_priv *bat_priv,
> struct sk_buff *skb, unsigned short vid)
> {
> struct batadv_orig_node *orig_node;
> int ret = NET_XMIT_SUCCESS;
> struct sk_buff *newskb;
>
> rcu_read_lock();
> hlist_for_each_entry_rcu(orig_node,
> &bat_priv->mcast.want_all_ipv4_list,
> mcast_want_all_ipv4_node) {
> [..]
> }
> rcu_read_unlock();
> return ret;
> }
Ah, no, you're absolutely right, I mixed it up!
Maybe this might make more sense as a fixes line then, though?
Fixes: 500ea14940f8 ("batman-adv: Add multicast-to-unicast support for multiple targets")
I think before that commit we only used these atomic counters in
fast path?