Skip to content

Commit 45564bc

Browse files
committed
Merge tag 'for-linus-2020-07-02' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux
Pull data race annotation from Christian Brauner: "This contains an annotation patch for a data race in copy_process() reported by KCSAN when reading and writing nr_threads. The data race is intentional and benign. This is obvious from the comment above the relevant code and based on general consensus when discussing this issue. So simply using data_race() to annotate this as an intentional race seems the best option" * tag 'for-linus-2020-07-02' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux: fork: annotate data race in copy_process()
2 parents 0c7415c + c17d1a3 commit 45564bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/fork.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1977,7 +1977,7 @@ static __latent_entropy struct task_struct *copy_process(
19771977
* to stop root fork bombs.
19781978
*/
19791979
retval = -EAGAIN;
1980-
if (nr_threads >= max_threads)
1980+
if (data_race(nr_threads >= max_threads))
19811981
goto bad_fork_cleanup_count;
19821982

19831983
delayacct_tsk_init(p); /* Must remain after dup_task_struct() */

0 commit comments

Comments
 (0)