[PATCH net v2 0/2] net: preserve rps_default_mask on failed writes
From: Yingjie Wang
Date: Thu Oct 29 2026 - 11:15:28 EST
rps_default_mask_sysctl() parses and validates writes in the live
per-netns mask. Both the bitmap parser and housekeeping validation can
modify that mask before returning an error, so a failed write can change
the default applied to RX queues created later.
Parse and validate a temporary mask before publishing it, and add a
regression test for a partially parsed invalid value.
On the base kernel, the new test fails because the mask changes from 1
to 3. With the fix, all ten rps_default_mask selftests pass. Tests with
isolated CPUs also confirm that overflow and housekeeping failures leave
the mask unchanged, while valid writes continue to work.
Changes since v1:
- Parse and validate the temporary mask before taking
rps_default_mask_mutex, as suggested by Wang Zhan.
- Add Wang Zhan's Reviewed-by and Tested-by tags to patch 1.
- Add Kuniyuki Iwashima to Cc.
v1: https://lore.kernel.org/r/cover.1793199118.git.x-professor@xxxxxxxxxxx
Yingjie Wang (2):
net: preserve rps_default_mask on failed writes
selftests: net: check failed rps_default_mask writes
net/core/sysctl_net_core.c | 31 ++++++++++---------
.../testing/selftests/net/rps_default_mask.sh | 23 ++++++++++++++
2 files changed, 40 insertions(+), 14 deletions(-)
base-commit: fcc00b15cb21a6de76826e5012b2c758505f5e65
--
2.43.0