Skip to content

batman-adv: Add inconsistent nl dump detection

Sven Eckelmann batman 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9batman-adv: Add compat for genl_dump_check_consistentcompat-include/net/genetlink.h+45 -00 replies
2/9batman-adv: Add inconsistent gateway netlink dump detectionnet/batman-adv/bat_iv_ogm.c net/batman-adv/bat_v.c net/batman-adv/gateway_client.c +2 more+41 -190 replies
3/9batman-adv: Add inconsistent hardif netlink dump detectionnet/batman-adv/hard-interface.c net/batman-adv/main.c net/batman-adv/main.h +1 more+19 -100 replies
4/9batman-adv: Store modification counter via hash helpersnet/batman-adv/hash.c net/batman-adv/hash.h+8 -00 replies
5/9batman-adv: Add inconsistent backbone netlink dump detectionnet/batman-adv/bridge_loop_avoidance.c+23 -180 replies
6/9batman-adv: Add inconsistent claim netlink dump detectionnet/batman-adv/bridge_loop_avoidance.c+23 -180 replies
7/9batman-adv: Add inconsistent dat netlink dump detectionnet/batman-adv/distributed-arp-table.c+23 -190 replies
8/9batman-adv: Add inconsistent local TT netlink dump detectionnet/batman-adv/translation-table.c+23 -180 replies
9/9batman-adv: Add inconsistent multicast netlink dump detectionnet/batman-adv/multicast.c+28 -230 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [B.A.T.M.A.N.] [PATCH 0/9] batman-adv: Add inconsistent nl dump detection

The netlink dump functionality transfers a large number of entries from the kernel to userspace. It is rather likely that the transfer has to interrupted and later continued. During that time, it can happen that either new entries are added or removed. The userspace could than either receive some entries multiple times or miss entries.

Commit 670dc2833d14 ("netlink: advertise incomplete dumps") introduced a mechanism to inform userspace about this problem. Userspace can then decide whether it is necessary or not to retry dumping the information again.

The netlink dump functions have to be switched to exclusive locks to avoid changes while the current message is prepared. And an external generation sequence counter is introduced which tracks all modifications of the list/hash.

There some netlink dump commands which were not yet modified. These datastructures use subentries (or entries for multiple main object) which makes mapping to a generation sequence counter more problematic:

* originator
* neighbor list (multiple interfaces make it harder)
* global translation table

Also the batadv_algo stuff was ignored because it doesn't even have locks and is not supposed to be modified at runtime.

Kind regards,
Sven

Sven Eckelmann (9):
batman-adv: Add compat for genl_dump_check_consistent
batman-adv: Add inconsistent gateway netlink dump detection
batman-adv: Add inconsistent hardif netlink dump detection
batman-adv: Store modification counter via hash helpers
batman-adv: Add inconsistent backbone netlink dump detection
batman-adv: Add inconsistent claim netlink dump detection
batman-adv: Add inconsistent dat netlink dump detection
batman-adv: Add inconsistent local TT netlink dump detection
batman-adv: Add inconsistent multicast netlink dump detection

 compat-include/net/genetlink.h         | 45 ++++++++++++++
 net/batman-adv/bat_iv_ogm.c            | 24 +++++---
 net/batman-adv/bat_v.c                 | 26 +++++---
 net/batman-adv/bridge_loop_avoidance.c | 82 +++++++++++++++-----------
 net/batman-adv/distributed-arp-table.c | 42 +++++++------
 net/batman-adv/gateway_client.c        |  3 +
 net/batman-adv/hard-interface.c        |  3 +
 net/batman-adv/hash.c                  |  2 +
 net/batman-adv/hash.h                  |  6 ++
 net/batman-adv/main.c                  |  3 +
 net/batman-adv/main.h                  |  1 +
 net/batman-adv/multicast.c             | 51 ++++++++--------
 net/batman-adv/netlink.c               | 24 ++++----
 net/batman-adv/translation-table.c     | 41 +++++++------
 net/batman-adv/types.h                 |  5 +-
 15 files changed, 233 insertions(+), 125 deletions(-)
 create mode 100644 compat-include/net/genetlink.h
Signature · 1 line
2.19.1