<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-next.git/net/batman-adv/bridge_loop_avoidance.c, branch master</title>
<subtitle>Linux kernel latest source</subtitle>
<id>http://mirrors.hust.edu.cn/git/linux-next.git/atom?h=master</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/linux-next.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/'/>
<updated>2026-06-28T19:58:36+00:00</updated>
<entry>
<title>batman-adv: drop NULL check for immutable hardif-&gt;mesh_iface</title>
<updated>2026-06-28T19:58:36+00:00</updated>
<author>
<name>Sven Eckelmann</name>
<email>sven@narfation.org</email>
</author>
<published>2026-06-04T06:30:07+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=b58c36b804f4447655a9eb353bf3a9d310f50e06'/>
<id>urn:sha1:b58c36b804f4447655a9eb353bf3a9d310f50e06</id>
<content type='text'>
The batadv_hard_iface-&gt;mesh_iface became immutable after the global
batadv_hardif_list was removed and batadv_hard_iface only exists when it is
assigned to an mesh_iface. This member can never become NULL and thus a
check is now unnecessary.

Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
</content>
</entry>
<entry>
<title>batman-adv: bla: update stale kernel-doc</title>
<updated>2026-06-05T07:12:08+00:00</updated>
<author>
<name>Sven Eckelmann</name>
<email>sven@narfation.org</email>
</author>
<published>2026-06-04T19:35:04+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=219b4c46db7fe9627c3ab30e0cfe1a79ca808995'/>
<id>urn:sha1:219b4c46db7fe9627c3ab30e0cfe1a79ca808995</id>
<content type='text'>
The bridge-loop-avoidance code was changed recently to avoid inconsistent
state and race condition problems. The kernel-doc addded in these commits
(and related code) has various minor deficits which are now resolved.

Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
</content>
</entry>
<entry>
<title>batman-adv: convert cancellation of work items to disable helper</title>
<updated>2026-06-05T07:12:06+00:00</updated>
<author>
<name>Sven Eckelmann</name>
<email>sven@narfation.org</email>
</author>
<published>2026-05-26T07:09:32+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=e9dc4072c54942c05f6b40f4d1d361ad46f5a0a3'/>
<id>urn:sha1:e9dc4072c54942c05f6b40f4d1d361ad46f5a0a3</id>
<content type='text'>
With commit 86898fa6b8cd ("workqueue: Implement disable/enable for
(delayed) work items"), work queues gained the ability to permanently
disallow re-queuing of work items. This is particularly important during
object teardown, where a work item must not be re-armed after shutdown
begins.

Convert all cancel_work_sync() and cancel_delayed_work_sync() call sites to
their disable_* equivalents to clarify the intent to prevent re-arming
after teardown.

Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
</content>
</entry>
<entry>
<title>batman-adv: bla: annotate lasttime access with READ/WRITE_ONCE</title>
<updated>2026-06-03T06:25:11+00:00</updated>
<author>
<name>Sven Eckelmann</name>
<email>sven@narfation.org</email>
</author>
<published>2026-05-26T19:50:51+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=98b0fb191c878a64cbaebfe231d96d57576acf8c'/>
<id>urn:sha1:98b0fb191c878a64cbaebfe231d96d57576acf8c</id>
<content type='text'>
The lasttime field for claim, backbone_gw, and loopdetect tracks the
jiffies value of the most recent activity and is used to detect timeouts.
These accesses are not consistently protected by a lock, so
READ_ONCE/WRITE_ONCE must be used to prevent data races caused by compiler
optimizations.

Cc: stable@kernel.org
Fixes: 23721387c409 ("batman-adv: add basic bridge loop avoidance code")
Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
</content>
</entry>
<entry>
<title>batman-adv: replace non-atomic meshif config fields with (READ|WRITE)_ONCE</title>
<updated>2026-06-01T12:22:00+00:00</updated>
<author>
<name>Sven Eckelmann</name>
<email>sven@narfation.org</email>
</author>
<published>2026-05-12T17:37:05+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=6a4f30e6e34cd15f44ffdb0a4991ff3a5a5b8f82'/>
<id>urn:sha1:6a4f30e6e34cd15f44ffdb0a4991ff3a5a5b8f82</id>
<content type='text'>
The meshif configuration values are only accessed as plain loads/stores and
do not require full atomic_t semantics. Convert these fields to native
integer types and replace their users with READ_ONCE()/WRITE_ONCE() to
avoid load/store tearing.

Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
</content>
</entry>
<entry>
<title>batman-adv: add missing includes</title>
<updated>2026-05-29T19:19:21+00:00</updated>
<author>
<name>Sven Eckelmann</name>
<email>sven@narfation.org</email>
</author>
<published>2026-05-03T20:46:14+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=b8fbbfe81d3e9678290923f374d700aa03fa8d4e'/>
<id>urn:sha1:b8fbbfe81d3e9678290923f374d700aa03fa8d4e</id>
<content type='text'>
Some of the recent fixes required features from new header files. There is
currently no build problem because transitive includes take care of it. But
the batman-adv source code tries to avoid the dependency to
transitive/implicite includes because it has no control over them and they
might get removed at some point.

Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
</content>
</entry>
<entry>
<title>batman-adv: bla: avoid NULL-ptr deref for claim via dropped interface</title>
<updated>2026-05-19T08:43:54+00:00</updated>
<author>
<name>Sven Eckelmann</name>
<email>sven@narfation.org</email>
</author>
<published>2026-05-19T07:23:49+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=f80d3d98d2ff78d9e2fe5d68b1f45948c4f7bd24'/>
<id>urn:sha1:f80d3d98d2ff78d9e2fe5d68b1f45948c4f7bd24</id>
<content type='text'>
Without rtnl_lock held, a hardif might be retrieved as primary interface of
a meshif, but then (while operating on this interface) getting decoupled
from the mesh interface. In this case, the meshif still exists but the
pointer from the primary hardif to the meshif is set to NULL.

The mesh_iface must be checked first to be non-NULL before continuing to
send an ARP request using meshif.

Cc: stable@kernel.org
Fixes: 23721387c409 ("batman-adv: add basic bridge loop avoidance code")
Reported-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Reported-by: syzbot+9fdcc9f05a98a540b816@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=9fdcc9f05a98a540b816
Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
</content>
</entry>
<entry>
<title>batman-adv: bla: avoid double decrement of bla.num_requests</title>
<updated>2026-05-19T07:09:34+00:00</updated>
<author>
<name>Sven Eckelmann</name>
<email>sven@narfation.org</email>
</author>
<published>2026-05-12T07:13:31+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=83ab69bd12b80f6ea169c8bea6977701b53a043d'/>
<id>urn:sha1:83ab69bd12b80f6ea169c8bea6977701b53a043d</id>
<content type='text'>
The bla.num_requests is increased when no request_sent was in progress. And
it is decremented in various places (announcement was received, backbone is
purged, periodic work). But the check if the request_sent is actually set
to a specific state and the atomic_dec/_inc are not safe because they are
not atomic (TOCTOU) and multiple such code portions can run concurrently.

At the same time, it is necessary to modify request_sent (state) and
bla.num_requests atomically. Otherwise batadv_bla_send_request() might set
request_sent to 1 and is interrupted.  batadv_handle_announce() can then
set request_sent back to 0 and decrement num_requests before
batadv_bla_send_request() incremented it.

The two operations must therefore be locked. And since state (request_sent)
and wait_periods are only accessed inside this lock, they can be converted
to simpler datatypes. And to avoid that the bla.num_requests is touched by
a parallel running context with a valid backbone_gw reference after
batadv_bla_purge_backbone_gw() ran, a third state "stopped" is required to
correctly signal that a backbone_gw is in the state of being cleaned up.

Cc: stable@kernel.org
Fixes: 23721387c409 ("batman-adv: add basic bridge loop avoidance code")
Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
</content>
</entry>
<entry>
<title>batman-adv: bla: fix report_work leak on backbone_gw purge</title>
<updated>2026-05-19T07:09:34+00:00</updated>
<author>
<name>Sven Eckelmann</name>
<email>sven@narfation.org</email>
</author>
<published>2026-05-10T09:43:20+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=0459430add32ea41f3e2ef9351610e6d33627a6b'/>
<id>urn:sha1:0459430add32ea41f3e2ef9351610e6d33627a6b</id>
<content type='text'>
batadv_bla_purge_backbone_gw() removes stale backbone gateway entries,
but fails to properly handle their associated report_work:

- If report_work is running, the purge must wait for it to finish before
  freeing the backbone_gw, otherwise the worker may access freed memory
  (e.g. bat_priv).
- If report_work is pending, the purge must cancel it and release the
  reference held for that pending work item.

The previous implementation called hlist_for_each_entry_safe() inside a
spin_lock_bh() section, but cancel_work_sync() may sleep and therefore
cannot be called from within a spinlock-protected region.

Restructure the loop to handle one entry per spinlock critical section:
acquire the lock, find the next entry to purge, remove it from the hash
list, then release the lock before calling cancel_work_sync() and
dropping the hash_entry reference. Repeat until no more entries require
purging.

Cc: stable@kernel.org
Fixes: 23721387c409 ("batman-adv: add basic bridge loop avoidance code")
Reviewed-by: Simon Wunderlich &lt;sw@simonwunderlich.de&gt;
Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
</content>
</entry>
<entry>
<title>batman-adv: bla: put backbone reference on failed claim hash insert</title>
<updated>2026-05-08T12:29:02+00:00</updated>
<author>
<name>Sven Eckelmann</name>
<email>sven@narfation.org</email>
</author>
<published>2026-05-06T20:20:52+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=ba9d20ee9076dac32c371116bacbe72480eb356c'/>
<id>urn:sha1:ba9d20ee9076dac32c371116bacbe72480eb356c</id>
<content type='text'>
When batadv_bla_add_claim() fails to insert a new claim into the hash, it
leaked a reference to the backbone_gw for which the claim was intended.
Call batadv_backbone_gw_put() on the error path to release the reference
and avoid leaking the backbone_gw object.

Cc: stable@kernel.org
Fixes: 3db0decf1185 ("batman-adv: Fix non-atomic bla_claim::backbone_gw access")
Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
</content>
</entry>
</feed>
