Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 patches from Martin Schwidefsky:
 "Included are bug fixes and a patch to enable system call filtering
  with BPF."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/compat: fix mmap compat system calls
  s390/compat: fix compat wrappers for process_vm system calls
  s390: do not clobber personality flags in sys_32_personality()
  s390/seccomp: add support for system call filtering using BPF
  s390/sclp_sdias: Add missing break and "fall through"
  s390/mm: remove MAX_PHYSADDR_BITS define
This commit is contained in:
Linus Torvalds 2012-08-14 07:58:59 +03:00
commit ddf343f635
8 changed files with 26 additions and 11 deletions

View File

@ -124,6 +124,7 @@ config S390
select GENERIC_TIME_VSYSCALL select GENERIC_TIME_VSYSCALL
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select KTIME_SCALAR if 32BIT select KTIME_SCALAR if 32BIT
select HAVE_ARCH_SECCOMP_FILTER
config SCHED_OMIT_FRAME_POINTER config SCHED_OMIT_FRAME_POINTER
def_bool y def_bool y

View File

@ -4,13 +4,11 @@
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
#define SECTION_SIZE_BITS 28 #define SECTION_SIZE_BITS 28
#define MAX_PHYSADDR_BITS 46
#define MAX_PHYSMEM_BITS 46 #define MAX_PHYSMEM_BITS 46
#else #else
#define SECTION_SIZE_BITS 25 #define SECTION_SIZE_BITS 25
#define MAX_PHYSADDR_BITS 31
#define MAX_PHYSMEM_BITS 31 #define MAX_PHYSMEM_BITS 31
#endif /* CONFIG_64BIT */ #endif /* CONFIG_64BIT */

View File

@ -12,6 +12,7 @@
#ifndef _ASM_SYSCALL_H #ifndef _ASM_SYSCALL_H
#define _ASM_SYSCALL_H 1 #define _ASM_SYSCALL_H 1
#include <linux/audit.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/err.h> #include <linux/err.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
@ -87,4 +88,13 @@ static inline void syscall_set_arguments(struct task_struct *task,
regs->orig_gpr2 = args[0]; regs->orig_gpr2 = args[0];
} }
static inline int syscall_get_arch(struct task_struct *task,
struct pt_regs *regs)
{
#ifdef CONFIG_COMPAT
if (test_tsk_thread_flag(task, TIF_31BIT))
return AUDIT_ARCH_S390;
#endif
return sizeof(long) == 8 ? AUDIT_ARCH_S390X : AUDIT_ARCH_S390;
}
#endif /* _ASM_SYSCALL_H */ #endif /* _ASM_SYSCALL_H */

View File

@ -620,7 +620,6 @@ asmlinkage unsigned long old32_mmap(struct mmap_arg_struct_emu31 __user *arg)
return -EFAULT; return -EFAULT;
if (a.offset & ~PAGE_MASK) if (a.offset & ~PAGE_MASK)
return -EINVAL; return -EINVAL;
a.addr = (unsigned long) compat_ptr(a.addr);
return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd,
a.offset >> PAGE_SHIFT); a.offset >> PAGE_SHIFT);
} }
@ -631,7 +630,6 @@ asmlinkage long sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg)
if (copy_from_user(&a, arg, sizeof(a))) if (copy_from_user(&a, arg, sizeof(a)))
return -EFAULT; return -EFAULT;
a.addr = (unsigned long) compat_ptr(a.addr);
return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset); return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset);
} }

View File

@ -1635,7 +1635,7 @@ ENTRY(compat_sys_process_vm_readv_wrapper)
llgfr %r6,%r6 # unsigned long llgfr %r6,%r6 # unsigned long
llgf %r0,164(%r15) # unsigned long llgf %r0,164(%r15) # unsigned long
stg %r0,160(%r15) stg %r0,160(%r15)
jg sys_process_vm_readv jg compat_sys_process_vm_readv
ENTRY(compat_sys_process_vm_writev_wrapper) ENTRY(compat_sys_process_vm_writev_wrapper)
lgfr %r2,%r2 # compat_pid_t lgfr %r2,%r2 # compat_pid_t
@ -1645,4 +1645,4 @@ ENTRY(compat_sys_process_vm_writev_wrapper)
llgfr %r6,%r6 # unsigned long llgfr %r6,%r6 # unsigned long
llgf %r0,164(%r15) # unsigned long llgf %r0,164(%r15) # unsigned long
stg %r0,160(%r15) stg %r0,160(%r15)
jg sys_process_vm_writev jg compat_sys_process_vm_writev

View File

@ -719,7 +719,11 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
long ret = 0; long ret = 0;
/* Do the secure computing check first. */ /* Do the secure computing check first. */
secure_computing_strict(regs->gprs[2]); if (secure_computing(regs->gprs[2])) {
/* seccomp failures shouldn't expose any additional code. */
ret = -1;
goto out;
}
/* /*
* The sysc_tracesys code in entry.S stored the system * The sysc_tracesys code in entry.S stored the system
@ -745,6 +749,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
regs->gprs[2], regs->orig_gpr2, regs->gprs[2], regs->orig_gpr2,
regs->gprs[3], regs->gprs[4], regs->gprs[3], regs->gprs[4],
regs->gprs[5]); regs->gprs[5]);
out:
return ret ?: regs->gprs[2]; return ret ?: regs->gprs[2];
} }

View File

@ -81,11 +81,12 @@ SYSCALL_DEFINE1(s390_personality, unsigned int, personality)
{ {
unsigned int ret; unsigned int ret;
if (current->personality == PER_LINUX32 && personality == PER_LINUX) if (personality(current->personality) == PER_LINUX32 &&
personality = PER_LINUX32; personality(personality) == PER_LINUX)
personality |= PER_LINUX32;
ret = sys_personality(personality); ret = sys_personality(personality);
if (ret == PER_LINUX32) if (personality(ret) == PER_LINUX32)
ret = PER_LINUX; ret &= ~PER_LINUX32;
return ret; return ret;
} }

View File

@ -242,11 +242,13 @@ int sclp_sdias_copy(void *dest, int start_blk, int nr_blks)
switch (sdias_evbuf.event_status) { switch (sdias_evbuf.event_status) {
case EVSTATE_ALL_STORED: case EVSTATE_ALL_STORED:
TRACE("all stored\n"); TRACE("all stored\n");
break;
case EVSTATE_PART_STORED: case EVSTATE_PART_STORED:
TRACE("part stored: %i\n", sdias_evbuf.blk_cnt); TRACE("part stored: %i\n", sdias_evbuf.blk_cnt);
break; break;
case EVSTATE_NO_DATA: case EVSTATE_NO_DATA:
TRACE("no data\n"); TRACE("no data\n");
/* fall through */
default: default:
pr_err("Error from SCLP while copying hsa. " pr_err("Error from SCLP while copying hsa. "
"Event status = %x\n", "Event status = %x\n",