Project

General

Profile

Actions

Bug #440

open

tt: potential update of common.flags by multiple callers

Added by Sven Eckelmann 4 months ago. Updated about 1 month ago.

Status:
In Progress
Priority:
Normal
Target version:
Start date:
06/04/2026
Due date:
% Done:

0%

Estimated time:

Description

Does the code in batadv_tt_local_add allow concurrent unprotected updates to tt_local->common.flags and tt_global->common.flags?

Because batadv_interface_tx (the ndo_start_xmit handler) is configured with lltx = true, it executes without the netdev tx lock. This could allow multiple CPUs processing outgoing packets from the same client MAC to call batadv_tt_local_add() concurrently.

A concurrent execution could cause one CPU to overwrite the flag updates of another via non-atomic read-modify-write operations (|= and &=). For example, if CPU A clears the BATADV_TT_CLIENT_ROAM flag while CPU B simultaneously sets the BATADV_TT_CLIENT_WIFI flag, could the ROAM flag clearance be permanently lost, leaving the client stuck in an incorrect roaming state?

See https://sashiko.dev/#/patchset/20260603072527.174487-1-sw@simonwunderlich.de?part=15


Related issues 1 (1 open — 0 closed)

Is duplicate of batman-adv - Bug #404: KCSAN: data-race in batadv_tt_local_add / batadv_tt_local_addNewAntonio Quartulli11/08/2019

Actions
Actions #1

Updated by Sven Eckelmann 4 months ago

  • Description updated (diff)
Actions #2

Updated by Sven Eckelmann 4 months ago

  • Description updated (diff)
Actions #3

Updated by Sven Eckelmann 4 months ago

  • Is duplicate of Bug #404: KCSAN: data-race in batadv_tt_local_add / batadv_tt_local_add added
Actions #5

Updated by Sven Eckelmann 3 months ago

  • Status changed from New to Resolved
  • Target version set to 2026.3
Actions #6

Updated by Sven Eckelmann 2 months ago

  • Status changed from Resolved to In Progress
  • Assignee changed from Antonio Quartulli to batman-adv developers
  • Target version deleted (2026.3)

Was rejected by the netdev maintainers because they want it implemented using spinlocks.

Actions #7

Updated by Sven Eckelmann 2 months ago

A new approach (with spinlocks) was posted here: https://patchwork.open-mesh.org/project/b.a.t.m.a.n./list/?series=851

Actions #8

Updated by Sven Eckelmann about 1 month ago

  • Target version set to 2026.04
Actions

Also available in: Atom PDF