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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random

Pull random fixes from Ted Ts'o:
"Fix a circular locking dependency in random's collection of cputime
used by a thread when it exits."

* tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random:
random: fix locking dependency with the tasklist_lock

+8 -4
+8 -4
drivers/char/random.c
··· 852 852 int reserved) 853 853 { 854 854 unsigned long flags; 855 + int wakeup_write = 0; 855 856 856 857 /* Hold lock while accounting */ 857 858 spin_lock_irqsave(&r->lock, flags); ··· 874 873 else 875 874 r->entropy_count = reserved; 876 875 877 - if (r->entropy_count < random_write_wakeup_thresh) { 878 - wake_up_interruptible(&random_write_wait); 879 - kill_fasync(&fasync, SIGIO, POLL_OUT); 880 - } 876 + if (r->entropy_count < random_write_wakeup_thresh) 877 + wakeup_write = 1; 881 878 } 882 879 883 880 DEBUG_ENT("debiting %zu entropy credits from %s%s\n", 884 881 nbytes * 8, r->name, r->limit ? "" : " (unlimited)"); 885 882 886 883 spin_unlock_irqrestore(&r->lock, flags); 884 + 885 + if (wakeup_write) { 886 + wake_up_interruptible(&random_write_wait); 887 + kill_fasync(&fasync, SIGIO, POLL_OUT); 888 + } 887 889 888 890 return nbytes; 889 891 }