ksmbd: fix an oops in error handling in smb2_open()
Subsystems (3)
PATCH 1/1 ksmbd: fix an oops in error handling in smb2_open()
If smb2_get_name() then "name" is an error pointer. In the clean up code, we try to kfree() it and that will lead to an Oops. Set it to NULL instead.
Fixes e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Signed-off-by Dan Carpenter <[email protected]>
--- fs/ksmbd/smb2pdu.c | 1 + 1 file changed, 1 insertion(+)
fs/ksmbd/smb2pdu.c +1 -0
@@ -2462,6 +2462,7 @@ int smb2_open(struct ksmbd_work *work) rc =PTR_ERR (name);if (rc != -ENOMEM ) rc = -ENOENT ; + name =NULL ; goto err_out1; }
Signature · 1 line
2.20.1
Namjae Jeon
maintainer2021-07-29 23:15 GMT+09:00, Dan Carpenter <[email protected]>:
Quoted 6 lines
If
smb2_get_name()then "name" is an error pointer. In the clean up code, we try tokfree()it and that will lead to an Oops. Set it to NULL instead.Fixes e2f34481b24d ("cifsd: add server-side procedures for SMB3")Signed-off-by Dan Carpenter <[email protected]>
I will apply, Thanks for your patch!