Improve code in zcrypt msg type 6 handling
Status from this message: Applied, thank you!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v11 Latest5 patches 6 repliesApplied
- v105 patches 7 repliesSuperseded
- v95 patches 4 repliesSuperseded
Earlier versions · 8
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v8 | 5 patches | 3 replies | Superseded | |
| v7 | 5 patches | 1 reply | Superseded | |
| v6 | 2 patches | 2 replies | Superseded | |
| v5 | 2 patches | 0 replies | Superseded | |
| v4 | 2 patches | 0 replies | Superseded | |
| v3 | 2 patches | 0 replies | Superseded | |
| v2 | 1 patch | 0 replies | Superseded | |
| v1 | 1 patch | 0 replies | Superseded |
Patches in v11 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | s390/zcrypt: Fix CPRB memory allocation in zcrypt misc codedrivers/ drivers/ | +25 | 0 replies | |
| 2/5 | s390/zcrypt: Improve CCA CPRB length and overflow checksdrivers/ | +36 | 1 reply | |
| 3/5 | s390/zcrypt: Improve EP11 CPRB length and overflow checksdrivers/ | +113 | 2 replies | |
| 4/5 | s390/zcrypt: Improve EP11 CPRB domain handling with ASN.1 parsingdrivers/ | +96 | 1 reply | |
| 5/5 | s390/zcrypt: Pad trailing CCA or EP11 message with zerosdrivers/ | +8 | 1 reply |
Reviews trailers per patch
All 5 patches have a Reviewed-by or Acked-by.
| Patch | Holger Dengler |
|---|---|
| 1/5 | R-b |
| 2/5 | R-b |
| 3/5 | R-b |
| 4/5 | R-b |
| 5/5 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v11 0/5] Improve code in zcrypt msg type 6 handling
Rework the limit and overflow checks in the both functions xcrb_msg_to_type6_ep11cprb_msgx() and xcrb_msg_to_type6cprb_msgx(). And more ... all related to the length checks done in these both functions.
Changelog:
v1: initial version, one patch dealing with overflow checks around
the use of the CEIL4 macro in zcrypt_msgtype6.c
v2: Sashiko found a regression: The check
if (ap_msg->len > ap_msg->bufsize)
was missing in the rework. Added again this important check.
v3: - Split into two patches - one for CCA one for EP11
- rework upper limit/overflow check
- add lower limit check
v4: - tried to address all the remaining complains from sashiko.
v5: - Yea, sashiko still found out that the min req size needs
to take the minimal payload header into account. Fixed.
v6: - And finally add padding zeros when there is a gap between
user space provided message size and rounded message size in kernel.
v7: - As requested by Holger, the padding code is now an own patch.
- As the length checks are now so strict the allocation in the both misc files needed adaption to correctly allocate 4 byte rounded up message buffers.
- The EP11 length check has been found to be a mess. The payload is asn1 encoded and now the length parses parts of this payload to extract the needed fields (function value).
- Furthermore another function zcrypt_msgtype6_send_ep11_cprb() also needed to be adjusted to parse the asn1 payload to patch the domain value into the payload.
v8: - Sashiko found out that the cprb free with memory scrub also
needs adaption when the allocation rounds up to a 4 byte boundary. So fixed just this in the first patch of the series.
v9: - hunk for cprb free with 4 byte boundary for EP11 was missing.
- use of put_unaligned_be16/32 instead of direct cast and store.
v10: - make the asn1 parsing bullet proof. Sashiko found that under
some circumstances there could have been an access behind the actual payload.
- Added Cc and Fixes tags.
v11: - Added some Reviewed-by from Holger.
- Fixed the wrong limit checks with offs >= pld_len mentioned by Sashiko.
Harald Freudenberger (5):
s390/zcrypt: Fix CPRB memory allocation in zcrypt misc code s390/zcrypt: Improve CCA CPRB length and overflow checks s390/zcrypt: Improve EP11 CPRB length and overflow checks s390/zcrypt: Improve EP11 CPRB domain handling with ASN.1 parsing s390/zcrypt: Pad trailing CCA or EP11 message with zeros
drivers/s390/crypto/zcrypt_ccamisc.c | 20 +- drivers/s390/crypto/zcrypt_ep11misc.c | 16 +- drivers/s390/crypto/zcrypt_msgtype6.c | 366 ++++++++++++++++++-------- 3 files changed, 278 insertions(+), 124 deletions(-)
--
2.43.0