aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2012-10-05 04:43:31 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2012-10-09 08:17:00 -0400
commit4dcc2a4d6c37c36155ea6d6305f15e599531b862 (patch)
treed597bfa9c7ca679688bcb22ee45f232a6fe1c16b /arch/s390/include/asm
parent9be5f34f3f00828dfe4012578b6467a31f408eab (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')
-rw-r--r--arch/s390/include/asm/chpid.h10
-rw-r--r--arch/s390/include/asm/chsc.h10
2 files changed, 11 insertions, 9 deletions
diff --git a/arch/s390/include/asm/chpid.h b/arch/s390/include/asm/chpid.h
index e5bde9f9291..8af0b92c90c 100644
--- a/arch/s390/include/asm/chpid.h
+++ b/arch/s390/include/asm/chpid.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright IBM Corp. 2007 2 * Copyright IBM Corp. 2007, 2012
3 * Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com> 3 * Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
4 */ 4 */
5 5
@@ -12,10 +12,10 @@
12#define __MAX_CHPID 255 12#define __MAX_CHPID 255
13 13
14struct chp_id { 14struct chp_id {
15 u8 reserved1; 15 __u8 reserved1;
16 u8 cssid; 16 __u8 cssid;
17 u8 reserved2; 17 __u8 reserved2;
18 u8 id; 18 __u8 id;
19} __attribute__((packed)); 19} __attribute__((packed));
20 20
21#ifdef __KERNEL__ 21#ifdef __KERNEL__
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 @@
1/* 1/*
2 * ioctl interface for /dev/chsc 2 * ioctl interface for /dev/chsc
3 * 3 *
4 * Copyright IBM Corp. 2008 4 * Copyright IBM Corp. 2008, 2012
5 * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com> 5 * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
6 */ 6 */
7 7
@@ -9,9 +9,12 @@
9#define _ASM_CHSC_H 9#define _ASM_CHSC_H
10 10
11#include <linux/types.h> 11#include <linux/types.h>
12#include <linux/ioctl.h>
12#include <asm/chpid.h> 13#include <asm/chpid.h>
13#include <asm/schid.h> 14#include <asm/schid.h>
14 15
16#define CHSC_SIZE 0x1000
17
15struct chsc_async_header { 18struct chsc_async_header {
16 __u16 length; 19 __u16 length;
17 __u16 code; 20 __u16 code;
@@ -23,15 +26,14 @@ struct chsc_async_header {
23 26
24struct chsc_async_area { 27struct chsc_async_area {
25 struct chsc_async_header header; 28 struct chsc_async_header header;
26 __u8 data[PAGE_SIZE - 16 /* size of chsc_async_header */]; 29 __u8 data[CHSC_SIZE - sizeof(struct chsc_async_header)];
27} __attribute__ ((packed)); 30} __attribute__ ((packed));
28 31
29
30struct chsc_response_struct { 32struct chsc_response_struct {
31 __u16 length; 33 __u16 length;
32 __u16 code; 34 __u16 code;
33 __u32 parms; 35 __u32 parms;
34 __u8 data[PAGE_SIZE - 8]; 36 __u8 data[CHSC_SIZE - 2 * sizeof(__u16) - sizeof(__u32)];
35} __attribute__ ((packed)); 37} __attribute__ ((packed));
36 38
37struct chsc_chp_cd { 39struct chsc_chp_cd {