Namjae Jeon 83dcedd554 ksmbd: fix infinite loop in ksmbd_conn_handler_loop()
If kernel_recvmsg() return -EAGAIN in ksmbd_tcp_readv() and go round
again, It will cause infinite loop issue. And all threads from next
connections would be doing that. This patch add max retry count(2) to
avoid it. kernel_recvmsg() will wait during 7sec timeout and try to
retry two time if -EAGAIN is returned. And add flags of kvmalloc to
__GFP_NOWARN and __GFP_NORETRY to disconnect immediately without
retrying on memory alloation failure.

Fixes: 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers")
Cc: stable@vger.kernel.org
Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-18259
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
2023-01-01 22:49:24 -06:00
..
2021-06-28 16:28:31 +09:00
2021-11-11 19:22:58 -06:00
2021-06-28 16:28:31 +09:00
2021-07-02 16:27:10 +09:00
2021-06-28 16:28:31 +09:00
2022-04-14 20:56:13 -05:00
2022-10-20 10:13:27 +02:00
2021-06-28 16:28:31 +09:00
2021-06-28 16:28:31 +09:00
2021-06-28 16:28:31 +09:00
2021-06-28 16:28:31 +09:00
2022-12-12 18:46:39 -08:00
2022-10-19 12:55:42 +02:00