random: fix possible sleeping allocation from irq context
authorTheodore Ts'o <tytso@mit.edu>
Mon, 23 Apr 2018 22:51:28 +0000 (18:51 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 May 2018 19:58:08 +0000 (12:58 -0700)
commitffc5b50a2b53d180d977b969034cad1a9fb45d8b
treea8e02285d94bcdab6d6b606e0455d6e20c007133
parent812b51a630005ed8d0a947bece1f430474b724bf
random: fix possible sleeping allocation from irq context

commit 6c1e851c4edc13a43adb3ea4044e3fc8f43ccf7d upstream.

We can do a sleeping allocation from an irq context when CONFIG_NUMA
is enabled.  Fix this by initializing the NUMA crng instances in a
workqueue.

Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reported-by: syzbot+9de458f6a5e713ee8c1a@syzkaller.appspotmail.com
Fixes: 8ef35c866f8862df ("random: set up the NUMA crng instances...")
Cc: stable@vger.kernel.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/random.c