Re: [PATCH net v4 0/5] amt: relay tunnel lifetime, validation and request-path hardening

From: Omar Ramadan

Date: Thu Oct 15 2026 - 19:22:44 EST


Thanks for the review. These comments are against the v3 series; v4 has
addressed the review issues introduced or exposed at those bisect points.

The Update path now takes tunnel->lock and checks READ_ONCE(tunnel->dead)
before either the IGMP or MLD report handler. Both tunnel freers set dead
before clearing groups, so an Update that acquires the lock after teardown
starts cannot add a group or arm its group_timer. An Update that acquires the
lock first is covered by the same lock ordering: teardown waits for the
handler before clearing the group list.

amt_dev_stop() no longer uses list_splice_init(). It marks all tunnels dead,
then removes one tunnel at a time with list_del_rcu() while holding amt->lock,
and performs cancel_delayed_work_sync(), group clearing, and kfree_rcu()
outside the lock. Every lockless reader therefore keeps the real list head as
its terminator, and the post-stop get_or_create() path also rejects creation
when !netif_running(amt->dev).

The Request-only lifetime issue is removed by v4's final patch. Requests are
stateless and do not allocate tunnel entries; tunnel state is created only
after a Membership Update authenticates. last_seen therefore describes a
valid Update again, and the global and per-source limits cannot be consumed
by unauthenticated Requests.

The group and source timer workers now hold RCU while finding their owners
and take tunnel->lock before checking dead state. A worker that races with
teardown exits safely; the group worker also releases the device reference
that its timer owns. This closes the callback lifetime and double-removal
races raised in the review.

pw-bot: cr