B.A.T.M.A.N Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Linus Lüssing" <linus.luessing@c0d3.blue>
To: Sven Eckelmann <sven@narfation.org>
Cc: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [PATCH RFC batadv] batman-adv: mcast: fix use-after-free in orig_node RCU release
Date: Sun, 17 May 2026 23:08:30 +0200	[thread overview]
Message-ID: <agouTnSEU6CuTF5i@sellars> (raw)
In-Reply-To: <20260514-mcast-rcu-list-free-v1-1-0e20f24faa61@narfation.org>

On Thu, May 14, 2026 at 07:41:38PM +0200, Sven Eckelmann wrote:
> batadv_mcast_purge_orig() removes entries from RCU-protected hlists but
> does not wait for an RCU grace period before returning. Concurrent RCU
> readers may still accesses references to those entries at the point of
> removal. RCU-protected readers trying to operate on entries like
> orig->mcast_want_all_ipv6_node will then access already freed memory.
> 
> Fix this by moving batadv_mcast_purge_orig() to batadv_orig_node_release(),
> just before the call_rcu() invocation. This ensures RCU readers that were
> active at purge time have drained before the orig_node memory is reclaimed.
> 
> Fixes: 1c090349e2f6 ("batman-adv: Add IPv4 link-local/IPv6-ll-all-nodes multicast support")
> Signed-off-by: Sven Eckelmann <sven@narfation.org>

Makes sense to me now and does not seem to crash on my laptop with
Debian Sid in a simple batadv/veth setup.

Acked-by: Linus Lüssing <linus.luessing@c0d3.blue>

      parent reply	other threads:[~2026-05-17 21:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-14 17:41 [PATCH RFC batadv] batman-adv: mcast: fix use-after-free in orig_node RCU release Sven Eckelmann
2026-05-17 16:38 ` Linus Lüssing
2026-05-17 16:54   ` Sven Eckelmann
2026-05-17 17:55     ` Linus Lüssing
2026-05-17 18:08       ` Sven Eckelmann
2026-05-17 21:08 ` Linus Lüssing [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=agouTnSEU6CuTF5i@sellars \
    --to=linus.luessing@c0d3.blue \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=sven@narfation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox