diff options
author | Namjae Jeon <namjae.jeon@samsung.com> | 2021-07-07 14:56:44 +0900 |
---|---|---|
committer | Namjae Jeon <namjae.jeon@samsung.com> | 2021-07-08 15:46:11 +0900 |
commit | b8fc94cdb144467d88f35344076fd3621af93a17 (patch) | |
tree | 994f7c8dbb41f9605040c74e6d81620fa6cb57c5 /fs/ksmbd/transport_rdma.c | |
parent | 6cfbcf2f40e371ce36c030addc539597d058b3a9 (diff) | |
download | linux-b8fc94cdb144467d88f35344076fd3621af93a17.tar.gz linux-b8fc94cdb144467d88f35344076fd3621af93a17.tar.bz2 linux-b8fc94cdb144467d88f35344076fd3621af93a17.zip |
ksmbd: fix read on the uninitialized send_ctx
If st->status is not SMB_DIRECT_CS_CONNECTED, It will jump done label
and accessing the uninitialized send_ctxi by smb_direct_flush_send_list
will cause kernel oops. This patch just return -ENOTCONN to avoid it.
Reported-by: Coverity Scan <scan-admin@coverity.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/ksmbd/transport_rdma.c')
-rw-r--r-- | fs/ksmbd/transport_rdma.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/ksmbd/transport_rdma.c b/fs/ksmbd/transport_rdma.c index 171fb3dd018a..d5728c84a15a 100644 --- a/fs/ksmbd/transport_rdma.c +++ b/fs/ksmbd/transport_rdma.c @@ -1207,10 +1207,8 @@ static int smb_direct_writev(struct ksmbd_transport *t, struct kvec vec; struct smb_direct_send_ctx send_ctx; - if (st->status != SMB_DIRECT_CS_CONNECTED) { - ret = -ENOTCONN; - goto done; - } + if (st->status != SMB_DIRECT_CS_CONNECTED) + return -ENOTCONN; //FIXME: skip RFC1002 header.. buflen -= 4; |