Revert "Pass the syscall number to capsicum permission-denied signals"
This broke the i386 build. This reverts commit 3a522ba1bc852c3d4660a4fa32e4a94999d09a47.
This commit is contained in:
parent
8fc2a3c417
commit
d2b558281a
@ -454,16 +454,6 @@ and the
|
||||
.Va si_code
|
||||
member is set to
|
||||
.Dv TRAP_CAP .
|
||||
The system call number is stored in the
|
||||
.Va si_syscall
|
||||
field of the
|
||||
.Fa siginfo
|
||||
signal handler parameter.
|
||||
The other system call parameters can be read from the
|
||||
.Fa ucontext_t
|
||||
but the system call number is typically stored in the register
|
||||
that also contains the return value and so is unavailable in the
|
||||
signal handler.
|
||||
.Pp
|
||||
See
|
||||
.Xr capsicum 4
|
||||
|
@ -85,8 +85,6 @@ timer overrun count
|
||||
.It Vt int Ta Va si_mqd Ta
|
||||
.Tn POSIX
|
||||
message queue ID
|
||||
.It Vt int Ta Va si_syscall Ta
|
||||
system-call number for system calls blocked by Capsicum
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
|
@ -1059,7 +1059,6 @@ cpu_fetch_syscall_args(struct thread *td)
|
||||
sa = &td->td_sa;
|
||||
|
||||
sa->code = frame->tf_rax;
|
||||
sa->original_code = sa->code;
|
||||
|
||||
if (__predict_false(sa->code == SYS_syscall ||
|
||||
sa->code == SYS___syscall ||
|
||||
|
@ -101,7 +101,6 @@ cloudabi32_fetch_syscall_args(struct thread *td)
|
||||
|
||||
/* Obtain system call number. */
|
||||
sa->code = frame->tf_rax;
|
||||
sa->original_code = sa->code;
|
||||
if (sa->code >= CLOUDABI32_SYS_MAXSYSCALL)
|
||||
return (ENOSYS);
|
||||
sa->callp = &cloudabi32_sysent[sa->code];
|
||||
|
@ -98,7 +98,6 @@ cloudabi64_fetch_syscall_args(struct thread *td)
|
||||
|
||||
/* Obtain system call number. */
|
||||
sa->code = frame->tf_rax;
|
||||
sa->original_code = sa->code;
|
||||
if (sa->code >= CLOUDABI64_SYS_MAXSYSCALL)
|
||||
return (ENOSYS);
|
||||
sa->callp = &cloudabi64_sysent[sa->code];
|
||||
|
@ -150,7 +150,6 @@ ia32_fetch_syscall_args(struct thread *td)
|
||||
|
||||
params = (caddr_t)frame->tf_rsp + sizeof(u_int32_t);
|
||||
sa->code = frame->tf_rax;
|
||||
sa->original_code = sa->code;
|
||||
|
||||
/*
|
||||
* Need to check if this is a 32 bit or 64 bit syscall.
|
||||
|
@ -92,7 +92,6 @@ struct mdproc {
|
||||
|
||||
struct syscall_args {
|
||||
u_int code;
|
||||
u_int original_code;
|
||||
struct sysent *callp;
|
||||
register_t args[8];
|
||||
};
|
||||
|
@ -191,7 +191,6 @@ linux_fetch_syscall_args(struct thread *td)
|
||||
sa->args[4] = frame->tf_r8;
|
||||
sa->args[5] = frame->tf_r9;
|
||||
sa->code = frame->tf_rax;
|
||||
sa->original_code = sa->code;
|
||||
|
||||
if (sa->code >= p->p_sysent->sv_size)
|
||||
/* nosys */
|
||||
|
@ -662,7 +662,6 @@ linux32_fetch_syscall_args(struct thread *td)
|
||||
sa->args[4] = frame->tf_rdi;
|
||||
sa->args[5] = frame->tf_rbp; /* Unconfirmed */
|
||||
sa->code = frame->tf_rax;
|
||||
sa->original_code = sa->code;
|
||||
|
||||
if (sa->code >= p->p_sysent->sv_size)
|
||||
/* nosys */
|
||||
|
@ -108,7 +108,6 @@ cpu_fetch_syscall_args(struct thread *td)
|
||||
nap = 4;
|
||||
sa = &td->td_sa;
|
||||
sa->code = td->td_frame->tf_r7;
|
||||
sa->original_code = sa->code;
|
||||
ap = &td->td_frame->tf_r0;
|
||||
if (sa->code == SYS_syscall) {
|
||||
sa->code = *ap++;
|
||||
|
@ -78,7 +78,6 @@ cloudabi32_fetch_syscall_args(struct thread *td)
|
||||
|
||||
/* Obtain system call number. */
|
||||
sa->code = frame->tf_r12;
|
||||
sa->original_code = sa->code;
|
||||
if (sa->code >= CLOUDABI32_SYS_MAXSYSCALL)
|
||||
return (ENOSYS);
|
||||
sa->callp = &cloudabi32_sysent[sa->code];
|
||||
|
@ -75,7 +75,6 @@ struct mdproc {
|
||||
*/
|
||||
struct syscall_args {
|
||||
u_int code;
|
||||
u_int original_code;
|
||||
struct sysent *callp;
|
||||
register_t args[MAXARGS];
|
||||
} __aligned(8);
|
||||
|
@ -175,7 +175,6 @@ freebsd32_fetch_syscall_args(struct thread *td)
|
||||
|
||||
/* r7 is the syscall id */
|
||||
sa->code = td->td_frame->tf_x[7];
|
||||
sa->original_code = sa->code;
|
||||
|
||||
if (sa->code == SYS_syscall) {
|
||||
sa->code = *ap++;
|
||||
|
@ -130,7 +130,6 @@ cpu_fetch_syscall_args(struct thread *td)
|
||||
dst_ap = &sa->args[0];
|
||||
|
||||
sa->code = td->td_frame->tf_x[8];
|
||||
sa->original_code = sa->code;
|
||||
|
||||
if (__predict_false(sa->code == SYS_syscall || sa->code == SYS___syscall)) {
|
||||
sa->code = *ap++;
|
||||
|
@ -75,7 +75,6 @@ cloudabi32_fetch_syscall_args(struct thread *td)
|
||||
|
||||
/* Obtain system call number. */
|
||||
sa->code = frame->tf_x[0];
|
||||
sa->original_code = sa->code;
|
||||
if (sa->code >= CLOUDABI32_SYS_MAXSYSCALL)
|
||||
return (ENOSYS);
|
||||
sa->callp = &cloudabi32_sysent[sa->code];
|
||||
|
@ -78,7 +78,6 @@ cloudabi64_fetch_syscall_args(struct thread *td)
|
||||
|
||||
/* Obtain system call number. */
|
||||
sa->code = frame->tf_x[8];
|
||||
sa->original_code = sa->code;
|
||||
if (sa->code >= CLOUDABI64_SYS_MAXSYSCALL)
|
||||
return (ENOSYS);
|
||||
sa->callp = &cloudabi64_sysent[sa->code];
|
||||
|
@ -49,7 +49,6 @@ struct mdproc {
|
||||
#define MAXARGS 8
|
||||
struct syscall_args {
|
||||
u_int code;
|
||||
u_int original_code;
|
||||
struct sysent *callp;
|
||||
register_t args[MAXARGS];
|
||||
};
|
||||
|
@ -125,7 +125,6 @@ linux_fetch_syscall_args(struct thread *td)
|
||||
sa = &td->td_sa;
|
||||
|
||||
sa->code = td->td_frame->tf_x[8];
|
||||
sa->original_code = sa->code;
|
||||
/* LINUXTODO: generic syscall? */
|
||||
if (sa->code >= p->p_sysent->sv_size)
|
||||
sa->callp = &p->p_sysent->sv_table[0];
|
||||
|
@ -96,7 +96,6 @@ cloudabi32_fetch_syscall_args(struct thread *td)
|
||||
|
||||
/* Obtain system call number. */
|
||||
sa->code = frame->tf_eax;
|
||||
sa->original_code = sa->code;
|
||||
if (sa->code >= CLOUDABI32_SYS_MAXSYSCALL)
|
||||
return (ENOSYS);
|
||||
sa->callp = &cloudabi32_sysent[sa->code];
|
||||
|
@ -1052,7 +1052,6 @@ cpu_fetch_syscall_args(struct thread *td)
|
||||
#endif
|
||||
|
||||
sa->code = frame->tf_eax;
|
||||
sa->original_code = sa->code;
|
||||
params = (caddr_t)frame->tf_esp + sizeof(uint32_t);
|
||||
|
||||
/*
|
||||
|
@ -64,7 +64,6 @@ struct mdproc {
|
||||
|
||||
struct syscall_args {
|
||||
u_int code;
|
||||
u_int original_code;
|
||||
struct sysent *callp;
|
||||
register_t args[8];
|
||||
};
|
||||
|
@ -756,7 +756,6 @@ linux_fetch_syscall_args(struct thread *td)
|
||||
sa = &td->td_sa;
|
||||
|
||||
sa->code = frame->tf_eax;
|
||||
sa->original_code = sa->code;
|
||||
sa->args[0] = frame->tf_ebx;
|
||||
sa->args[1] = frame->tf_ecx;
|
||||
sa->args[2] = frame->tf_edx;
|
||||
|
@ -230,7 +230,6 @@ syscallret(struct thread *td)
|
||||
ksi.ksi_signo = SIGTRAP;
|
||||
ksi.ksi_errno = td->td_errno;
|
||||
ksi.ksi_code = TRAP_CAP;
|
||||
ksi.ksi_info.si_syscall = sa->original_code;
|
||||
trapsignal(td, &ksi);
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +84,6 @@ struct mdproc {
|
||||
#define MAXARGS 8
|
||||
struct syscall_args {
|
||||
u_int code;
|
||||
u_int original_code;
|
||||
struct sysent *callp;
|
||||
register_t args[MAXARGS];
|
||||
};
|
||||
|
@ -355,7 +355,6 @@ cpu_fetch_syscall_args(struct thread *td)
|
||||
else
|
||||
locr0->pc += sizeof(int);
|
||||
sa->code = locr0->v0;
|
||||
sa->original_code = sa->code;
|
||||
|
||||
switch (sa->code) {
|
||||
case SYS___syscall:
|
||||
|
@ -62,7 +62,6 @@ struct mdproc {
|
||||
#define MAXARGS 8
|
||||
struct syscall_args {
|
||||
u_int code;
|
||||
u_int original_code;
|
||||
struct sysent *callp;
|
||||
register_t args[MAXARGS];
|
||||
};
|
||||
|
@ -667,7 +667,6 @@ cpu_fetch_syscall_args(struct thread *td)
|
||||
sa = &td->td_sa;
|
||||
|
||||
sa->code = frame->fixreg[0];
|
||||
sa->original_code = sa->code;
|
||||
params = (caddr_t)(frame->fixreg + FIRSTARG);
|
||||
n = NARGREG;
|
||||
|
||||
|
@ -48,7 +48,6 @@ struct mdproc {
|
||||
#define MAXARGS 8
|
||||
struct syscall_args {
|
||||
u_int code;
|
||||
u_int original_code;
|
||||
struct sysent *callp;
|
||||
register_t args[MAXARGS];
|
||||
};
|
||||
|
@ -103,7 +103,6 @@ cpu_fetch_syscall_args(struct thread *td)
|
||||
dst_ap = &sa->args[0];
|
||||
|
||||
sa->code = td->td_frame->tf_t[0];
|
||||
sa->original_code = sa->code;
|
||||
|
||||
if (__predict_false(sa->code == SYS_syscall || sa->code == SYS___syscall)) {
|
||||
sa->code = *ap++;
|
||||
|
@ -255,12 +255,6 @@ typedef struct __siginfo {
|
||||
struct {
|
||||
long _band; /* band event for SIGPOLL */
|
||||
} _poll; /* was this ever used ? */
|
||||
struct {
|
||||
int _syscall; /* Syscall number for signals
|
||||
* delivered as a result of
|
||||
* system calls denied by
|
||||
* Capsicum. */
|
||||
} _capsicum;
|
||||
struct {
|
||||
long __spare1__;
|
||||
int __spare2__[7];
|
||||
@ -273,7 +267,6 @@ typedef struct __siginfo {
|
||||
#define si_overrun _reason._timer._overrun
|
||||
#define si_mqd _reason._mesgq._mqd
|
||||
#define si_band _reason._poll._band
|
||||
#define si_syscall _reason._capsicum._syscall
|
||||
|
||||
#if defined(_WANT_LWPINFO32) || (defined(_KERNEL) && defined(__LP64__))
|
||||
struct siginfo32 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user