Skip to content

Fix and improve zcrypt reply message checks

Harald Freudenberger linux-s390 5 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest1 patch 3 repliesApplied
  2. v41 patch 0 repliesSuperseded
  3. v31 patch 1 replySuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v21 patch0 repliesSuperseded
v11 patch0 repliesSuperseded

Changelog from the cover letter

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

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/1s390/zcrypt: Fix and improve zcrypt reply message verification checksdrivers/s390/crypto/zcrypt_msgtype50.c drivers/s390/crypto/zcrypt_msgtype6.c+218 -792 replies

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchHolger Dengler
1/1R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/1] Fix and improve zcrypt reply message checks

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).

v5: Sashiko noticed that for two functions (convert_response_ica and
convert_response_ep11_xcrb) the length check comes before the processing of short error replies - fixed.

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  | 202 ++++++++++++++++++-------
 2 files changed, 218 insertions(+), 79 deletions(-)

--
2.43.0