scsi: target: core: Fix iSCSI ISID use-after-free in REGISTER AND MOVE
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 3.3, 5.10.261, 5.15.212, 6.1.178, 6.6.145, and 3 more
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
- Exploitation: none
- Automatable: yes
- Technical impact: total
Summary
In the Linux kernel, the following vulnerability has been resolved: scsi: target: core: Fix iSCSI ISID use-after-free in REGISTER AND MOVE core_scsi3_emulate_pro_register_and_move() maps the PERSISTENT RESERVE OUT parameter list with transport_kmap_data_sg() and parses the destination TransportID with target_parse_pr_out_transport_id(). For an iSCSI TransportID (FORMAT CODE 01b), iscsi_parse_pr_out_transport_id() returns the ISID in iport_ptr as a raw pointer into that mapped buffer. The function then unmaps the buffer with transport_kunmap_data_sg() before dereferencing iport_ptr in strcmp(), __core_scsi3_locate_pr_reg() and core_scsi3_alloc_registration(). When the parameter list spans more than one page (PARAMETER LIST LENGTH > 4096), transport_kmap_data_sg() uses vmap() and transport_kunmap_data_sg() does vunmap(), so the kernel virtual address backing iport_ptr is torn down and every subsequent dereference is a use-after-free read of the unmapped region. Keep the parameter list mapped until iport_ptr is no longer needed: drop the early transport_kunmap_data_sg() and unmap once on the success path, right before returning. The error paths already unmap through the existing "if (buf) transport_kunmap_data_sg(cmd)" at the out: label, which now runs on every post-map error exit because buf is no longer cleared early. Only reads of the mapping happen while spinlocks are held; the map and unmap calls remain outside any lock. The sibling caller core_scsi3_decode_spec_i_port() already uses the buffer before unmapping it and is left unchanged.
Timeline
- CVE published
- CISA SSVC assessment
Exploitation: none · Automatable: yes · Technical impact: total
- Record last updated
Affected versions
- Linux Linux
From 4949314c7283ea4f9ade182ca599583b89f7edd6 · fixed in 7d56f5c868d92c9d504a34a3ea450bce481c7f63; From 4949314c7283ea4f9ade182ca599583b89f7edd6 · fixed in 59a2a5a37dc49a641ad6bc64aee34e5a61025ffd; From 4949314c7283ea4f9ade182ca599583b89f7edd6 · fixed in 9f8076cc73dfa6b10155978c160587e986b22169; From 4949314c7283ea4f9ade182ca599583b89f7edd6 · fixed in a040004846f1fbe687f6ec76d9ccc27b4ead42e4; From 4949314c7283ea4f9ade182ca599583b89f7edd6 · fixed in 05b3e37433cf2eaf8867f1c16528aa347bb212ab; From 4949314c7283ea4f9ade182ca599583b89f7edd6 · fixed in cb7bdae7fba404852ade34b0c1445fbaf3e54fbb; From 4949314c7283ea4f9ade182ca599583b89f7edd6 · fixed in ef2ee18fec92088c7d8877baf7674e89389ccd66; From 4949314c7283ea4f9ade182ca599583b89f7edd6 · fixed in fda6a1f3c3d7047b5ce5654487649c2daa738bfc; From 3.2.9 · fixed in 3.3
- Linux Linux
3.3
- KernelLinux
From 3.3.0 · fixed in 5.10.261; From 5.11.0 · fixed in 5.15.212; From 5.16.0 · fixed in 6.1.178; From 6.2.0 · fixed in 6.6.145; From 6.7.0 · fixed in 6.12.97; From 6.13.0 · fixed in 6.18.40; From 6.19.0 · fixed in 7.1.5
References 8
git.kernel.org
- stable/c/7d56f5c868d92c9d504a34a3ea450bce481c7f63
- stable/c/59a2a5a37dc49a641ad6bc64aee34e5a61025ffd
- stable/c/9f8076cc73dfa6b10155978c160587e986b22169
- stable/c/a040004846f1fbe687f6ec76d9ccc27b4ead42e4
- stable/c/05b3e37433cf2eaf8867f1c16528aa347bb212ab
- stable/c/cb7bdae7fba404852ade34b0c1445fbaf3e54fbb
- stable/c/ef2ee18fec92088c7d8877baf7674e89389ccd66
- stable/c/fda6a1f3c3d7047b5ce5654487649c2daa738bfc