linux/fs/ksmbd
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: 0626e6641f ("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
..
mgmt ksmbd: Fix resource leak in ksmbd_session_rpc_open() 2022-12-11 08:33:31 -06:00
asn1.c
asn1.h
auth.c ksmbd: check nt_len to be at least CIFS_ENCPWD_SIZE in ksmbd_decode_ntlmssp_auth_blob 2023-01-01 22:49:24 -06:00
auth.h
connection.c ksmbd: fix infinite loop in ksmbd_conn_handler_loop() 2023-01-01 22:49:24 -06:00
connection.h
crypto_ctx.c
crypto_ctx.h
glob.h
Kconfig
ksmbd_netlink.h ksmbd: set SMB2_SESSION_FLAG_ENCRYPT_DATA when enforcing data encryption for this share 2022-12-11 08:33:31 -06:00
ksmbd_spnego_negtokeninit.asn1
ksmbd_spnego_negtokentarg.asn1
ksmbd_work.c
ksmbd_work.h
Makefile
misc.c
misc.h
ndr.c
ndr.h
nterr.h
ntlmssp.h
oplock.c
oplock.h
server.c ksmbd: Convert to use sysfs_emit()/sysfs_emit_at() APIs 2022-12-11 08:33:32 -06:00
server.h
smb2misc.c
smb2ops.c ksmbd: set SMB2_SESSION_FLAG_ENCRYPT_DATA when enforcing data encryption for this share 2022-12-11 08:33:31 -06:00
smb2pdu.c ksmbd: send proper error response in smb2_tree_connect() 2023-01-01 22:49:24 -06:00
smb2pdu.h ksmbd: replace one-element arrays with flexible-array members 2022-12-11 08:33:31 -06:00
smb_common.c
smb_common.h ksmbd: replace one-element arrays with flexible-array members 2022-12-11 08:33:31 -06:00
smbacl.c
smbacl.h
smbfsctl.h
smbstatus.h
transport_ipc.c
transport_ipc.h
transport_rdma.c
transport_rdma.h
transport_tcp.c ksmbd: fix infinite loop in ksmbd_conn_handler_loop() 2023-01-01 22:49:24 -06:00
transport_tcp.h
unicode.c
unicode.h
uniupr.h
vfs.c fs.acl.rework.v6.2 2022-12-12 18:46:39 -08:00
vfs.h
vfs_cache.c
vfs_cache.h
xattr.h