s390/sclp: fix Secure-IPL facility detection
authorAlexander Egorenkov <egorenar@linux.ibm.com>
Thu, 9 Sep 2021 10:20:56 +0000 (12:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 10:27:56 +0000 (12:27 +0200)
commit0346f8a2c5ecef2fea9932ebeb447c0d957f749a
treed95794f711e2a063f0049d3df01f821c002af5f9
parentcc9d96c9f9e009b8a33385fab9b78ccf92e51d6e
s390/sclp: fix Secure-IPL facility detection

commit d76b14f3971a0638b6cd0da289f8b48acee287d0 upstream.

Prevent out-of-range access if the returned SCLP SCCB response is smaller
in size than the address of the Secure-IPL flag.

Fixes: c9896acc7851 ("s390/ipl: Provide has_secure sysfs attribute")
Cc: stable@vger.kernel.org # 5.2+
Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/s390/char/sclp_early.c