s390/pci: Fix leak of uninitialized kernel data in SCLP report
Impact
In the Linux kernel, the following vulnerability has been resolved:
Source excerpt · LinuxAffected packages
Affected products
Vendor version evidence. Product records are separate from automatic dependency matching.
Linux · Linux
Other versions: unaffected
| Version / range | Source status |
|---|---|
| 368704a65be8620df795ccbeb44e025dafbc3e1f to before ba5001db9bb23ff7d2ea328c405c287ffb07786f | affected |
| 368704a65be8620df795ccbeb44e025dafbc3e1f to before 126a7c227d8543e13903dd5622640c1f0fcc5a16 | affected |
| 368704a65be8620df795ccbeb44e025dafbc3e1f to before 8ac60ae2a307a50b599bf5d300b448d638f3ba29 | affected |
Linux · Linux
Other versions: affected
| Version / range | Source status |
|---|---|
| 4.7 | affected |
| 0 to before 4.7 | unaffected |
| 6.18.59 through 6.18.* (inclusive) | unaffected |
| 7.2.13 through 7.2.* (inclusive) | unaffected |
| 7.3 through * (inclusive) | unaffected |
Original source description
In the Linux kernel, the following vulnerability has been resolved:
s390/pci: Fix leak of uninitialized kernel data in SCLP report
While report_error_write() checks that the provided buffer is at least as large as the header struct, but not that it is large enough to contain the report with the length claimed by report->length. If user-space provides a short buffer, meaning a larger report->length than the actually written payload, up to around 4K of kernel data from past the kmalloc(len + 1) sized buffer allocated in kernfs_fop_write_iter() will leak into the SCLP report.
However, as the entity processing the SCLP is privileged and able to access at least the page including the report, this does not leak data that entity could not access but it is still an out of bounds read and a malformed error report that should be rejected.