Commit 62b5e81
committed
smb: client: Handle kstrdup failures for passwords
JIRA: https://issues.redhat.com/browse/RHEL-65939
CVE: CVE-2024-50120
commit 9a5dd61
Author: Henrique Carvalho <henrique.carvalho@suse.com>
Date: Tue Oct 22 15:21:26 2024 -0300
smb: client: Handle kstrdup failures for passwords
In smb3_reconfigure(), after duplicating ctx->password and
ctx->password2 with kstrdup(), we need to check for allocation
failures.
If ses->password allocation fails, return -ENOMEM.
If ses->password2 allocation fails, free ses->password, set it
to NULL, and return -ENOMEM.
Fixes: c1eb537 ("cifs: allow changing password during remount")
Reviewed-by: David Howells <dhowells@redhat.com
Signed-off-by: Haoxiang Li <make24@iscas.ac.cn>
Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Paulo Alcantara <paalcant@redhat.com>1 parent c84085f commit 62b5e81
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
918 | 918 | | |
919 | 919 | | |
920 | 920 | | |
| 921 | + | |
| 922 | + | |
921 | 923 | | |
922 | 924 | | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
923 | 930 | | |
924 | 931 | | |
925 | 932 | | |
| |||
0 commit comments