s390/cio: Ensure the copied buf is NUL terminated
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
s390/cio: Ensure the copied buf is NUL terminated
Currently, we allocate a lbuf-sized kernel buffer and copy lbuf from userspace to that buffer. Later, we use scanf on this buffer but we don't ensure that the string is terminated inside the buffer, this can lead to OOB read when using scanf. Fix this issue by using memdup_user_nul instead.
From the CVE record · Linux
The Linux kernel's s390/cio code copies data from userspace without ensuring the buffer is NUL-terminated before using scanf. A local user who supplies a buffer without a NUL terminator could trigger an out-of-bounds read; no further user interaction is described.
Engineers running the Linux kernel should check whether their version includes this s390/cio fix; affected versions are not specified.