Commit d31e313
srcu: Force synchronization for srcu_get_delay()
Currently, srcu_get_delay() can be called concurrently, for example,
by a CPU that is the first to request a new grace period and the CPU
processing the current grace period. Although concurrent access is
harmless, it unnecessarily expands the state space. Additionally,
all calls to srcu_get_delay() are from slow paths.
This commit therefore protects all calls to srcu_get_delay() with
ssp->srcu_sup->lock, which is already held on the invocation from the
srcu_funnel_gp_start() function. While in the area, this commit also
adds a lockdep_assert_held() to srcu_get_delay() itself.
Reported-by: syzbot+16a19b06125a2963eaee@syzkaller.appspotmail.com
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: <bpf@vger.kernel.org>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>1 parent 821ca6f commit d31e313
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
| 651 | + | |
651 | 652 | | |
652 | 653 | | |
653 | 654 | | |
| |||
675 | 676 | | |
676 | 677 | | |
677 | 678 | | |
| 679 | + | |
678 | 680 | | |
679 | 681 | | |
680 | | - | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
681 | 686 | | |
682 | 687 | | |
683 | 688 | | |
| |||
1101 | 1106 | | |
1102 | 1107 | | |
1103 | 1108 | | |
| 1109 | + | |
1104 | 1110 | | |
| 1111 | + | |
1105 | 1112 | | |
1106 | 1113 | | |
1107 | 1114 | | |
| |||
1850 | 1857 | | |
1851 | 1858 | | |
1852 | 1859 | | |
| 1860 | + | |
1853 | 1861 | | |
| 1862 | + | |
1854 | 1863 | | |
1855 | 1864 | | |
1856 | 1865 | | |
| |||
0 commit comments