Bug 1213426 (CVE-2023-38431)

Summary: VUL-0: CVE-2023-38431: kernel-source,kernel-source-azure,kernel-source-rt: out-of-bounds read in ksmbd_conn_handler_loop
Product: [Novell Products] SUSE Security Incidents Reporter: Thomas Leroy <thomas.leroy>
Component: IncidentsAssignee: Security Team bot <security-team>
Status: RESOLVED FIXED QA Contact: Security Team bot <security-team>
Severity: Normal    
Priority: P3 - Medium CC: jlee, security-team
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
URL: https://smash.suse.de/issue/372757/
Whiteboard:
Found By: Security Response Team Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Thomas Leroy 2023-07-18 10:18:27 UTC
CVE-2023-38431

An issue was discovered in the Linux kernel before 6.3.8.
fs/smb/server/connection.c in ksmbd does not validate the relationship between
the NetBIOS header's length field and the SMB header sizes, via pdu_size in
ksmbd_conn_handler_loop, leading to an out-of-bounds read.

References:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2023-38431
https://www.cve.org/CVERecord?id=CVE-2023-38431
https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.3.8
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/fs/smb/server?id=368ba06881c395f1c9a7ba22203cf8d78b4addc0
Comment 1 Thomas Leroy 2023-07-18 10:18:36 UTC
Only stable ships ksmbd but it already has the fix
Comment 2 Joey Lee 2023-07-24 05:49:05 UTC
(In reply to Thomas Leroy from comment #1)
> Only stable ships ksmbd but it already has the fix


Bug 1213426 (CVE-2023-38431) - VUL-0: CVE-2023-38431: kernel-source,kernel-source-azure,kernel-source-rt: out-of-bounds read in ksmbd_conn_handler_loop [v6.4-rc6~2^2~1]
https://bugzilla.suse.com/show_bug.cgi?id=1213426

commit 368ba06881c395f1c9a7ba22203cf8d78b4addc0
Author: Namjae Jeon <linkinjeon@kernel.org>
Date:   Tue May 30 23:10:31 2023 +0900

    ksmbd: check the validation of pdu_size in ksmbd_conn_handler_loop


Update status

stable      [v6.4, already included]

But, the fs/ksmbd be moved to fs/smb/server since v6.4:

Which means that 15-SP5 or older SLE may still need 443d61d1fa patch. I found that 15-SP5 has 38c8a9a52082 but no 368ba06881c.
Comment 3 Joey Lee 2023-07-24 05:49:44 UTC
Hi Paulo, 

Because this issue relates to samba. Could you please help to handle it? 

If this is not in your area, just reset but assigner to kernel-bugs@suse.de. Kernel Security Sentinel will find other expert.

Thanks a lot!
Comment 4 Joey Lee 2023-07-24 05:55:40 UTC
(In reply to Joey Lee from comment #2)
> (In reply to Thomas Leroy from comment #1)
> > Only stable ships ksmbd but it already has the fix
> 
> 
> Bug 1213426 (CVE-2023-38431) - VUL-0: CVE-2023-38431:
> kernel-source,kernel-source-azure,kernel-source-rt: out-of-bounds read in
> ksmbd_conn_handler_loop [v6.4-rc6~2^2~1]
> https://bugzilla.suse.com/show_bug.cgi?id=1213426
> 
> commit 368ba06881c395f1c9a7ba22203cf8d78b4addc0
> Author: Namjae Jeon <linkinjeon@kernel.org>
> Date:   Tue May 30 23:10:31 2023 +0900
> 
>     ksmbd: check the validation of pdu_size in ksmbd_conn_handler_loop
> 
> 
> Update status
> 
> stable      [v6.4, already included]
> 
> But, the fs/ksmbd be moved to fs/smb/server since v6.4:
> 
> Which means that 15-SP5 or older SLE may still need 443d61d1fa patch. I
                                                      ^^^^^^^^^^ 
                                                          368ba06881c
> found that 15-SP5 has 38c8a9a52082 but no 368ba06881c.

sorry for my typo
Comment 5 Joey Lee 2023-07-24 06:14:13 UTC
(In reply to Joey Lee from comment #2)
> (In reply to Thomas Leroy from comment #1)
> > Only stable ships ksmbd but it already has the fix
> 
> 
> Bug 1213426 (CVE-2023-38431) - VUL-0: CVE-2023-38431:
> kernel-source,kernel-source-azure,kernel-source-rt: out-of-bounds read in
> ksmbd_conn_handler_loop [v6.4-rc6~2^2~1]
> https://bugzilla.suse.com/show_bug.cgi?id=1213426
> 
> commit 368ba06881c395f1c9a7ba22203cf8d78b4addc0
> Author: Namjae Jeon <linkinjeon@kernel.org>
> Date:   Tue May 30 23:10:31 2023 +0900
> 
>     ksmbd: check the validation of pdu_size in ksmbd_conn_handler_loop
> 
> 
> Update status
> 
> stable      [v6.4, already included]
> 
> But, the fs/ksmbd be moved to fs/smb/server since v6.4:
> 
> Which means that 15-SP5 or older SLE may still need 443d61d1fa patch. I
> found that 15-SP5 has 38c8a9a52082 but no 368ba06881c.

I just found that the CONFIG_SMB_SERVER is NOT set in 15-SP5. So we don't need the patch in 15-SP5. 

Reset assigner.
Comment 6 Andrea Mattiazzo 2024-06-07 12:13:19 UTC
All done, closing.