SYSCTL: Use RCU to avoid races with string sysctls v2
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest9 patches 14 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | Add rcustring ADT for RCU protected strings v2include/ lib/ lib/ | +137 | 7 replies | |
| 2/9 | Add a kernel_address() that works for data tooinclude/ kernel/ | +19 | 5 replies | |
| 3/9 | SYSCTL: Add proc_rcu_string to manage sysctls using rcu stringsinclude/ kernel/ kernel/ | +69 | 0 replies | |
| 4/9 | SYSCTL: Use RCU strings for core_pattern sysctlfs/ kernel/ | +8 | 2 replies | |
| 5/9 | SYSCTL: Add call_usermodehelper_cleanup()include/ | +10 | 0 replies | |
| 6/9 | SYSCTL: Convert modprobe_path to proc_rcu_string()kernel/ kernel/ | +30 | 0 replies | |
| 7/9 | SYSCTL: Convert poweroff_command to proc_rcu_stringinclude/ kernel/ kernel/ | +8 | 0 replies | |
| 8/9 | SYSCTL: Convert hotplug helper string to proc_rcu_string()include/ kernel/ lib/ | +34 | 0 replies | |
| 9/9 | SYSCTL: Use RCU protected sysctl for ocfs group add helperfs/ | +13 | 0 replies |
Reviews trailers per patch
2 of 9 patches have a Reviewed-by or Acked-by.
| Patch | Greg Kroah-Hartman | Paul E. McKenney |
|---|---|---|
| 1/9 | R-b | |
| 2/9 | ||
| 3/9 | ||
| 4/9 | ||
| 5/9 | ||
| 6/9 | ||
| 7/9 | ||
| 8/9 | A-b | |
| 9/9 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH] [0/9] SYSCTL: Use RCU to avoid races with string sysctls v2
v2 version that addresses all the earlier review comments minus patches that were already merged.
I think this one is ready for merge now. Andrew, could you please take it?
---
With BKL-less sysctls most of the writable string sysctls are racy. There is no locking on the reader side, so a reader could see an inconsistent string or worse miss the terminating null and walk of beyond it.
This patch kit adds a new "rcu string" variant to avoid these problems and convers the racy users. One the writer side the strings are always copied to new memory and the readers use rcu_read_lock() to get a stable view. For readers who access the string over sleeps the reader copies the string.
This is all hidden in a new generic "rcu_string" ADT which can be also used for other purposes.
This finally implements all the letters in RCU, most other users leave out the 'C'.
I left some obscure users in architectures (sparc, mips) alone and audited all of the others. The sparc reboot_cmd one has references to asm files which I didn't want to touch and the mips variant seemd just too obscure.
All the others are not racy.
-Andi