diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2012-10-05 10:43:31 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-10-09 14:17:00 +0200 |
commit | 4dcc2a4d6c37c36155ea6d6305f15e599531b862 (patch) | |
tree | d597bfa9c7ca679688bcb22ee45f232a6fe1c16b /arch/s390/include/asm/chsc.h | |
parent | 9be5f34f3f00828dfe4012578b6467a31f408eab (diff) |
s390/chsc: make headers usable
Make sure that exported headers are save to be included by userspace
exploiting /dev/chsc.
Reported-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/chsc.h')
-rw-r--r-- | arch/s390/include/asm/chsc.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/s390/include/asm/chsc.h b/arch/s390/include/asm/chsc.h index aea451fd182..1c6a7f85a58 100644 --- a/arch/s390/include/asm/chsc.h +++ b/arch/s390/include/asm/chsc.h @@ -1,7 +1,7 @@ /* * ioctl interface for /dev/chsc * - * Copyright IBM Corp. 2008 + * Copyright IBM Corp. 2008, 2012 * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com> */ @@ -9,9 +9,12 @@ #define _ASM_CHSC_H #include <linux/types.h> +#include <linux/ioctl.h> #include <asm/chpid.h> #include <asm/schid.h> +#define CHSC_SIZE 0x1000 + struct chsc_async_header { __u16 length; __u16 code; @@ -23,15 +26,14 @@ struct chsc_async_header { struct chsc_async_area { struct chsc_async_header header; - __u8 data[PAGE_SIZE - 16 /* size of chsc_async_header */]; + __u8 data[CHSC_SIZE - sizeof(struct chsc_async_header)]; } __attribute__ ((packed)); - struct chsc_response_struct { __u16 length; __u16 code; __u32 parms; - __u8 data[PAGE_SIZE - 8]; + __u8 data[CHSC_SIZE - 2 * sizeof(__u16) - sizeof(__u32)]; } __attribute__ ((packed)); struct chsc_chp_cd { |