diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-26 16:50:23 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-26 16:50:23 -0400 |
| commit | 68e370289c29e3beac99d59c6d840d470af9dfcf (patch) | |
| tree | f37cd93ef5033687402a08ec29760b8cc65f240a | |
| parent | ac490f4dca9476bf8a309a2cae92ca68b8c5fca6 (diff) | |
| parent | b8a2bbdf02b8c25f7eecce001bcc249a3b65c1b5 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 updates from Martin Schwidefsky:
- wire up the system calls seccomp, getrandom and memfd_create
- use static system information as input to add_device_randomness
- .. and three bug fixes
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
s390/sclp: remove unnecessary XTABS flag
s390/3215: fix tty output containing tabs
s390: wire up memfd_create syscall
s390: add system information as device randomness
s390/kdump: Clear subchannel ID to signal non-CCW/SCSI IPL
s390: wire up seccomp and getrandom syscalls
| -rw-r--r-- | arch/s390/include/uapi/asm/unistd.h | 5 | ||||
| -rw-r--r-- | arch/s390/kernel/compat_wrapper.c | 3 | ||||
| -rw-r--r-- | arch/s390/kernel/ipl.c | 7 | ||||
| -rw-r--r-- | arch/s390/kernel/setup.c | 19 | ||||
| -rw-r--r-- | arch/s390/kernel/syscalls.S | 3 | ||||
| -rw-r--r-- | drivers/s390/char/con3215.c | 20 | ||||
| -rw-r--r-- | drivers/s390/char/sclp_tty.c | 2 |
7 files changed, 54 insertions, 5 deletions
diff --git a/arch/s390/include/uapi/asm/unistd.h b/arch/s390/include/uapi/asm/unistd.h index 3802d2d3a18d..940ac49198db 100644 --- a/arch/s390/include/uapi/asm/unistd.h +++ b/arch/s390/include/uapi/asm/unistd.h | |||
| @@ -283,7 +283,10 @@ | |||
| 283 | #define __NR_sched_setattr 345 | 283 | #define __NR_sched_setattr 345 |
| 284 | #define __NR_sched_getattr 346 | 284 | #define __NR_sched_getattr 346 |
| 285 | #define __NR_renameat2 347 | 285 | #define __NR_renameat2 347 |
| 286 | #define NR_syscalls 348 | 286 | #define __NR_seccomp 348 |
| 287 | #define __NR_getrandom 349 | ||
| 288 | #define __NR_memfd_create 350 | ||
| 289 | #define NR_syscalls 351 | ||
| 287 | 290 | ||
| 288 | /* | 291 | /* |
| 289 | * There are some system calls that are not present on 64 bit, some | 292 | * There are some system calls that are not present on 64 bit, some |
diff --git a/arch/s390/kernel/compat_wrapper.c b/arch/s390/kernel/compat_wrapper.c index 45cdb37aa6f8..faf6caa510dc 100644 --- a/arch/s390/kernel/compat_wrapper.c +++ b/arch/s390/kernel/compat_wrapper.c | |||
| @@ -214,3 +214,6 @@ COMPAT_SYSCALL_WRAP3(finit_module, int, fd, const char __user *, uargs, int, fla | |||
| 214 | COMPAT_SYSCALL_WRAP3(sched_setattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, flags); | 214 | COMPAT_SYSCALL_WRAP3(sched_setattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, flags); |
| 215 | COMPAT_SYSCALL_WRAP4(sched_getattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, size, unsigned int, flags); | 215 | COMPAT_SYSCALL_WRAP4(sched_getattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, size, unsigned int, flags); |
| 216 | COMPAT_SYSCALL_WRAP5(renameat2, int, olddfd, const char __user *, oldname, int, newdfd, const char __user *, newname, unsigned int, flags); | 216 | COMPAT_SYSCALL_WRAP5(renameat2, int, olddfd, const char __user *, oldname, int, newdfd, const char __user *, newname, unsigned int, flags); |
| 217 | COMPAT_SYSCALL_WRAP3(seccomp, unsigned int, op, unsigned int, flags, const char __user *, uargs) | ||
| 218 | COMPAT_SYSCALL_WRAP3(getrandom, char __user *, buf, size_t, count, unsigned int, flags) | ||
| 219 | COMPAT_SYSCALL_WRAP2(memfd_create, const char __user *, uname, unsigned int, flags) | ||
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c index 633ca7504536..22aac5885ba2 100644 --- a/arch/s390/kernel/ipl.c +++ b/arch/s390/kernel/ipl.c | |||
| @@ -2060,6 +2060,13 @@ void s390_reset_system(void (*func)(void *), void *data) | |||
| 2060 | S390_lowcore.program_new_psw.addr = | 2060 | S390_lowcore.program_new_psw.addr = |
| 2061 | PSW_ADDR_AMODE | (unsigned long) s390_base_pgm_handler; | 2061 | PSW_ADDR_AMODE | (unsigned long) s390_base_pgm_handler; |
| 2062 | 2062 | ||
| 2063 | /* | ||
| 2064 | * Clear subchannel ID and number to signal new kernel that no CCW or | ||
| 2065 | * SCSI IPL has been done (for kexec and kdump) | ||
| 2066 | */ | ||
| 2067 | S390_lowcore.subchannel_id = 0; | ||
| 2068 | S390_lowcore.subchannel_nr = 0; | ||
| 2069 | |||
| 2063 | /* Store status at absolute zero */ | 2070 | /* Store status at absolute zero */ |
| 2064 | store_status(); | 2071 | store_status(); |
| 2065 | 2072 | ||
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index ae1d5be7dd88..82bc113e8c1d 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/stddef.h> | 24 | #include <linux/stddef.h> |
| 25 | #include <linux/unistd.h> | 25 | #include <linux/unistd.h> |
| 26 | #include <linux/ptrace.h> | 26 | #include <linux/ptrace.h> |
| 27 | #include <linux/random.h> | ||
| 27 | #include <linux/user.h> | 28 | #include <linux/user.h> |
| 28 | #include <linux/tty.h> | 29 | #include <linux/tty.h> |
| 29 | #include <linux/ioport.h> | 30 | #include <linux/ioport.h> |
| @@ -61,6 +62,7 @@ | |||
| 61 | #include <asm/diag.h> | 62 | #include <asm/diag.h> |
| 62 | #include <asm/os_info.h> | 63 | #include <asm/os_info.h> |
| 63 | #include <asm/sclp.h> | 64 | #include <asm/sclp.h> |
| 65 | #include <asm/sysinfo.h> | ||
| 64 | #include "entry.h" | 66 | #include "entry.h" |
| 65 | 67 | ||
| 66 | /* | 68 | /* |
| @@ -766,6 +768,7 @@ static void __init setup_hwcaps(void) | |||
| 766 | #endif | 768 | #endif |
| 767 | 769 | ||
| 768 | get_cpu_id(&cpu_id); | 770 | get_cpu_id(&cpu_id); |
| 771 | add_device_randomness(&cpu_id, sizeof(cpu_id)); | ||
| 769 | switch (cpu_id.machine) { | 772 | switch (cpu_id.machine) { |
| 770 | case 0x9672: | 773 | case 0x9672: |
| 771 | #if !defined(CONFIG_64BIT) | 774 | #if !defined(CONFIG_64BIT) |
| @@ -804,6 +807,19 @@ static void __init setup_hwcaps(void) | |||
| 804 | } | 807 | } |
| 805 | 808 | ||
| 806 | /* | 809 | /* |
| 810 | * Add system information as device randomness | ||
| 811 | */ | ||
| 812 | static void __init setup_randomness(void) | ||
| 813 | { | ||
| 814 | struct sysinfo_3_2_2 *vmms; | ||
| 815 | |||
| 816 | vmms = (struct sysinfo_3_2_2 *) alloc_page(GFP_KERNEL); | ||
| 817 | if (vmms && stsi(vmms, 3, 2, 2) == 0 && vmms->count) | ||
| 818 | add_device_randomness(&vmms, vmms->count); | ||
| 819 | free_page((unsigned long) vmms); | ||
| 820 | } | ||
| 821 | |||
| 822 | /* | ||
| 807 | * Setup function called from init/main.c just after the banner | 823 | * Setup function called from init/main.c just after the banner |
| 808 | * was printed. | 824 | * was printed. |
| 809 | */ | 825 | */ |
| @@ -901,6 +917,9 @@ void __init setup_arch(char **cmdline_p) | |||
| 901 | 917 | ||
| 902 | /* Setup zfcpdump support */ | 918 | /* Setup zfcpdump support */ |
| 903 | setup_zfcpdump(); | 919 | setup_zfcpdump(); |
| 920 | |||
| 921 | /* Add system specific data to the random pool */ | ||
| 922 | setup_randomness(); | ||
| 904 | } | 923 | } |
| 905 | 924 | ||
| 906 | #ifdef CONFIG_32BIT | 925 | #ifdef CONFIG_32BIT |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index fe5cdf29a001..6fe886ac2db5 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
| @@ -356,3 +356,6 @@ SYSCALL(sys_finit_module,sys_finit_module,compat_sys_finit_module) | |||
| 356 | SYSCALL(sys_sched_setattr,sys_sched_setattr,compat_sys_sched_setattr) /* 345 */ | 356 | SYSCALL(sys_sched_setattr,sys_sched_setattr,compat_sys_sched_setattr) /* 345 */ |
| 357 | SYSCALL(sys_sched_getattr,sys_sched_getattr,compat_sys_sched_getattr) | 357 | SYSCALL(sys_sched_getattr,sys_sched_getattr,compat_sys_sched_getattr) |
| 358 | SYSCALL(sys_renameat2,sys_renameat2,compat_sys_renameat2) | 358 | SYSCALL(sys_renameat2,sys_renameat2,compat_sys_renameat2) |
| 359 | SYSCALL(sys_seccomp,sys_seccomp,compat_sys_seccomp) | ||
| 360 | SYSCALL(sys_getrandom,sys_getrandom,compat_sys_getrandom) | ||
| 361 | SYSCALL(sys_memfd_create,sys_memfd_create,compat_sys_memfd_create) /* 350 */ | ||
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index a6d47e5eee9e..c43aca69fb30 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c | |||
| @@ -1035,12 +1035,26 @@ static int tty3215_write(struct tty_struct * tty, | |||
| 1035 | const unsigned char *buf, int count) | 1035 | const unsigned char *buf, int count) |
| 1036 | { | 1036 | { |
| 1037 | struct raw3215_info *raw; | 1037 | struct raw3215_info *raw; |
| 1038 | int i, written; | ||
| 1038 | 1039 | ||
| 1039 | if (!tty) | 1040 | if (!tty) |
| 1040 | return 0; | 1041 | return 0; |
| 1041 | raw = (struct raw3215_info *) tty->driver_data; | 1042 | raw = (struct raw3215_info *) tty->driver_data; |
| 1042 | raw3215_write(raw, buf, count); | 1043 | written = count; |
| 1043 | return count; | 1044 | while (count > 0) { |
| 1045 | for (i = 0; i < count; i++) | ||
| 1046 | if (buf[i] == '\t' || buf[i] == '\n') | ||
| 1047 | break; | ||
| 1048 | raw3215_write(raw, buf, i); | ||
| 1049 | count -= i; | ||
| 1050 | buf += i; | ||
| 1051 | if (count > 0) { | ||
| 1052 | raw3215_putchar(raw, *buf); | ||
| 1053 | count--; | ||
| 1054 | buf++; | ||
| 1055 | } | ||
| 1056 | } | ||
| 1057 | return written; | ||
| 1044 | } | 1058 | } |
| 1045 | 1059 | ||
| 1046 | /* | 1060 | /* |
| @@ -1188,7 +1202,7 @@ static int __init tty3215_init(void) | |||
| 1188 | driver->subtype = SYSTEM_TYPE_TTY; | 1202 | driver->subtype = SYSTEM_TYPE_TTY; |
| 1189 | driver->init_termios = tty_std_termios; | 1203 | driver->init_termios = tty_std_termios; |
| 1190 | driver->init_termios.c_iflag = IGNBRK | IGNPAR; | 1204 | driver->init_termios.c_iflag = IGNBRK | IGNPAR; |
| 1191 | driver->init_termios.c_oflag = ONLCR | XTABS; | 1205 | driver->init_termios.c_oflag = ONLCR; |
| 1192 | driver->init_termios.c_lflag = ISIG; | 1206 | driver->init_termios.c_lflag = ISIG; |
| 1193 | driver->flags = TTY_DRIVER_REAL_RAW; | 1207 | driver->flags = TTY_DRIVER_REAL_RAW; |
| 1194 | tty_set_operations(driver, &tty3215_ops); | 1208 | tty_set_operations(driver, &tty3215_ops); |
diff --git a/drivers/s390/char/sclp_tty.c b/drivers/s390/char/sclp_tty.c index 7ed7a5987816..003663288e29 100644 --- a/drivers/s390/char/sclp_tty.c +++ b/drivers/s390/char/sclp_tty.c | |||
| @@ -559,7 +559,7 @@ sclp_tty_init(void) | |||
| 559 | driver->subtype = SYSTEM_TYPE_TTY; | 559 | driver->subtype = SYSTEM_TYPE_TTY; |
| 560 | driver->init_termios = tty_std_termios; | 560 | driver->init_termios = tty_std_termios; |
| 561 | driver->init_termios.c_iflag = IGNBRK | IGNPAR; | 561 | driver->init_termios.c_iflag = IGNBRK | IGNPAR; |
| 562 | driver->init_termios.c_oflag = ONLCR | XTABS; | 562 | driver->init_termios.c_oflag = ONLCR; |
| 563 | driver->init_termios.c_lflag = ISIG | ECHO; | 563 | driver->init_termios.c_lflag = ISIG | ECHO; |
| 564 | driver->flags = TTY_DRIVER_REAL_RAW; | 564 | driver->flags = TTY_DRIVER_REAL_RAW; |
| 565 | tty_set_operations(driver, &sclp_ops); | 565 | tty_set_operations(driver, &sclp_ops); |
