Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5030d4c7 authored by Herbert Xu's avatar Herbert Xu Committed by Greg Kroah-Hartman
Browse files

hwrng: core - Fix page fault dead lock on mmap-ed hwrng



commit 78aafb3884f6bc6636efcc1760c891c8500b9922 upstream.

There is a dead-lock in the hwrng device read path.  This triggers
when the user reads from /dev/hwrng into memory also mmap-ed from
/dev/hwrng.  The resulting page fault triggers a recursive read
which then dead-locks.

Fix this by using a stack buffer when calling copy_to_user.

Reported-by: default avatarEdward Adam Davis <eadavis@qq.com>
Reported-by: default avatar <syzbot+c52ab18308964d248092@syzkaller.appspotmail.com>
Fixes: 9996508b ("hwrng: core - Replace u32 in driver API with byte array")
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5bc17b4f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment