Bug 2265791 (CVE-2023-52454)

Summary: CVE-2023-52454 kernel: nvmet-tcp: Fix a kernel panic when host sends an invalid H2C PDU length
Product: [Other] Security Response Reporter: Patrick Del Bello <pdelbell>
Component: vulnerabilityAssignee: Product Security <prodsec-ir-bot>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: acaringi, allarkin, aquini, bhu, chwhite, cye, cyin, dbohanno, debarbos, dfreiber, drow, dvlasenk, esandeen, ezulian, hkrzesin, jarod, jburrell, jdenham, jfaracco, jforbes, jlelli, jmeneghi, joe.lawrence, jshortt, jstancek, jwyatt, kcarcia, ldoskova, lgoncalv, lzampier, mleitner, mmilgram, mstowell, nmurray, ptalbert, rparrazo, rrobaina, rvrbovsk, rysulliv, scweaver, sukulkar, tglozar, tyberry, vkumar, wcosta, williams, wmealing, ycote, ykopkova, zhijwang
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: kernel 6.8-rc1 Doc Type: If docs needed, set a value
Doc Text:
A vulnerability was found in the Linux kernel. This flaw allows an attacker to send a malicious command to cause a kernel panic, leading to a denial of service.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2265803    
Bug Blocks: 2265790    

Description Patrick Del Bello 2024-02-24 11:19:54 UTC
nvmet-tcp: Fix a kernel panic when host sends an invalid H2C PDU length

If the host sends an H2CData command with an invalid DATAL,
the kernel may crash in nvmet_tcp_build_pdu_iovec().

Unable to handle kernel NULL pointer dereference at
virtual address 0000000000000000
lr : nvmet_tcp_io_work+0x6ac/0x718 [nvmet_tcp]
Call trace:
  process_one_work+0x174/0x3c8
  worker_thread+0x2d0/0x3e8
  kthread+0x104/0x110

Fix the bug by raising a fatal error if DATAL isn't coherent
with the packet size.
Also, the PDU length should never exceed the MAXH2CDATA parameter which
has been communicated to the host in nvmet_tcp_handle_icreq().

Comment 1 Patrick Del Bello 2024-02-24 11:23:18 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 2265803]

Comment 3 Justin M. Forbes 2024-02-27 00:23:01 UTC
	Issue introduced in 5.0 with commit 872d26a391da and fixed in 5.4.268 with commit ee5e7632e981
	Issue introduced in 5.0 with commit 872d26a391da and fixed in 5.10.209 with commit f775f2621c2a
	Issue introduced in 5.0 with commit 872d26a391da and fixed in 5.15.148 with commit 4cb3cf7177ae
	Issue introduced in 5.0 with commit 872d26a391da and fixed in 6.1.75 with commit 2871aa407007
	Issue introduced in 5.0 with commit 872d26a391da and fixed in 6.6.14 with commit 24e05760186d
	Issue introduced in 5.0 with commit 872d26a391da and fixed in 6.7.2 with commit 70154e8d015c
	Issue introduced in 5.0 with commit 872d26a391da and fixed in 6.8-rc1 with commit efa56305908b

Comment 4 Justin M. Forbes 2024-02-27 00:23:24 UTC
This was fixed for Fedora with the 6.6.14 stable kernel updates.

Comment 8 Alex 2024-06-09 15:06:20 UTC
The result of automatic check (that is developed by Alexander Larkin) for this CVE-2023-52454 is: CHECK	Maybe valid. Check manually. with impact MODERATE (that is approximation based on flags REMOTE DANGER NULLPTR NVME NETWORK  ; these flags parsed automatically based on patche data). Such automatic check happens only for Low/Moderates (and only when not from reporter, but parsing already existing CVE). Highs always checked manually (I check it myself and then we check it again in Remediation team). In rare cases some of the Moderates could be increased to High later.