diff options
| author | Harald Freudenberger <freude@linux.ibm.com> | 2026-07-29 13:40:09 +0200 |
|---|---|---|
| committer | Vasily Gorbik <gor@linux.ibm.com> | 2026-07-31 13:31:19 +0200 |
| commit | 36b230835b8a008266aad22168ca52afacc8a58d (patch) | |
| tree | a276dafcbb3f3d0315000910fece206ef138d7ae /drivers/coresight/git@git.tavy.me:linux-stable.git | |
| parent | a9ae0f6dd45c3ccc1d69363f7aea8af179122730 (diff) | |
s390/zcrypt: Fix buffer over-read in cca_cipher2protkey
Add validation of both the actual key buffer size and token length
fields in all the cca_check_sec*token() functions. Additionally check
in cca_gencipherkey() for possible underflow with returned key size.
The CCA token structures contain user-controlled len fields that
were used in operations without proper validation against both the
actual buffer size and minimum token structure size. An attacker
could set this field larger than the actual buffer size, leading to
reading beyond buffer boundaries. This may result in a kernel crash or
exposure of memory via sending this as part of a request down to the
crypto card. Also an attacker could have used a very small len value
and thus enforce a buffer under-run which may produce similar effects
as a over-read.
So now a key must
- key buf length must be at least sizeof the token struct
- the key len field inside the token must fit into the range of
sizeof key token struct ... key buf length
Fixes: 4bc123b18ce6 ("s390/zcrypt: Add low level functions for CCA AES cipher keys")
Cc: stable@vger.kernel.org
Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'drivers/coresight/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions
