diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2023-12-02 02:01:54 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2023-12-08 04:59:45 +0100 |
commit | 78aafb3884f6bc6636efcc1760c891c8500b9922 (patch) | |
tree | 89919fa3bb6a915e2c1b3eb2031581adb02fd6a5 /drivers/crypto/hisilicon/sec2/sec_main.c | |
parent | crypto: sahara - avoid skcipher fallback code duplication (diff) | |
download | linux-78aafb3884f6bc6636efcc1760c891c8500b9922.tar.xz linux-78aafb3884f6bc6636efcc1760c891c8500b9922.zip |
hwrng: core - Fix page fault dead lock on mmap-ed hwrng
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: Edward Adam Davis <eadavis@qq.com>
Reported-by: syzbot+c52ab18308964d248092@syzkaller.appspotmail.com
Fixes: 9996508b3353 ("hwrng: core - Replace u32 in driver API with byte array")
Cc: <stable@vger.kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/hisilicon/sec2/sec_main.c')
0 files changed, 0 insertions, 0 deletions