[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1496331796.690355173@decadent.org.uk>
Date: Thu, 01 Jun 2017 16:43:16 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org,
"Peter Oberparleiter" <oberpar@...ux.vnet.ibm.com>,
"Cornelia Huck" <cornelia.huck@...ibm.com>,
"Martin Schwidefsky" <schwidefsky@...ibm.com>,
"Sebastian Ott" <sebott@...ux.vnet.ibm.com>
Subject: [PATCH 3.16 156/212] s390/chsc: Add exception handler for CHSC
instruction
3.16.44-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Peter Oberparleiter <oberpar@...ux.vnet.ibm.com>
commit 77759137248f34864a8f7a58bbcebfcf1047504a upstream.
Prevent kernel crashes due to unhandled exceptions raised by the CHSC
instruction which may for example be triggered by invalid ioctl data.
Fixes: 64150adf89df ("s390/cio: Introduce generic synchronous CHSC IOCTL")
Signed-off-by: Peter Oberparleiter <oberpar@...ux.vnet.ibm.com>
Reviewed-by: Sebastian Ott <sebott@...ux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@...ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@...ibm.com>
[bwh: Backported to 3.16: adjust filename]
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
drivers/s390/cio/ioasm.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--- a/drivers/s390/cio/ioasm.h
+++ b/drivers/s390/cio/ioasm.h
@@ -138,13 +138,15 @@ static inline int tpi(struct tpi_info *a
static inline int chsc(void *chsc_area)
{
typedef struct { char _[4096]; } addr_type;
- int cc;
+ int cc = -EIO;
asm volatile(
" .insn rre,0xb25f0000,%2,0\n"
- " ipm %0\n"
+ "0: ipm %0\n"
" srl %0,28\n"
- : "=d" (cc), "=m" (*(addr_type *) chsc_area)
+ "1:\n"
+ EX_TABLE(0b, 1b)
+ : "+d" (cc), "=m" (*(addr_type *) chsc_area)
: "d" (chsc_area), "m" (*(addr_type *) chsc_area)
: "cc");
return cc;
Powered by blists - more mailing lists