Fix various __task_cred related invalid RCU assumptions
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest9 patches 48 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | sys: Fix missing rcu protection for __task_cred() accesskernel/ | +2 | 28 replies | |
| 2/9 | fs: Add missing rcu protection for __task_cred() in sys_ioprio_getfs/ | +2 | 1 reply | |
| 3/9 | proc: Add missing rcu protection for __task_cred() in task_sig()fs/ | +2 | 1 reply | |
| 4/9 | oom: Add missing rcu protection of __task_cred() in dump_tasksmm/ | +3 | 3 replies | |
| 5/9 | security: Use get_task_cred() in keyctl_session_to_parent()security/ | +5 | 2 replies | |
| 6/9 | signal: Fix racy access to __task_cred in kill_pid_info_as_uid()kernel/ | +10 | 3 replies | |
| 7/9 | signals: Fix more rcu assumptionskernel/ | +7 | 4 replies | |
| 8/9 | Documentation: Fix invalid rcu assumptionsDocumentation/ Documentation/ | +1 | 7 replies | |
| 9/9 | security: Fix invalid rcu assumptions in commentssecurity/ security/ | +1 | 1 reply |
Reviews trailers per patch
8 of 9 patches have a Reviewed-by or Acked-by.
| Patch | Paul E. McKenney | KOSAKI Motohiro | Oleg Nesterov | David Howells | Serge Hallyn |
|---|---|---|---|---|---|
| 1/9 | A-b A-b | A-b | A-b | ||
| 2/9 | A-b | ||||
| 3/9 | A-b | ||||
| 4/9 | R-b | ||||
| 5/9 | A-b | A-b | |||
| 6/9 | A-b A-b | A-b | |||
| 7/9 | |||||
| 8/9 | A-b | ||||
| 9/9 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.
Cover letter [patch 0/9] Fix various __task_cred related invalid RCU assumptions
While auditing the read_lock(&tasklist_lock) sites for a possible conversion to rcu-read_lock() I stumbled over an unprotected user of __task_cred in kernel/sys.c
That caused me to audit all the __task_cred usage sites except in kernel/exit.c.
Most of the usage sites are correct, but some of them trip over invalid assumptions about the protection which is given by RCU.
- spinlocked/preempt_disabled regions are equivalent to rcu_read_lock():
That's wrong. RCU does not guarantee that.
It has been that way due to implementation details and it still is valid for CONFIG_TREE_PREEMPT_RCU=n, but there is no guarantee that this will be the case forever.
- interrupt disabled regions are equivalent to rcu_read_lock():
Wrong again. RCU does not guarantee that.
It's true for current mainline, but again this is an implementation detail and there is no guarantee by the RCU semantics.
Indeed we want to get rid of that to avoid scalability issues on large systems and preempt-rt got already rid of it to a certain extent.
I'm sure we are lucky that CONFIG_TREE_PREEMPT_RCU=y is not yet wide spread and the code pathes are esoteric enough not to trigger that subtle races (some of them might just error out silently).
Nevertheless we need to fix all invalid assumptions about RCU protection.
The following patch series fixes all yet known affected __task_cred() sites, but there is more auditing of all other rcu users necessary.
Thanks,
tglx