OSDN Git Service

s390/zcrypt: Explicitly check input data length.
authorHarald Freudenberger <freude@linux.vnet.ibm.com>
Tue, 12 Sep 2017 05:04:26 +0000 (07:04 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 28 Sep 2017 05:29:43 +0000 (07:29 +0200)
commit76b3138192e6ffec334269b1426fd0d100ba962b
tree9cab1644de5f7b0de0d56207c7259eb22a6b8b04
parent08c6df97d65a1cb24393d2051bf12ab05f8d7fb6
s390/zcrypt: Explicitly check input data length.

The function to prepare MEX type 50 ap messages did
not explicitly check for the data length in case of
data > 512 bytes. Instead the function assumes the
boundary check done in the ioctl function will always
reject requests with invalid data length values.
However, screening just the function code may give the
illusion, that there may be a gap which could be
exploited by userspace for buffer overwrite attacks.

Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/crypto/zcrypt_msgtype50.c