Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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()

+1 -1
+1 -1
kernel/fork.c
··· 1977 1977 * to stop root fork bombs. 1978 1978 */ 1979 1979 retval = -EAGAIN; 1980 - if (nr_threads >= max_threads) 1980 + if (data_race(nr_threads >= max_threads)) 1981 1981 goto bad_fork_cleanup_count; 1982 1982 1983 1983 delayacct_tsk_init(p); /* Must remain after dup_task_struct() */