[PATCH][ksmbd] fix UAF in ksmbd_alloc_work_struct
From: Nathan French
Date: Sun Aug 20 2023 - 22:44:01 EST
avoid oops accessing null work struct pointer
Fixes: bdf1b0e2a1ea ("ksmbd_alloc_work_struct")
Addresses-Coverity: 1566875 ("Explicit null dereference")
Reviewed-by: Jackson Winslow <jackwinslow35@xxxxxxxxx>
Signed-off-by: Nathan French <nathanmfrench17@xxxxxxxxx>
diff --git a/fs/smb/server/ksmbd_work.c b/fs/smb/server/ksmbd_work.c
index 51def3ca74c0..9411f7e32a3c 100644
--- a/fs/smb/server/ksmbd_work.c
+++ b/fs/smb/server/ksmbd_work.c
@@ -33,7 +33,7 @@ struct ksmbd_work *ksmbd_alloc_work_struct(void)
GFP_KERNEL);
if (!work->iov) {
kmem_cache_free(work_cache, work);
- work = NULL;
+ return NULL;
}
}
return work;
Attachment:
0001-ksmbd-fix-UAF-in-ksmbd_alloc_work_struct.patch
Description: Binary data