On Thu, Apr 20, 2017 at 09:52:58AM +0200, Sebastien Marie wrote:
> Could you send two separated diffs ? One for uint64_t stuff and another
> for profil(2) ?
Coming up, first off the uint64_t diff. While at it, I propose changing
the type of code in `struct ktr_pledge` to uint64_t for consistency and
since it gets assigned a uint64_t in the ktrpledge function.
Index: kern/kern_pledge.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_pledge.c,v
retrieving revision 1.204
diff -u -p -r1.204 kern_pledge.c
--- kern/kern_pledge.c 17 Apr 2017 20:22:14 -0000 1.204
+++ kern/kern_pledge.c 20 Apr 2017 09:06:44 -0000
@@ -545,7 +545,7 @@ sys_pledge(struct proc *p, void *v, regi
}
int
-pledge_syscall(struct proc *p, int code, int *tval)
+pledge_syscall(struct proc *p, int code, uint64_t *tval)
{
p->p_pledge_syscall = code;
*tval = 0;
Index: sys/ktrace.h
===================================================================
RCS file: /cvs/src/sys/sys/ktrace.h,v
retrieving revision 1.33
diff -u -p -r1.33 ktrace.h
--- sys/ktrace.h 8 Oct 2016 02:16:43 -0000 1.33
+++ sys/ktrace.h 20 Apr 2017 09:06:44 -0000
@@ -158,9 +158,9 @@ struct ktr_user {
*/
#define KTR_PLEDGE 12
struct ktr_pledge {
- int error;
- int syscall;
- int64_t code;
+ int error;
+ int syscall;
+ uint64_t code;
};
/*
Index: sys/pledge.h
===================================================================
RCS file: /cvs/src/sys/sys/pledge.h,v
retrieving revision 1.30
diff -u -p -r1.30 pledge.h
--- sys/pledge.h 23 Jan 2017 04:25:05 -0000 1.30
+++ sys/pledge.h 20 Apr 2017 09:06:44 -0000
@@ -111,7 +111,7 @@ static struct {
#ifdef _KERNEL
-int pledge_syscall(struct proc *, int, int *);
+int pledge_syscall(struct proc *, int, uint64_t *);
int pledge_fail(struct proc *, int, uint64_t);
struct mbuf;
Index: sys/syscall_mi.h
===================================================================
RCS file: /cvs/src/sys/sys/syscall_mi.h,v
retrieving revision 1.17
diff -u -p -r1.17 syscall_mi.h
--- sys/syscall_mi.h 14 Feb 2017 10:31:15 -0000 1.17
+++ sys/syscall_mi.h 20 Apr 2017 09:06:44 -0000
@@ -45,8 +45,9 @@ static inline int
mi_syscall(struct proc *p, register_t code, const struct sysent *callp,
register_t *argp, register_t retval[2])
{
+ uint64_t tval;
int lock = !(callp->sy_flags & SY_NOLOCK);
- int error, pledged, tval;
+ int error, pledged;
/* refresh the thread's cache of the process's creds */
refreshcreds(p);