mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
Merge bcfeebbff3 ("Merge branch 'exit-cleanups-for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace") into android-mainline
Steps on the way to 5.15-rc1 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Id09010ca0885fd124edbe9c12c885e0b62ce7e67
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
#ifndef _ALPHA_SIGINFO_H
|
||||
#define _ALPHA_SIGINFO_H
|
||||
|
||||
#define __ARCH_SI_TRAPNO
|
||||
|
||||
#include <asm-generic/siginfo.h>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -876,7 +876,7 @@ SYSCALL_DEFINE5(osf_setsysinfo, unsigned long, op, void __user *, buffer,
|
||||
if (fex & IEEE_TRAP_ENABLE_DZE) si_code = FPE_FLTDIV;
|
||||
if (fex & IEEE_TRAP_ENABLE_INV) si_code = FPE_FLTINV;
|
||||
|
||||
send_sig_fault(SIGFPE, si_code,
|
||||
send_sig_fault_trapno(SIGFPE, si_code,
|
||||
(void __user *)NULL, /* FIXME */
|
||||
0, current);
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ do_sigreturn(struct sigcontext __user *sc)
|
||||
|
||||
/* Send SIGTRAP if we're single-stepping: */
|
||||
if (ptrace_cancel_bpt (current)) {
|
||||
send_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *) regs->pc, 0,
|
||||
send_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *) regs->pc,
|
||||
current);
|
||||
}
|
||||
return;
|
||||
@@ -247,7 +247,7 @@ do_rt_sigreturn(struct rt_sigframe __user *frame)
|
||||
|
||||
/* Send SIGTRAP if we're single-stepping: */
|
||||
if (ptrace_cancel_bpt (current)) {
|
||||
send_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *) regs->pc, 0,
|
||||
send_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *) regs->pc,
|
||||
current);
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -230,7 +230,7 @@
|
||||
259 common osf_swapctl sys_ni_syscall
|
||||
260 common osf_memcntl sys_ni_syscall
|
||||
261 common osf_fdatasync sys_ni_syscall
|
||||
300 common bdflush sys_bdflush
|
||||
300 common bdflush sys_ni_syscall
|
||||
301 common sethae sys_sethae
|
||||
302 common mount sys_mount
|
||||
303 common old_adjtimex sys_old_adjtimex
|
||||
|
||||
@@ -227,7 +227,7 @@ do_entArith(unsigned long summary, unsigned long write_mask,
|
||||
}
|
||||
die_if_kernel("Arithmetic fault", regs, 0, NULL);
|
||||
|
||||
send_sig_fault(SIGFPE, si_code, (void __user *) regs->pc, 0, current);
|
||||
send_sig_fault_trapno(SIGFPE, si_code, (void __user *) regs->pc, 0, current);
|
||||
}
|
||||
|
||||
asmlinkage void
|
||||
@@ -268,13 +268,13 @@ do_entIF(unsigned long type, struct pt_regs *regs)
|
||||
regs->pc -= 4; /* make pc point to former bpt */
|
||||
}
|
||||
|
||||
send_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->pc, 0,
|
||||
send_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->pc,
|
||||
current);
|
||||
return;
|
||||
|
||||
case 1: /* bugcheck */
|
||||
send_sig_fault(SIGTRAP, TRAP_UNK, (void __user *) regs->pc, 0,
|
||||
current);
|
||||
send_sig_fault_trapno(SIGTRAP, TRAP_UNK,
|
||||
(void __user *) regs->pc, 0, current);
|
||||
return;
|
||||
|
||||
case 2: /* gentrap */
|
||||
@@ -335,8 +335,8 @@ do_entIF(unsigned long type, struct pt_regs *regs)
|
||||
break;
|
||||
}
|
||||
|
||||
send_sig_fault(signo, code, (void __user *) regs->pc, regs->r16,
|
||||
current);
|
||||
send_sig_fault_trapno(signo, code, (void __user *) regs->pc,
|
||||
regs->r16, current);
|
||||
return;
|
||||
|
||||
case 4: /* opDEC */
|
||||
@@ -360,9 +360,9 @@ do_entIF(unsigned long type, struct pt_regs *regs)
|
||||
if (si_code == 0)
|
||||
return;
|
||||
if (si_code > 0) {
|
||||
send_sig_fault(SIGFPE, si_code,
|
||||
(void __user *) regs->pc, 0,
|
||||
current);
|
||||
send_sig_fault_trapno(SIGFPE, si_code,
|
||||
(void __user *) regs->pc,
|
||||
0, current);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -387,7 +387,7 @@ do_entIF(unsigned long type, struct pt_regs *regs)
|
||||
;
|
||||
}
|
||||
|
||||
send_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)regs->pc, 0, current);
|
||||
send_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)regs->pc, current);
|
||||
}
|
||||
|
||||
/* There is an ifdef in the PALcode in MILO that enables a
|
||||
@@ -402,7 +402,7 @@ do_entDbg(struct pt_regs *regs)
|
||||
{
|
||||
die_if_kernel("Instruction fault", regs, 0, NULL);
|
||||
|
||||
force_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)regs->pc, 0);
|
||||
force_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)regs->pc);
|
||||
}
|
||||
|
||||
|
||||
@@ -964,12 +964,12 @@ give_sigsegv:
|
||||
si_code = SEGV_MAPERR;
|
||||
mmap_read_unlock(mm);
|
||||
}
|
||||
send_sig_fault(SIGSEGV, si_code, va, 0, current);
|
||||
send_sig_fault(SIGSEGV, si_code, va, current);
|
||||
return;
|
||||
|
||||
give_sigbus:
|
||||
regs->pc -= 4;
|
||||
send_sig_fault(SIGBUS, BUS_ADRALN, va, 0, current);
|
||||
send_sig_fault(SIGBUS, BUS_ADRALN, va, current);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -219,13 +219,13 @@ retry:
|
||||
mmap_read_unlock(mm);
|
||||
/* Send a sigbus, regardless of whether we were in kernel
|
||||
or user mode. */
|
||||
force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *) address, 0);
|
||||
force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *) address);
|
||||
if (!user_mode(regs))
|
||||
goto no_context;
|
||||
return;
|
||||
|
||||
do_sigsegv:
|
||||
force_sig_fault(SIGSEGV, si_code, (void __user *) address, 0);
|
||||
force_sig_fault(SIGSEGV, si_code, (void __user *) address);
|
||||
return;
|
||||
|
||||
#ifdef CONFIG_ALPHA_LARGE_VMALLOC
|
||||
|
||||
@@ -725,3 +725,42 @@ asmlinkage void do_rseq_syscall(struct pt_regs *regs)
|
||||
rseq_syscall(regs);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Compile-time assertions for siginfo_t offsets. Check NSIG* as well, as
|
||||
* changes likely come with new fields that should be added below.
|
||||
*/
|
||||
static_assert(NSIGILL == 11);
|
||||
static_assert(NSIGFPE == 15);
|
||||
static_assert(NSIGSEGV == 9);
|
||||
static_assert(NSIGBUS == 5);
|
||||
static_assert(NSIGTRAP == 6);
|
||||
static_assert(NSIGCHLD == 6);
|
||||
static_assert(NSIGSYS == 2);
|
||||
static_assert(sizeof(siginfo_t) == 128);
|
||||
static_assert(__alignof__(siginfo_t) == 4);
|
||||
static_assert(offsetof(siginfo_t, si_signo) == 0x00);
|
||||
static_assert(offsetof(siginfo_t, si_errno) == 0x04);
|
||||
static_assert(offsetof(siginfo_t, si_code) == 0x08);
|
||||
static_assert(offsetof(siginfo_t, si_pid) == 0x0c);
|
||||
static_assert(offsetof(siginfo_t, si_uid) == 0x10);
|
||||
static_assert(offsetof(siginfo_t, si_tid) == 0x0c);
|
||||
static_assert(offsetof(siginfo_t, si_overrun) == 0x10);
|
||||
static_assert(offsetof(siginfo_t, si_status) == 0x14);
|
||||
static_assert(offsetof(siginfo_t, si_utime) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_stime) == 0x1c);
|
||||
static_assert(offsetof(siginfo_t, si_value) == 0x14);
|
||||
static_assert(offsetof(siginfo_t, si_int) == 0x14);
|
||||
static_assert(offsetof(siginfo_t, si_ptr) == 0x14);
|
||||
static_assert(offsetof(siginfo_t, si_addr) == 0x0c);
|
||||
static_assert(offsetof(siginfo_t, si_addr_lsb) == 0x10);
|
||||
static_assert(offsetof(siginfo_t, si_lower) == 0x14);
|
||||
static_assert(offsetof(siginfo_t, si_upper) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_pkey) == 0x14);
|
||||
static_assert(offsetof(siginfo_t, si_perf_data) == 0x10);
|
||||
static_assert(offsetof(siginfo_t, si_perf_type) == 0x14);
|
||||
static_assert(offsetof(siginfo_t, si_band) == 0x0c);
|
||||
static_assert(offsetof(siginfo_t, si_fd) == 0x10);
|
||||
static_assert(offsetof(siginfo_t, si_call_addr) == 0x0c);
|
||||
static_assert(offsetof(siginfo_t, si_syscall) == 0x10);
|
||||
static_assert(offsetof(siginfo_t, si_arch) == 0x14);
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
131 common quotactl sys_quotactl
|
||||
132 common getpgid sys_getpgid
|
||||
133 common fchdir sys_fchdir
|
||||
134 common bdflush sys_bdflush
|
||||
134 common bdflush sys_ni_syscall
|
||||
135 common sysfs sys_sysfs
|
||||
136 common personality sys_personality
|
||||
# 137 was sys_afs_syscall
|
||||
|
||||
@@ -279,7 +279,7 @@ __SYSCALL(__NR_getpgid, sys_getpgid)
|
||||
#define __NR_fchdir 133
|
||||
__SYSCALL(__NR_fchdir, sys_fchdir)
|
||||
#define __NR_bdflush 134
|
||||
__SYSCALL(__NR_bdflush, sys_bdflush)
|
||||
__SYSCALL(__NR_bdflush, sys_ni_syscall)
|
||||
#define __NR_sysfs 135
|
||||
__SYSCALL(__NR_sysfs, sys_sysfs)
|
||||
#define __NR_personality 136
|
||||
|
||||
@@ -1000,3 +1000,42 @@ void __init minsigstksz_setup(void)
|
||||
round_up(sizeof(struct frame_record), 16) +
|
||||
16; /* max alignment padding */
|
||||
}
|
||||
|
||||
/*
|
||||
* Compile-time assertions for siginfo_t offsets. Check NSIG* as well, as
|
||||
* changes likely come with new fields that should be added below.
|
||||
*/
|
||||
static_assert(NSIGILL == 11);
|
||||
static_assert(NSIGFPE == 15);
|
||||
static_assert(NSIGSEGV == 9);
|
||||
static_assert(NSIGBUS == 5);
|
||||
static_assert(NSIGTRAP == 6);
|
||||
static_assert(NSIGCHLD == 6);
|
||||
static_assert(NSIGSYS == 2);
|
||||
static_assert(sizeof(siginfo_t) == 128);
|
||||
static_assert(__alignof__(siginfo_t) == 8);
|
||||
static_assert(offsetof(siginfo_t, si_signo) == 0x00);
|
||||
static_assert(offsetof(siginfo_t, si_errno) == 0x04);
|
||||
static_assert(offsetof(siginfo_t, si_code) == 0x08);
|
||||
static_assert(offsetof(siginfo_t, si_pid) == 0x10);
|
||||
static_assert(offsetof(siginfo_t, si_uid) == 0x14);
|
||||
static_assert(offsetof(siginfo_t, si_tid) == 0x10);
|
||||
static_assert(offsetof(siginfo_t, si_overrun) == 0x14);
|
||||
static_assert(offsetof(siginfo_t, si_status) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_utime) == 0x20);
|
||||
static_assert(offsetof(siginfo_t, si_stime) == 0x28);
|
||||
static_assert(offsetof(siginfo_t, si_value) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_int) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_ptr) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_addr) == 0x10);
|
||||
static_assert(offsetof(siginfo_t, si_addr_lsb) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_lower) == 0x20);
|
||||
static_assert(offsetof(siginfo_t, si_upper) == 0x28);
|
||||
static_assert(offsetof(siginfo_t, si_pkey) == 0x20);
|
||||
static_assert(offsetof(siginfo_t, si_perf_data) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_perf_type) == 0x20);
|
||||
static_assert(offsetof(siginfo_t, si_band) == 0x10);
|
||||
static_assert(offsetof(siginfo_t, si_fd) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_call_addr) == 0x10);
|
||||
static_assert(offsetof(siginfo_t, si_syscall) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_arch) == 0x1c);
|
||||
|
||||
@@ -457,3 +457,42 @@ void compat_setup_restart_syscall(struct pt_regs *regs)
|
||||
{
|
||||
regs->regs[7] = __NR_compat_restart_syscall;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compile-time assertions for siginfo_t offsets. Check NSIG* as well, as
|
||||
* changes likely come with new fields that should be added below.
|
||||
*/
|
||||
static_assert(NSIGILL == 11);
|
||||
static_assert(NSIGFPE == 15);
|
||||
static_assert(NSIGSEGV == 9);
|
||||
static_assert(NSIGBUS == 5);
|
||||
static_assert(NSIGTRAP == 6);
|
||||
static_assert(NSIGCHLD == 6);
|
||||
static_assert(NSIGSYS == 2);
|
||||
static_assert(sizeof(compat_siginfo_t) == 128);
|
||||
static_assert(__alignof__(compat_siginfo_t) == 4);
|
||||
static_assert(offsetof(compat_siginfo_t, si_signo) == 0x00);
|
||||
static_assert(offsetof(compat_siginfo_t, si_errno) == 0x04);
|
||||
static_assert(offsetof(compat_siginfo_t, si_code) == 0x08);
|
||||
static_assert(offsetof(compat_siginfo_t, si_pid) == 0x0c);
|
||||
static_assert(offsetof(compat_siginfo_t, si_uid) == 0x10);
|
||||
static_assert(offsetof(compat_siginfo_t, si_tid) == 0x0c);
|
||||
static_assert(offsetof(compat_siginfo_t, si_overrun) == 0x10);
|
||||
static_assert(offsetof(compat_siginfo_t, si_status) == 0x14);
|
||||
static_assert(offsetof(compat_siginfo_t, si_utime) == 0x18);
|
||||
static_assert(offsetof(compat_siginfo_t, si_stime) == 0x1c);
|
||||
static_assert(offsetof(compat_siginfo_t, si_value) == 0x14);
|
||||
static_assert(offsetof(compat_siginfo_t, si_int) == 0x14);
|
||||
static_assert(offsetof(compat_siginfo_t, si_ptr) == 0x14);
|
||||
static_assert(offsetof(compat_siginfo_t, si_addr) == 0x0c);
|
||||
static_assert(offsetof(compat_siginfo_t, si_addr_lsb) == 0x10);
|
||||
static_assert(offsetof(compat_siginfo_t, si_lower) == 0x14);
|
||||
static_assert(offsetof(compat_siginfo_t, si_upper) == 0x18);
|
||||
static_assert(offsetof(compat_siginfo_t, si_pkey) == 0x14);
|
||||
static_assert(offsetof(compat_siginfo_t, si_perf_data) == 0x10);
|
||||
static_assert(offsetof(compat_siginfo_t, si_perf_type) == 0x14);
|
||||
static_assert(offsetof(compat_siginfo_t, si_band) == 0x0c);
|
||||
static_assert(offsetof(compat_siginfo_t, si_fd) == 0x10);
|
||||
static_assert(offsetof(compat_siginfo_t, si_call_addr) == 0x0c);
|
||||
static_assert(offsetof(compat_siginfo_t, si_syscall) == 0x10);
|
||||
static_assert(offsetof(compat_siginfo_t, si_arch) == 0x14);
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
# 1135 was get_kernel_syms
|
||||
# 1136 was query_module
|
||||
113 common quotactl sys_quotactl
|
||||
114 common bdflush sys_bdflush
|
||||
114 common bdflush sys_ni_syscall
|
||||
115 common sysfs sys_sysfs
|
||||
116 common personality sys_personality
|
||||
117 common afs_syscall sys_ni_syscall
|
||||
|
||||
@@ -502,7 +502,8 @@ in_ea:
|
||||
.section .fixup,#alloc,#execinstr
|
||||
.even
|
||||
1:
|
||||
jbra fpsp040_die
|
||||
jbsr fpsp040_die
|
||||
jbra .Lnotkern
|
||||
|
||||
.section __ex_table,#alloc
|
||||
.align 4
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
131 common quotactl sys_quotactl
|
||||
132 common getpgid sys_getpgid
|
||||
133 common fchdir sys_fchdir
|
||||
134 common bdflush sys_bdflush
|
||||
134 common bdflush sys_ni_syscall
|
||||
135 common sysfs sys_sysfs
|
||||
136 common personality sys_personality
|
||||
# 137 was afs_syscall
|
||||
|
||||
@@ -1150,7 +1150,7 @@ asmlinkage void set_esp0(unsigned long ssp)
|
||||
*/
|
||||
asmlinkage void fpsp040_die(void)
|
||||
{
|
||||
do_exit(SIGSEGV);
|
||||
force_sigsegv(SIGSEGV);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_M68KFPU_EMU
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
131 common quotactl sys_quotactl
|
||||
132 common getpgid sys_getpgid
|
||||
133 common fchdir sys_fchdir
|
||||
134 common bdflush sys_bdflush
|
||||
134 common bdflush sys_ni_syscall
|
||||
135 common sysfs sys_sysfs
|
||||
136 common personality sys_personality
|
||||
137 common afs_syscall sys_ni_syscall
|
||||
|
||||
@@ -10,9 +10,7 @@
|
||||
#ifndef _UAPI_ASM_SIGINFO_H
|
||||
#define _UAPI_ASM_SIGINFO_H
|
||||
|
||||
|
||||
#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int))
|
||||
#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */
|
||||
|
||||
#define __ARCH_HAS_SWAPPED_SIGINFO
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
131 o32 quotactl sys_quotactl
|
||||
132 o32 getpgid sys_getpgid
|
||||
133 o32 fchdir sys_fchdir
|
||||
134 o32 bdflush sys_bdflush
|
||||
134 o32 bdflush sys_ni_syscall
|
||||
135 o32 sysfs sys_sysfs
|
||||
136 o32 personality sys_personality sys_32_personality
|
||||
137 o32 afs_syscall sys_ni_syscall
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
131 common quotactl sys_quotactl
|
||||
132 common getpgid sys_getpgid
|
||||
133 common fchdir sys_fchdir
|
||||
134 common bdflush sys_bdflush
|
||||
134 common bdflush sys_ni_syscall
|
||||
135 common sysfs sys_sysfs
|
||||
136 32 personality parisc_personality
|
||||
136 64 personality sys_personality
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
131 nospu quotactl sys_quotactl
|
||||
132 common getpgid sys_getpgid
|
||||
133 common fchdir sys_fchdir
|
||||
134 common bdflush sys_bdflush
|
||||
134 common bdflush sys_ni_syscall
|
||||
135 common sysfs sys_sysfs
|
||||
136 32 personality sys_personality ppc64_personality
|
||||
136 64 personality ppc64_personality
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
131 common quotactl sys_quotactl sys_quotactl
|
||||
132 common getpgid sys_getpgid sys_getpgid
|
||||
133 common fchdir sys_fchdir sys_fchdir
|
||||
134 common bdflush sys_bdflush sys_bdflush
|
||||
134 common bdflush sys_ni_syscall sys_ni_syscall
|
||||
135 common sysfs sys_sysfs sys_sysfs
|
||||
136 common personality sys_s390_personality sys_s390_personality
|
||||
137 common afs_syscall - -
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
131 common quotactl sys_quotactl
|
||||
132 common getpgid sys_getpgid
|
||||
133 common fchdir sys_fchdir
|
||||
134 common bdflush sys_bdflush
|
||||
134 common bdflush sys_ni_syscall
|
||||
135 common sysfs sys_sysfs
|
||||
136 common personality sys_personality
|
||||
# 137 was afs_syscall
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
|
||||
#endif /* defined(__sparc__) && defined(__arch64__) */
|
||||
|
||||
|
||||
#define __ARCH_SI_TRAPNO
|
||||
|
||||
#include <asm-generic/siginfo.h>
|
||||
|
||||
|
||||
|
||||
@@ -518,7 +518,7 @@ void synchronize_user_stack(void)
|
||||
|
||||
static void stack_unaligned(unsigned long sp)
|
||||
{
|
||||
force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *) sp, 0);
|
||||
force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *) sp);
|
||||
}
|
||||
|
||||
static const char uwfault32[] = KERN_INFO \
|
||||
|
||||
@@ -745,3 +745,40 @@ asmlinkage int do_sys32_sigstack(u32 u_ssptr, u32 u_ossptr, unsigned long sp)
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compile-time assertions for siginfo_t offsets. Check NSIG* as well, as
|
||||
* changes likely come with new fields that should be added below.
|
||||
*/
|
||||
static_assert(NSIGILL == 11);
|
||||
static_assert(NSIGFPE == 15);
|
||||
static_assert(NSIGSEGV == 9);
|
||||
static_assert(NSIGBUS == 5);
|
||||
static_assert(NSIGTRAP == 6);
|
||||
static_assert(NSIGCHLD == 6);
|
||||
static_assert(NSIGSYS == 2);
|
||||
static_assert(sizeof(compat_siginfo_t) == 128);
|
||||
static_assert(__alignof__(compat_siginfo_t) == 4);
|
||||
static_assert(offsetof(compat_siginfo_t, si_signo) == 0x00);
|
||||
static_assert(offsetof(compat_siginfo_t, si_errno) == 0x04);
|
||||
static_assert(offsetof(compat_siginfo_t, si_code) == 0x08);
|
||||
static_assert(offsetof(compat_siginfo_t, si_pid) == 0x0c);
|
||||
static_assert(offsetof(compat_siginfo_t, si_uid) == 0x10);
|
||||
static_assert(offsetof(compat_siginfo_t, si_tid) == 0x0c);
|
||||
static_assert(offsetof(compat_siginfo_t, si_overrun) == 0x10);
|
||||
static_assert(offsetof(compat_siginfo_t, si_status) == 0x14);
|
||||
static_assert(offsetof(compat_siginfo_t, si_utime) == 0x18);
|
||||
static_assert(offsetof(compat_siginfo_t, si_stime) == 0x1c);
|
||||
static_assert(offsetof(compat_siginfo_t, si_value) == 0x14);
|
||||
static_assert(offsetof(compat_siginfo_t, si_int) == 0x14);
|
||||
static_assert(offsetof(compat_siginfo_t, si_ptr) == 0x14);
|
||||
static_assert(offsetof(compat_siginfo_t, si_addr) == 0x0c);
|
||||
static_assert(offsetof(compat_siginfo_t, si_trapno) == 0x10);
|
||||
static_assert(offsetof(compat_siginfo_t, si_addr_lsb) == 0x10);
|
||||
static_assert(offsetof(compat_siginfo_t, si_lower) == 0x14);
|
||||
static_assert(offsetof(compat_siginfo_t, si_upper) == 0x18);
|
||||
static_assert(offsetof(compat_siginfo_t, si_pkey) == 0x14);
|
||||
static_assert(offsetof(compat_siginfo_t, si_perf_data) == 0x10);
|
||||
static_assert(offsetof(compat_siginfo_t, si_perf_type) == 0x14);
|
||||
static_assert(offsetof(compat_siginfo_t, si_band) == 0x0c);
|
||||
static_assert(offsetof(compat_siginfo_t, si_fd) == 0x10);
|
||||
|
||||
@@ -556,3 +556,39 @@ void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, unsigned long
|
||||
user_enter();
|
||||
}
|
||||
|
||||
/*
|
||||
* Compile-time assertions for siginfo_t offsets. Check NSIG* as well, as
|
||||
* changes likely come with new fields that should be added below.
|
||||
*/
|
||||
static_assert(NSIGILL == 11);
|
||||
static_assert(NSIGFPE == 15);
|
||||
static_assert(NSIGSEGV == 9);
|
||||
static_assert(NSIGBUS == 5);
|
||||
static_assert(NSIGTRAP == 6);
|
||||
static_assert(NSIGCHLD == 6);
|
||||
static_assert(NSIGSYS == 2);
|
||||
static_assert(sizeof(siginfo_t) == 128);
|
||||
static_assert(__alignof__(siginfo_t) == 8);
|
||||
static_assert(offsetof(siginfo_t, si_signo) == 0x00);
|
||||
static_assert(offsetof(siginfo_t, si_errno) == 0x04);
|
||||
static_assert(offsetof(siginfo_t, si_code) == 0x08);
|
||||
static_assert(offsetof(siginfo_t, si_pid) == 0x10);
|
||||
static_assert(offsetof(siginfo_t, si_uid) == 0x14);
|
||||
static_assert(offsetof(siginfo_t, si_tid) == 0x10);
|
||||
static_assert(offsetof(siginfo_t, si_overrun) == 0x14);
|
||||
static_assert(offsetof(siginfo_t, si_status) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_utime) == 0x20);
|
||||
static_assert(offsetof(siginfo_t, si_stime) == 0x28);
|
||||
static_assert(offsetof(siginfo_t, si_value) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_int) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_ptr) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_addr) == 0x10);
|
||||
static_assert(offsetof(siginfo_t, si_trapno) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_addr_lsb) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_lower) == 0x20);
|
||||
static_assert(offsetof(siginfo_t, si_upper) == 0x28);
|
||||
static_assert(offsetof(siginfo_t, si_pkey) == 0x20);
|
||||
static_assert(offsetof(siginfo_t, si_perf_data) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_perf_type) == 0x20);
|
||||
static_assert(offsetof(siginfo_t, si_band) == 0x10);
|
||||
static_assert(offsetof(siginfo_t, si_fd) == 0x14);
|
||||
|
||||
@@ -151,7 +151,7 @@ sparc_breakpoint (struct pt_regs *regs)
|
||||
#ifdef DEBUG_SPARC_BREAKPOINT
|
||||
printk ("TRAP: Entering kernel PC=%x, nPC=%x\n", regs->pc, regs->npc);
|
||||
#endif
|
||||
force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->pc, 0);
|
||||
force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->pc);
|
||||
|
||||
#ifdef DEBUG_SPARC_BREAKPOINT
|
||||
printk ("TRAP: Returning to space: PC=%x nPC=%x\n", regs->pc, regs->npc);
|
||||
|
||||
@@ -514,7 +514,7 @@ asmlinkage void sparc_breakpoint(struct pt_regs *regs)
|
||||
#ifdef DEBUG_SPARC_BREAKPOINT
|
||||
printk ("TRAP: Entering kernel PC=%lx, nPC=%lx\n", regs->tpc, regs->tnpc);
|
||||
#endif
|
||||
force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->tpc, 0);
|
||||
force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->tpc);
|
||||
#ifdef DEBUG_SPARC_BREAKPOINT
|
||||
printk ("TRAP: Returning to space: PC=%lx nPC=%lx\n", regs->tpc, regs->tnpc);
|
||||
#endif
|
||||
|
||||
@@ -270,7 +270,7 @@
|
||||
222 common delete_module sys_delete_module
|
||||
223 common get_kernel_syms sys_ni_syscall
|
||||
224 common getpgid sys_getpgid
|
||||
225 common bdflush sys_bdflush
|
||||
225 common bdflush sys_ni_syscall
|
||||
226 common sysfs sys_sysfs
|
||||
227 common afs_syscall sys_nis_syscall
|
||||
228 common setfsuid sys_setfsuid16
|
||||
|
||||
@@ -102,8 +102,8 @@ void do_hw_interrupt(struct pt_regs *regs, unsigned long type)
|
||||
if(regs->psr & PSR_PS)
|
||||
die_if_kernel("Kernel bad trap", regs);
|
||||
|
||||
force_sig_fault(SIGILL, ILL_ILLTRP,
|
||||
(void __user *)regs->pc, type - 0x80);
|
||||
force_sig_fault_trapno(SIGILL, ILL_ILLTRP,
|
||||
(void __user *)regs->pc, type - 0x80);
|
||||
}
|
||||
|
||||
void do_illegal_instruction(struct pt_regs *regs, unsigned long pc, unsigned long npc,
|
||||
@@ -116,7 +116,7 @@ void do_illegal_instruction(struct pt_regs *regs, unsigned long pc, unsigned lon
|
||||
regs->pc, *(unsigned long *)regs->pc);
|
||||
#endif
|
||||
|
||||
send_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)pc, 0, current);
|
||||
send_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)pc, current);
|
||||
}
|
||||
|
||||
void do_priv_instruction(struct pt_regs *regs, unsigned long pc, unsigned long npc,
|
||||
@@ -124,7 +124,7 @@ void do_priv_instruction(struct pt_regs *regs, unsigned long pc, unsigned long n
|
||||
{
|
||||
if(psr & PSR_PS)
|
||||
die_if_kernel("Penguin instruction from Penguin mode??!?!", regs);
|
||||
send_sig_fault(SIGILL, ILL_PRVOPC, (void __user *)pc, 0, current);
|
||||
send_sig_fault(SIGILL, ILL_PRVOPC, (void __user *)pc, current);
|
||||
}
|
||||
|
||||
/* XXX User may want to be allowed to do this. XXX */
|
||||
@@ -145,7 +145,7 @@ void do_memaccess_unaligned(struct pt_regs *regs, unsigned long pc, unsigned lon
|
||||
#endif
|
||||
send_sig_fault(SIGBUS, BUS_ADRALN,
|
||||
/* FIXME: Should dig out mna address */ (void *)0,
|
||||
0, current);
|
||||
current);
|
||||
}
|
||||
|
||||
static unsigned long init_fsr = 0x0UL;
|
||||
@@ -291,7 +291,7 @@ void do_fpe_trap(struct pt_regs *regs, unsigned long pc, unsigned long npc,
|
||||
else if (fsr & 0x01)
|
||||
code = FPE_FLTRES;
|
||||
}
|
||||
send_sig_fault(SIGFPE, code, (void __user *)pc, 0, fpt);
|
||||
send_sig_fault(SIGFPE, code, (void __user *)pc, fpt);
|
||||
#ifndef CONFIG_SMP
|
||||
last_task_used_math = NULL;
|
||||
#endif
|
||||
@@ -305,7 +305,7 @@ void handle_tag_overflow(struct pt_regs *regs, unsigned long pc, unsigned long n
|
||||
{
|
||||
if(psr & PSR_PS)
|
||||
die_if_kernel("Penguin overflow trap from kernel mode", regs);
|
||||
send_sig_fault(SIGEMT, EMT_TAGOVF, (void __user *)pc, 0, current);
|
||||
send_sig_fault(SIGEMT, EMT_TAGOVF, (void __user *)pc, current);
|
||||
}
|
||||
|
||||
void handle_watchpoint(struct pt_regs *regs, unsigned long pc, unsigned long npc,
|
||||
@@ -327,13 +327,13 @@ void handle_reg_access(struct pt_regs *regs, unsigned long pc, unsigned long npc
|
||||
printk("Register Access Exception at PC %08lx NPC %08lx PSR %08lx\n",
|
||||
pc, npc, psr);
|
||||
#endif
|
||||
force_sig_fault(SIGBUS, BUS_OBJERR, (void __user *)pc, 0);
|
||||
force_sig_fault(SIGBUS, BUS_OBJERR, (void __user *)pc);
|
||||
}
|
||||
|
||||
void handle_cp_disabled(struct pt_regs *regs, unsigned long pc, unsigned long npc,
|
||||
unsigned long psr)
|
||||
{
|
||||
send_sig_fault(SIGILL, ILL_COPROC, (void __user *)pc, 0, current);
|
||||
send_sig_fault(SIGILL, ILL_COPROC, (void __user *)pc, current);
|
||||
}
|
||||
|
||||
void handle_cp_exception(struct pt_regs *regs, unsigned long pc, unsigned long npc,
|
||||
@@ -343,13 +343,13 @@ void handle_cp_exception(struct pt_regs *regs, unsigned long pc, unsigned long n
|
||||
printk("Co-Processor Exception at PC %08lx NPC %08lx PSR %08lx\n",
|
||||
pc, npc, psr);
|
||||
#endif
|
||||
send_sig_fault(SIGILL, ILL_COPROC, (void __user *)pc, 0, current);
|
||||
send_sig_fault(SIGILL, ILL_COPROC, (void __user *)pc, current);
|
||||
}
|
||||
|
||||
void handle_hw_divzero(struct pt_regs *regs, unsigned long pc, unsigned long npc,
|
||||
unsigned long psr)
|
||||
{
|
||||
send_sig_fault(SIGFPE, FPE_INTDIV, (void __user *)pc, 0, current);
|
||||
send_sig_fault(SIGFPE, FPE_INTDIV, (void __user *)pc, current);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_BUGVERBOSE
|
||||
|
||||
@@ -107,8 +107,8 @@ void bad_trap(struct pt_regs *regs, long lvl)
|
||||
regs->tpc &= 0xffffffff;
|
||||
regs->tnpc &= 0xffffffff;
|
||||
}
|
||||
force_sig_fault(SIGILL, ILL_ILLTRP,
|
||||
(void __user *)regs->tpc, lvl);
|
||||
force_sig_fault_trapno(SIGILL, ILL_ILLTRP,
|
||||
(void __user *)regs->tpc, lvl);
|
||||
}
|
||||
|
||||
void bad_trap_tl1(struct pt_regs *regs, long lvl)
|
||||
@@ -201,8 +201,7 @@ void spitfire_insn_access_exception(struct pt_regs *regs, unsigned long sfsr, un
|
||||
regs->tpc &= 0xffffffff;
|
||||
regs->tnpc &= 0xffffffff;
|
||||
}
|
||||
force_sig_fault(SIGSEGV, SEGV_MAPERR,
|
||||
(void __user *)regs->tpc, 0);
|
||||
force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *)regs->tpc);
|
||||
out:
|
||||
exception_exit(prev_state);
|
||||
}
|
||||
@@ -237,7 +236,7 @@ void sun4v_insn_access_exception(struct pt_regs *regs, unsigned long addr, unsig
|
||||
regs->tpc &= 0xffffffff;
|
||||
regs->tnpc &= 0xffffffff;
|
||||
}
|
||||
force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *) addr, 0);
|
||||
force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *) addr);
|
||||
}
|
||||
|
||||
void sun4v_insn_access_exception_tl1(struct pt_regs *regs, unsigned long addr, unsigned long type_ctx)
|
||||
@@ -321,7 +320,7 @@ void spitfire_data_access_exception(struct pt_regs *regs, unsigned long sfsr, un
|
||||
if (is_no_fault_exception(regs))
|
||||
return;
|
||||
|
||||
force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *)sfar, 0);
|
||||
force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *)sfar);
|
||||
out:
|
||||
exception_exit(prev_state);
|
||||
}
|
||||
@@ -385,13 +384,13 @@ void sun4v_data_access_exception(struct pt_regs *regs, unsigned long addr, unsig
|
||||
*/
|
||||
switch (type) {
|
||||
case HV_FAULT_TYPE_INV_ASI:
|
||||
force_sig_fault(SIGILL, ILL_ILLADR, (void __user *)addr, 0);
|
||||
force_sig_fault(SIGILL, ILL_ILLADR, (void __user *)addr);
|
||||
break;
|
||||
case HV_FAULT_TYPE_MCD_DIS:
|
||||
force_sig_fault(SIGSEGV, SEGV_ACCADI, (void __user *)addr, 0);
|
||||
force_sig_fault(SIGSEGV, SEGV_ACCADI, (void __user *)addr);
|
||||
break;
|
||||
default:
|
||||
force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *)addr, 0);
|
||||
force_sig_fault(SIGSEGV, SEGV_MAPERR, (void __user *)addr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -568,7 +567,7 @@ static void spitfire_ue_log(unsigned long afsr, unsigned long afar, unsigned lon
|
||||
regs->tpc &= 0xffffffff;
|
||||
regs->tnpc &= 0xffffffff;
|
||||
}
|
||||
force_sig_fault(SIGBUS, BUS_OBJERR, (void *)0, 0);
|
||||
force_sig_fault(SIGBUS, BUS_OBJERR, (void *)0);
|
||||
}
|
||||
|
||||
void spitfire_access_error(struct pt_regs *regs, unsigned long status_encoded, unsigned long afar)
|
||||
@@ -2069,8 +2068,7 @@ void do_mcd_err(struct pt_regs *regs, struct sun4v_error_entry ent)
|
||||
/* Send SIGSEGV to the userspace process with the right signal
|
||||
* code
|
||||
*/
|
||||
force_sig_fault(SIGSEGV, SEGV_ADIDERR, (void __user *)ent.err_raddr,
|
||||
0);
|
||||
force_sig_fault(SIGSEGV, SEGV_ADIDERR, (void __user *)ent.err_raddr);
|
||||
}
|
||||
|
||||
/* We run with %pil set to PIL_NORMAL_MAX and PSTATE_IE enabled in %pstate.
|
||||
@@ -2184,7 +2182,7 @@ bool sun4v_nonresum_error_user_handled(struct pt_regs *regs,
|
||||
}
|
||||
if (attrs & SUN4V_ERR_ATTRS_PIO) {
|
||||
force_sig_fault(SIGBUS, BUS_ADRERR,
|
||||
(void __user *)sun4v_get_vaddr(regs), 0);
|
||||
(void __user *)sun4v_get_vaddr(regs));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2340,8 +2338,7 @@ static void do_fpe_common(struct pt_regs *regs)
|
||||
else if (fsr & 0x01)
|
||||
code = FPE_FLTRES;
|
||||
}
|
||||
force_sig_fault(SIGFPE, code,
|
||||
(void __user *)regs->tpc, 0);
|
||||
force_sig_fault(SIGFPE, code, (void __user *)regs->tpc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2395,8 +2392,7 @@ void do_tof(struct pt_regs *regs)
|
||||
regs->tpc &= 0xffffffff;
|
||||
regs->tnpc &= 0xffffffff;
|
||||
}
|
||||
force_sig_fault(SIGEMT, EMT_TAGOVF,
|
||||
(void __user *)regs->tpc, 0);
|
||||
force_sig_fault(SIGEMT, EMT_TAGOVF, (void __user *)regs->tpc);
|
||||
out:
|
||||
exception_exit(prev_state);
|
||||
}
|
||||
@@ -2415,8 +2411,7 @@ void do_div0(struct pt_regs *regs)
|
||||
regs->tpc &= 0xffffffff;
|
||||
regs->tnpc &= 0xffffffff;
|
||||
}
|
||||
force_sig_fault(SIGFPE, FPE_INTDIV,
|
||||
(void __user *)regs->tpc, 0);
|
||||
force_sig_fault(SIGFPE, FPE_INTDIV, (void __user *)regs->tpc);
|
||||
out:
|
||||
exception_exit(prev_state);
|
||||
}
|
||||
@@ -2612,7 +2607,7 @@ void do_illegal_instruction(struct pt_regs *regs)
|
||||
}
|
||||
}
|
||||
}
|
||||
force_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)pc, 0);
|
||||
force_sig_fault(SIGILL, ILL_ILLOPC, (void __user *)pc);
|
||||
out:
|
||||
exception_exit(prev_state);
|
||||
}
|
||||
@@ -2632,7 +2627,7 @@ void mem_address_unaligned(struct pt_regs *regs, unsigned long sfar, unsigned lo
|
||||
if (is_no_fault_exception(regs))
|
||||
return;
|
||||
|
||||
force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)sfar, 0);
|
||||
force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *)sfar);
|
||||
out:
|
||||
exception_exit(prev_state);
|
||||
}
|
||||
@@ -2650,7 +2645,7 @@ void sun4v_do_mna(struct pt_regs *regs, unsigned long addr, unsigned long type_c
|
||||
if (is_no_fault_exception(regs))
|
||||
return;
|
||||
|
||||
force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *) addr, 0);
|
||||
force_sig_fault(SIGBUS, BUS_ADRALN, (void __user *) addr);
|
||||
}
|
||||
|
||||
/* sun4v_mem_corrupt_detect_precise() - Handle precise exception on an ADI
|
||||
@@ -2697,7 +2692,7 @@ void sun4v_mem_corrupt_detect_precise(struct pt_regs *regs, unsigned long addr,
|
||||
regs->tpc &= 0xffffffff;
|
||||
regs->tnpc &= 0xffffffff;
|
||||
}
|
||||
force_sig_fault(SIGSEGV, SEGV_ADIPERR, (void __user *)addr, 0);
|
||||
force_sig_fault(SIGSEGV, SEGV_ADIPERR, (void __user *)addr);
|
||||
}
|
||||
|
||||
void do_privop(struct pt_regs *regs)
|
||||
@@ -2712,8 +2707,7 @@ void do_privop(struct pt_regs *regs)
|
||||
regs->tpc &= 0xffffffff;
|
||||
regs->tnpc &= 0xffffffff;
|
||||
}
|
||||
force_sig_fault(SIGILL, ILL_PRVOPC,
|
||||
(void __user *)regs->tpc, 0);
|
||||
force_sig_fault(SIGILL, ILL_PRVOPC, (void __user *)regs->tpc);
|
||||
out:
|
||||
exception_exit(prev_state);
|
||||
}
|
||||
|
||||
@@ -278,5 +278,5 @@ asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn)
|
||||
{
|
||||
send_sig_fault(SIGBUS, BUS_ADRALN,
|
||||
(void __user *)safe_compute_effective_address(regs, insn),
|
||||
0, current);
|
||||
current);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ static void __do_fault_siginfo(int code, int sig, struct pt_regs *regs,
|
||||
show_signal_msg(regs, sig, code,
|
||||
addr, current);
|
||||
|
||||
force_sig_fault(sig, code, (void __user *) addr, 0);
|
||||
force_sig_fault(sig, code, (void __user *) addr);
|
||||
}
|
||||
|
||||
static unsigned long compute_si_addr(struct pt_regs *regs, int text_fault)
|
||||
|
||||
@@ -176,7 +176,7 @@ static void do_fault_siginfo(int code, int sig, struct pt_regs *regs,
|
||||
if (unlikely(show_unhandled_signals))
|
||||
show_signal_msg(regs, sig, code, addr, current);
|
||||
|
||||
force_sig_fault(sig, code, (void __user *) addr, 0);
|
||||
force_sig_fault(sig, code, (void __user *) addr);
|
||||
}
|
||||
|
||||
static unsigned int get_fault_insn(struct pt_regs *regs, unsigned int insn)
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
131 i386 quotactl sys_quotactl
|
||||
132 i386 getpgid sys_getpgid
|
||||
133 i386 fchdir sys_fchdir
|
||||
134 i386 bdflush sys_bdflush
|
||||
134 i386 bdflush sys_ni_syscall
|
||||
135 i386 sysfs sys_sysfs
|
||||
136 i386 personality sys_personality
|
||||
137 i386 afs_syscall
|
||||
|
||||
@@ -34,7 +34,13 @@ static inline void signal_compat_build_tests(void)
|
||||
BUILD_BUG_ON(NSIGSYS != 2);
|
||||
|
||||
/* This is part of the ABI and can never change in size: */
|
||||
BUILD_BUG_ON(sizeof(siginfo_t) != 128);
|
||||
BUILD_BUG_ON(sizeof(compat_siginfo_t) != 128);
|
||||
|
||||
/* This is a part of the ABI and can never change in alignment */
|
||||
BUILD_BUG_ON(__alignof__(siginfo_t) != 8);
|
||||
BUILD_BUG_ON(__alignof__(compat_siginfo_t) != 4);
|
||||
|
||||
/*
|
||||
* The offsets of all the (unioned) si_fields are fixed
|
||||
* in the ABI, of course. Make sure none of them ever
|
||||
|
||||
@@ -223,7 +223,7 @@
|
||||
# 205 was old nfsservctl
|
||||
205 common nfsservctl sys_ni_syscall
|
||||
206 common _sysctl sys_ni_syscall
|
||||
207 common bdflush sys_bdflush
|
||||
207 common bdflush sys_ni_syscall
|
||||
208 common uname sys_newuname
|
||||
209 common sysinfo sys_sysinfo
|
||||
210 common init_module sys_init_module
|
||||
|
||||
27
fs/buffer.c
27
fs/buffer.c
@@ -3267,33 +3267,6 @@ out:
|
||||
}
|
||||
EXPORT_SYMBOL(try_to_free_buffers);
|
||||
|
||||
/*
|
||||
* There are no bdflush tunables left. But distributions are
|
||||
* still running obsolete flush daemons, so we terminate them here.
|
||||
*
|
||||
* Use of bdflush() is deprecated and will be removed in a future kernel.
|
||||
* The `flush-X' kernel threads fully replace bdflush daemons and this call.
|
||||
*/
|
||||
SYSCALL_DEFINE2(bdflush, int, func, long, data)
|
||||
{
|
||||
static int msg_count;
|
||||
|
||||
if (!capable(CAP_SYS_ADMIN))
|
||||
return -EPERM;
|
||||
|
||||
if (msg_count < 5) {
|
||||
msg_count++;
|
||||
printk(KERN_INFO
|
||||
"warning: process `%s' used the obsolete bdflush"
|
||||
" system call\n", current->comm);
|
||||
printk(KERN_INFO "Fix your initscripts?\n");
|
||||
}
|
||||
|
||||
if (func == 1)
|
||||
do_exit(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Buffer-head allocation
|
||||
*/
|
||||
|
||||
@@ -114,10 +114,10 @@ static int signalfd_copyinfo(struct signalfd_siginfo __user *uinfo,
|
||||
break;
|
||||
case SIL_FAULT_BNDERR:
|
||||
case SIL_FAULT_PKUERR:
|
||||
case SIL_PERF_EVENT:
|
||||
case SIL_FAULT_PERF_EVENT:
|
||||
/*
|
||||
* Fall through to the SIL_FAULT case. SIL_FAULT_BNDERR,
|
||||
* SIL_FAULT_PKUERR, and SIL_PERF_EVENT are only
|
||||
* SIL_FAULT_PKUERR, and SIL_FAULT_PERF_EVENT are only
|
||||
* generated by faults that deliver them synchronously to
|
||||
* userspace. In case someone injects one of these signals
|
||||
* and signalfd catches it treat it as SIL_FAULT.
|
||||
|
||||
@@ -298,11 +298,6 @@ static inline void kernel_signal_stop(void)
|
||||
|
||||
schedule();
|
||||
}
|
||||
#ifdef __ARCH_SI_TRAPNO
|
||||
# define ___ARCH_SI_TRAPNO(_a1) , _a1
|
||||
#else
|
||||
# define ___ARCH_SI_TRAPNO(_a1)
|
||||
#endif
|
||||
#ifdef __ia64__
|
||||
# define ___ARCH_SI_IA64(_a1, _a2, _a3) , _a1, _a2, _a3
|
||||
#else
|
||||
@@ -310,14 +305,11 @@ static inline void kernel_signal_stop(void)
|
||||
#endif
|
||||
|
||||
int force_sig_fault_to_task(int sig, int code, void __user *addr
|
||||
___ARCH_SI_TRAPNO(int trapno)
|
||||
___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
|
||||
, struct task_struct *t);
|
||||
int force_sig_fault(int sig, int code, void __user *addr
|
||||
___ARCH_SI_TRAPNO(int trapno)
|
||||
___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr));
|
||||
int send_sig_fault(int sig, int code, void __user *addr
|
||||
___ARCH_SI_TRAPNO(int trapno)
|
||||
___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
|
||||
, struct task_struct *t);
|
||||
|
||||
@@ -329,6 +321,10 @@ int force_sig_pkuerr(void __user *addr, u32 pkey);
|
||||
int force_sig_perf(void __user *addr, u32 type, u64 sig_data);
|
||||
|
||||
int force_sig_ptrace_errno_trap(int errno, void __user *addr);
|
||||
int force_sig_fault_trapno(int sig, int code, void __user *addr, int trapno);
|
||||
int send_sig_fault_trapno(int sig, int code, void __user *addr, int trapno,
|
||||
struct task_struct *t);
|
||||
int force_sig_seccomp(int syscall, int reason, bool force_coredump);
|
||||
|
||||
extern int send_sig_info(int, struct kernel_siginfo *, struct task_struct *);
|
||||
extern void force_sigsegv(int sig);
|
||||
|
||||
@@ -44,7 +44,7 @@ enum siginfo_layout {
|
||||
SIL_FAULT_MCEERR,
|
||||
SIL_FAULT_BNDERR,
|
||||
SIL_FAULT_PKUERR,
|
||||
SIL_PERF_EVENT,
|
||||
SIL_FAULT_PERF_EVENT,
|
||||
SIL_CHLD,
|
||||
SIL_RT,
|
||||
SIL_SYS,
|
||||
|
||||
@@ -1158,7 +1158,6 @@ asmlinkage long sys_ustat(unsigned dev, struct ustat __user *ubuf);
|
||||
asmlinkage long sys_vfork(void);
|
||||
asmlinkage long sys_recv(int, void __user *, size_t, unsigned);
|
||||
asmlinkage long sys_send(int, void __user *, size_t, unsigned);
|
||||
asmlinkage long sys_bdflush(int func, long data);
|
||||
asmlinkage long sys_oldumount(char __user *name);
|
||||
asmlinkage long sys_uselib(const char __user *library);
|
||||
asmlinkage long sys_sysfs(int option,
|
||||
|
||||
@@ -29,6 +29,11 @@ typedef union sigval {
|
||||
#define __ARCH_SI_ATTRIBUTES
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Be careful when extending this union. On 32bit siginfo_t is 32bit
|
||||
* aligned. Which means that a 64bit field or any other field that
|
||||
* would increase the alignment of siginfo_t will break the ABI.
|
||||
*/
|
||||
union __sifields {
|
||||
/* kill() */
|
||||
struct {
|
||||
|
||||
@@ -243,7 +243,6 @@ struct vfs_ns_cap_data {
|
||||
/* Allow examination and configuration of disk quotas */
|
||||
/* Allow setting the domainname */
|
||||
/* Allow setting the hostname */
|
||||
/* Allow calling bdflush() */
|
||||
/* Allow mount() and umount(), setting up new smb connection */
|
||||
/* Allow some autofs root ioctls */
|
||||
/* Allow nfsservctl */
|
||||
|
||||
@@ -922,30 +922,6 @@ void get_seccomp_filter(struct task_struct *tsk)
|
||||
refcount_inc(&orig->users);
|
||||
}
|
||||
|
||||
static void seccomp_init_siginfo(kernel_siginfo_t *info, int syscall, int reason)
|
||||
{
|
||||
clear_siginfo(info);
|
||||
info->si_signo = SIGSYS;
|
||||
info->si_code = SYS_SECCOMP;
|
||||
info->si_call_addr = (void __user *)KSTK_EIP(current);
|
||||
info->si_errno = reason;
|
||||
info->si_arch = syscall_get_arch(current);
|
||||
info->si_syscall = syscall;
|
||||
}
|
||||
|
||||
/**
|
||||
* seccomp_send_sigsys - signals the task to allow in-process syscall emulation
|
||||
* @syscall: syscall number to send to userland
|
||||
* @reason: filter-supplied reason code to send to userland (via si_errno)
|
||||
*
|
||||
* Forces a SIGSYS with a code of SYS_SECCOMP and related sigsys info.
|
||||
*/
|
||||
static void seccomp_send_sigsys(int syscall, int reason)
|
||||
{
|
||||
struct kernel_siginfo info;
|
||||
seccomp_init_siginfo(&info, syscall, reason);
|
||||
force_sig_info(&info);
|
||||
}
|
||||
#endif /* CONFIG_SECCOMP_FILTER */
|
||||
|
||||
/* For use with seccomp_actions_logged */
|
||||
@@ -1218,7 +1194,7 @@ static int __seccomp_filter(int this_syscall, const struct seccomp_data *sd,
|
||||
/* Show the handler the original registers. */
|
||||
syscall_rollback(current, current_pt_regs());
|
||||
/* Let the filter pass back 16 bits of data. */
|
||||
seccomp_send_sigsys(this_syscall, data);
|
||||
force_sig_seccomp(this_syscall, data, false);
|
||||
goto skip;
|
||||
|
||||
case SECCOMP_RET_TRACE:
|
||||
@@ -1288,19 +1264,15 @@ static int __seccomp_filter(int this_syscall, const struct seccomp_data *sd,
|
||||
seccomp_log(this_syscall, SIGSYS, action, true);
|
||||
/* Dump core only if this is the last remaining thread. */
|
||||
if (action != SECCOMP_RET_KILL_THREAD ||
|
||||
get_nr_threads(current) == 1) {
|
||||
kernel_siginfo_t info;
|
||||
|
||||
(atomic_read(¤t->signal->live) == 1)) {
|
||||
/* Show the original registers in the dump. */
|
||||
syscall_rollback(current, current_pt_regs());
|
||||
/* Trigger a manual coredump since do_exit skips it. */
|
||||
seccomp_init_siginfo(&info, this_syscall, data);
|
||||
do_coredump(&info);
|
||||
}
|
||||
if (action == SECCOMP_RET_KILL_THREAD)
|
||||
/* Trigger a coredump with SIGSYS */
|
||||
force_sig_seccomp(this_syscall, data, true);
|
||||
} else {
|
||||
do_exit(SIGSYS);
|
||||
else
|
||||
do_group_exit(SIGSYS);
|
||||
}
|
||||
return -1; /* skip the syscall go directly to signal handling */
|
||||
}
|
||||
|
||||
unreachable();
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
#include <asm/unistd.h>
|
||||
#include <asm/siginfo.h>
|
||||
#include <asm/cacheflush.h>
|
||||
#include <asm/syscall.h> /* for syscall_get_* */
|
||||
|
||||
/*
|
||||
* SLAB caches for signal bits.
|
||||
@@ -1213,7 +1214,7 @@ static inline bool has_si_pid_and_uid(struct kernel_siginfo *info)
|
||||
case SIL_FAULT_MCEERR:
|
||||
case SIL_FAULT_BNDERR:
|
||||
case SIL_FAULT_PKUERR:
|
||||
case SIL_PERF_EVENT:
|
||||
case SIL_FAULT_PERF_EVENT:
|
||||
case SIL_SYS:
|
||||
ret = false;
|
||||
break;
|
||||
@@ -1322,7 +1323,7 @@ int do_send_sig_info(int sig, struct kernel_siginfo *info, struct task_struct *p
|
||||
* that is why we also clear SIGNAL_UNKILLABLE.
|
||||
*/
|
||||
static int
|
||||
force_sig_info_to_task(struct kernel_siginfo *info, struct task_struct *t)
|
||||
force_sig_info_to_task(struct kernel_siginfo *info, struct task_struct *t, bool sigdfl)
|
||||
{
|
||||
unsigned long int flags;
|
||||
int ret, blocked, ignored;
|
||||
@@ -1333,7 +1334,7 @@ force_sig_info_to_task(struct kernel_siginfo *info, struct task_struct *t)
|
||||
action = &t->sighand->action[sig-1];
|
||||
ignored = action->sa.sa_handler == SIG_IGN;
|
||||
blocked = sigismember(&t->blocked, sig);
|
||||
if (blocked || ignored) {
|
||||
if (blocked || ignored || sigdfl) {
|
||||
action->sa.sa_handler = SIG_DFL;
|
||||
if (blocked) {
|
||||
sigdelset(&t->blocked, sig);
|
||||
@@ -1354,7 +1355,7 @@ force_sig_info_to_task(struct kernel_siginfo *info, struct task_struct *t)
|
||||
|
||||
int force_sig_info(struct kernel_siginfo *info)
|
||||
{
|
||||
return force_sig_info_to_task(info, current);
|
||||
return force_sig_info_to_task(info, current, false);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1682,7 +1683,6 @@ void force_sigsegv(int sig)
|
||||
}
|
||||
|
||||
int force_sig_fault_to_task(int sig, int code, void __user *addr
|
||||
___ARCH_SI_TRAPNO(int trapno)
|
||||
___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
|
||||
, struct task_struct *t)
|
||||
{
|
||||
@@ -1693,28 +1693,22 @@ int force_sig_fault_to_task(int sig, int code, void __user *addr
|
||||
info.si_errno = 0;
|
||||
info.si_code = code;
|
||||
info.si_addr = addr;
|
||||
#ifdef __ARCH_SI_TRAPNO
|
||||
info.si_trapno = trapno;
|
||||
#endif
|
||||
#ifdef __ia64__
|
||||
info.si_imm = imm;
|
||||
info.si_flags = flags;
|
||||
info.si_isr = isr;
|
||||
#endif
|
||||
return force_sig_info_to_task(&info, t);
|
||||
return force_sig_info_to_task(&info, t, false);
|
||||
}
|
||||
|
||||
int force_sig_fault(int sig, int code, void __user *addr
|
||||
___ARCH_SI_TRAPNO(int trapno)
|
||||
___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr))
|
||||
{
|
||||
return force_sig_fault_to_task(sig, code, addr
|
||||
___ARCH_SI_TRAPNO(trapno)
|
||||
___ARCH_SI_IA64(imm, flags, isr), current);
|
||||
}
|
||||
|
||||
int send_sig_fault(int sig, int code, void __user *addr
|
||||
___ARCH_SI_TRAPNO(int trapno)
|
||||
___ARCH_SI_IA64(int imm, unsigned int flags, unsigned long isr)
|
||||
, struct task_struct *t)
|
||||
{
|
||||
@@ -1725,9 +1719,6 @@ int send_sig_fault(int sig, int code, void __user *addr
|
||||
info.si_errno = 0;
|
||||
info.si_code = code;
|
||||
info.si_addr = addr;
|
||||
#ifdef __ARCH_SI_TRAPNO
|
||||
info.si_trapno = trapno;
|
||||
#endif
|
||||
#ifdef __ia64__
|
||||
info.si_imm = imm;
|
||||
info.si_flags = flags;
|
||||
@@ -1809,6 +1800,27 @@ int force_sig_perf(void __user *addr, u32 type, u64 sig_data)
|
||||
return force_sig_info(&info);
|
||||
}
|
||||
|
||||
/**
|
||||
* force_sig_seccomp - signals the task to allow in-process syscall emulation
|
||||
* @syscall: syscall number to send to userland
|
||||
* @reason: filter-supplied reason code to send to userland (via si_errno)
|
||||
*
|
||||
* Forces a SIGSYS with a code of SYS_SECCOMP and related sigsys info.
|
||||
*/
|
||||
int force_sig_seccomp(int syscall, int reason, bool force_coredump)
|
||||
{
|
||||
struct kernel_siginfo info;
|
||||
|
||||
clear_siginfo(&info);
|
||||
info.si_signo = SIGSYS;
|
||||
info.si_code = SYS_SECCOMP;
|
||||
info.si_call_addr = (void __user *)KSTK_EIP(current);
|
||||
info.si_errno = reason;
|
||||
info.si_arch = syscall_get_arch(current);
|
||||
info.si_syscall = syscall;
|
||||
return force_sig_info_to_task(&info, current, force_coredump);
|
||||
}
|
||||
|
||||
/* For the crazy architectures that include trap information in
|
||||
* the errno field, instead of an actual errno value.
|
||||
*/
|
||||
@@ -1824,6 +1836,39 @@ int force_sig_ptrace_errno_trap(int errno, void __user *addr)
|
||||
return force_sig_info(&info);
|
||||
}
|
||||
|
||||
/* For the rare architectures that include trap information using
|
||||
* si_trapno.
|
||||
*/
|
||||
int force_sig_fault_trapno(int sig, int code, void __user *addr, int trapno)
|
||||
{
|
||||
struct kernel_siginfo info;
|
||||
|
||||
clear_siginfo(&info);
|
||||
info.si_signo = sig;
|
||||
info.si_errno = 0;
|
||||
info.si_code = code;
|
||||
info.si_addr = addr;
|
||||
info.si_trapno = trapno;
|
||||
return force_sig_info(&info);
|
||||
}
|
||||
|
||||
/* For the rare architectures that include trap information using
|
||||
* si_trapno.
|
||||
*/
|
||||
int send_sig_fault_trapno(int sig, int code, void __user *addr, int trapno,
|
||||
struct task_struct *t)
|
||||
{
|
||||
struct kernel_siginfo info;
|
||||
|
||||
clear_siginfo(&info);
|
||||
info.si_signo = sig;
|
||||
info.si_errno = 0;
|
||||
info.si_code = code;
|
||||
info.si_addr = addr;
|
||||
info.si_trapno = trapno;
|
||||
return send_sig_info(info.si_signo, &info, t);
|
||||
}
|
||||
|
||||
int kill_pgrp(struct pid *pid, int sig, int priv)
|
||||
{
|
||||
int ret;
|
||||
@@ -2573,7 +2618,7 @@ static void hide_si_addr_tag_bits(struct ksignal *ksig)
|
||||
case SIL_FAULT_MCEERR:
|
||||
case SIL_FAULT_BNDERR:
|
||||
case SIL_FAULT_PKUERR:
|
||||
case SIL_PERF_EVENT:
|
||||
case SIL_FAULT_PERF_EVENT:
|
||||
ksig->info.si_addr = arch_untagged_si_addr(
|
||||
ksig->info.si_addr, ksig->sig, ksig->info.si_code);
|
||||
break;
|
||||
@@ -3258,11 +3303,14 @@ enum siginfo_layout siginfo_layout(unsigned sig, int si_code)
|
||||
layout = SIL_FAULT_PKUERR;
|
||||
#endif
|
||||
else if ((sig == SIGTRAP) && (si_code == TRAP_PERF))
|
||||
layout = SIL_PERF_EVENT;
|
||||
#ifdef __ARCH_SI_TRAPNO
|
||||
else if (layout == SIL_FAULT)
|
||||
layout = SIL_FAULT_PERF_EVENT;
|
||||
else if (IS_ENABLED(CONFIG_SPARC) &&
|
||||
(sig == SIGILL) && (si_code == ILL_ILLTRP))
|
||||
layout = SIL_FAULT_TRAPNO;
|
||||
else if (IS_ENABLED(CONFIG_ALPHA) &&
|
||||
((sig == SIGFPE) ||
|
||||
((sig == SIGTRAP) && (si_code == TRAP_UNK))))
|
||||
layout = SIL_FAULT_TRAPNO;
|
||||
#endif
|
||||
}
|
||||
else if (si_code <= NSIGPOLL)
|
||||
layout = SIL_POLL;
|
||||
@@ -3384,7 +3432,7 @@ void copy_siginfo_to_external32(struct compat_siginfo *to,
|
||||
to->si_addr = ptr_to_compat(from->si_addr);
|
||||
to->si_pkey = from->si_pkey;
|
||||
break;
|
||||
case SIL_PERF_EVENT:
|
||||
case SIL_FAULT_PERF_EVENT:
|
||||
to->si_addr = ptr_to_compat(from->si_addr);
|
||||
to->si_perf_data = from->si_perf_data;
|
||||
to->si_perf_type = from->si_perf_type;
|
||||
@@ -3461,7 +3509,7 @@ static int post_copy_siginfo_from_user32(kernel_siginfo_t *to,
|
||||
to->si_addr = compat_ptr(from->si_addr);
|
||||
to->si_pkey = from->si_pkey;
|
||||
break;
|
||||
case SIL_PERF_EVENT:
|
||||
case SIL_FAULT_PERF_EVENT:
|
||||
to->si_addr = compat_ptr(from->si_addr);
|
||||
to->si_perf_data = from->si_perf_data;
|
||||
to->si_perf_type = from->si_perf_type;
|
||||
|
||||
@@ -416,7 +416,6 @@ COND_SYSCALL(epoll_wait);
|
||||
COND_SYSCALL(recv);
|
||||
COND_SYSCALL_COMPAT(recv);
|
||||
COND_SYSCALL(send);
|
||||
COND_SYSCALL(bdflush);
|
||||
COND_SYSCALL(uselib);
|
||||
|
||||
/* optional: time32 */
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
131 nospu quotactl sys_quotactl
|
||||
132 common getpgid sys_getpgid
|
||||
133 common fchdir sys_fchdir
|
||||
134 common bdflush sys_bdflush
|
||||
134 common bdflush sys_ni_syscall
|
||||
135 common sysfs sys_sysfs
|
||||
136 32 personality sys_personality ppc64_personality
|
||||
136 64 personality ppc64_personality
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
131 common quotactl sys_quotactl sys_quotactl
|
||||
132 common getpgid sys_getpgid sys_getpgid
|
||||
133 common fchdir sys_fchdir sys_fchdir
|
||||
134 common bdflush sys_bdflush sys_bdflush
|
||||
134 common bdflush - -
|
||||
135 common sysfs sys_sysfs sys_sysfs
|
||||
136 common personality sys_s390_personality sys_s390_personality
|
||||
137 common afs_syscall - -
|
||||
|
||||
Reference in New Issue
Block a user