From: sashiko-bot@kernel.org
To: "Harald Freudenberger" <freude@linux.ibm.com>
Cc: linux-s390@vger.kernel.org, "Vasily Gorbik" <gor@linux.ibm.com>,
"Heiko Carstens" <hca@linux.ibm.com>,
"Alexander Gordeev" <agordeev@linux.ibm.com>
Subject: Re: [PATCH v11 4/5] s390/zcrypt: Improve EP11 CPRB domain handling with ASN.1 parsing
Date: Mon, 03 Aug 2026 08:42:22 +0000 [thread overview]
Message-ID: <20260803084222.DE5FC1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260803083339.212885-5-freude@linux.ibm.com>
> The zcrypt_msgtype6_send_ep11_cprb() function uses fragile struct
> overlays to access and modify the domain field in the EP11 CPRB
> payload, creating maintainability and security concerns:
> 1. Struct overlay approach (pld_hdr) assumes fixed payload structure
> and doesn't validate the actual ASN.1 encoding.
> 2. Complex length format detection logic is error-prone and doesn't
> properly validate bounds at each parsing step.
> 3. Direct struct member access bypasses proper ASN.1 validation.
>
> Fix by replacing struct overlays with explicit ASN.1 parsing that
> validates each field (payload tag/length, function tag/length/value,
> optional domain tag/length/value) with proper bounds checking at every
> step. Add asn1_int_encode() helper function to safely write integer
> values with correct endianness conversion. This makes the code
> consistent with the validation pattern introduced with the rework of
> the xcrb_msg_to_type6_ep11cprb_msgx() function.
>
> Fixes: e2c6d91eb8b1 ("s390/zcrypt: Rework domain processing within zcrypt device driver")
> Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260803083339.212885-1-freude@linux.ibm.com?part=4
next prev parent reply other threads:[~2026-08-03 8:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 8:33 [PATCH v11 0/5] Improve code in zcrypt msg type 6 handling Harald Freudenberger
2026-08-03 8:33 ` [PATCH v11 1/5] s390/zcrypt: Fix CPRB memory allocation in zcrypt misc code Harald Freudenberger
2026-08-03 8:42 ` sashiko-bot
2026-08-03 8:33 ` [PATCH v11 2/5] s390/zcrypt: Improve CCA CPRB length and overflow checks Harald Freudenberger
2026-08-03 9:04 ` sashiko-bot
2026-08-03 9:10 ` Harald Freudenberger
2026-08-03 8:33 ` [PATCH v11 3/5] s390/zcrypt: Improve EP11 " Harald Freudenberger
2026-08-03 8:50 ` sashiko-bot
2026-08-03 9:09 ` Harald Freudenberger
2026-08-03 15:03 ` Holger Dengler
2026-08-03 8:33 ` [PATCH v11 4/5] s390/zcrypt: Improve EP11 CPRB domain handling with ASN.1 parsing Harald Freudenberger
2026-08-03 8:42 ` sashiko-bot [this message]
2026-08-03 15:03 ` Holger Dengler
2026-08-03 8:33 ` [PATCH v11 5/5] s390/zcrypt: Pad trailing CCA or EP11 message with zeros Harald Freudenberger
2026-08-03 8:49 ` sashiko-bot
2026-08-03 9:08 ` Harald Freudenberger
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=20260803084222.DE5FC1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=freude@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 \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox