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().
Created kernel tracking bugs for this issue: Affects: fedora-all [bug 2265803]
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
This was fixed for Fedora with the 6.6.14 stable kernel updates.
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.