From: sashiko-bot@kernel.org
To: "Stefan Haberland" <sth@linux.ibm.com>
Cc: linux-s390@vger.kernel.org, "Heiko Carstens" <hca@linux.ibm.com>,
"Vasily Gorbik" <gor@linux.ibm.com>,
"Alexander Gordeev" <agordeev@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>
Subject: Re: [PATCH 4/4] s390/dasd: Don't trust userspace-supplied result field in format check
Date: Thu, 12 Nov 2026 10:34:37 +0000 [thread overview]
Message-ID: <sashiko-outbox-210949@kernel.org> (raw)
In-Reply-To: <20261112102608.1057852-5-sth@linux.ibm.com>
> 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>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261112102608.1057852-1-sth@linux.ibm.com?part=4
next prev parent reply other threads:[~2026-11-12 10:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 10:26 [PATCH 0/4] s390/dasd: fixes for RCD retry and BIODASDCHECKFMT Stefan Haberland
2026-11-12 10:26 ` [PATCH 1/4] s390/dasd: Fix typo 'immediatly' -> 'immediately' Stefan Haberland
2026-11-12 10:30 ` sashiko-bot
2026-11-12 10:26 ` [PATCH 2/4] s390/dasd: Re-initialize RCD buffer with "V1.0" before every start Stefan Haberland
2026-11-12 10:32 ` sashiko-bot
2026-11-12 10:26 ` [PATCH 3/4] s390/dasd: Fix wrong free and refcount leak in build_check_tcw error path Stefan Haberland
2026-11-12 10:43 ` sashiko-bot
2026-11-12 10:26 ` [PATCH 4/4] s390/dasd: Don't trust userspace-supplied result field in format check Stefan Haberland
2026-11-12 10:34 ` sashiko-bot [this message]
2026-11-12 16:18 ` [PATCH 0/4] s390/dasd: fixes for RCD retry and BIODASDCHECKFMT Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-210949@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sth@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.