Linux s390 Architecture development
 help / color / mirror / Atom feed
* [PATCH v4 0/1] Fix and improve zcrypt reply message checks
@ 2026-09-11 13:05 Harald Freudenberger
  2026-09-11 13:05 ` [PATCH v4 1/1] s390/zcrypt: Fix and improve zcrypt reply message verification checks Harald Freudenberger
  0 siblings, 1 reply; 3+ messages in thread
From: Harald Freudenberger @ 2026-09-11 13:05 UTC (permalink / raw)
  To: dengler, fcallies, ifranzki
  Cc: freude, linux-s390, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev

Fix and improve zcrypt reply messages checks of type 6 - CCA and EP11
- and type 50 - ICA.

Changelog:
v1: Initial version
v2: Sashiko complained about not checking offset1/count1 at all if
    count2 for an CCA type6 reply is given. And a check like this was
    in place before the rework. So now offset1/count1 is always
    checked and only if count2 is non zero offset2/count2 is
    additionally checked.
v3: Again Sashiko had some complains which let to a broader review of
    the reply processing functions. Especially the zcrypt_type50.c
    functions convert_type80() and convert_response() got slight but
    significant improvements - and also a mysterious BUG_ON has been
    removed.
v4: Again Sashiko had a complain about my restrictions are too
    tight. So now in convert_response_xcrb() the exact length
    verification is:
	case TYPE86_RSP_CODE:
		...
		if (reply->len < sizeof(struct type86_fmt2_msg) +
		    offsetof(struct CPRBX, cprb_ver_id) +
		    sizeof(msg->cprbx.cprb_ver_id))
			return -EINVAL;
		...
    thus postponing the final length check to the convert function
    (which does the job hopefully correct).

Harald Freudenberger (1):
  s390/zcrypt: Fix and improve zcrypt reply message verification checks

 drivers/s390/crypto/zcrypt_msgtype50.c |  95 ++++++++----
 drivers/s390/crypto/zcrypt_msgtype6.c  | 198 ++++++++++++++++++-------
 2 files changed, 216 insertions(+), 77 deletions(-)

--
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-11 13:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-11 13:05 [PATCH v4 0/1] Fix and improve zcrypt reply message checks Harald Freudenberger
2026-09-11 13:05 ` [PATCH v4 1/1] s390/zcrypt: Fix and improve zcrypt reply message verification checks Harald Freudenberger
2026-09-11 13:19   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox