diff options
| author | Stefan Haberland <sth@linux.ibm.com> | 2026-11-12 11:26:08 +0100 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2026-11-12 09:18:12 -0700 |
| commit | 7cc2dda4f7aaf596c1796184649007151ff98f8d (patch) | |
| tree | 752dfc156699e52046469b0cafb0af5beb145b62 /kernel | |
| parent | df56f7a6c20a5eb2794c0a7391bde50ba7c8c54b (diff) | |
s390/dasd: Don't trust userspace-supplied result field in format check
BIODASDCHECKFMT used to copy the entire format_check_t struct from
userspace, including the result/unit/rec/num_records/blksize/
key_length fields that are output fields only.
dasd_eckd_format_evaluate_tracks() relies on cdata->result being zero
to decide whether to apply an index correction (i--/pos--) after a
successful check. A caller that pre-sets result to a non-zero value
can suppress that correction, leaving pos advanced past the last valid
entry; the (partially out-of-bounds) fmt_buffer[pos] fields are then
copied back to userspace, leaking heap contents.
Only expect is an Input field; copy just that member in and zero
the rest of cdata.
Fixes: 8fd575200db5 ("s390/dasd: Add new ioctl BIODASDCHECKFMT")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260722103704.1709668-1-sth@linux.ibm.com
Cc: stable@vger.kernel.org #4.7
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Link: https://patch.msgid.link/20261112102608.1057852-5-sth@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions
