Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F111373981
D49170.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
7 KB
Referenced Files
None
Subscribers
None
D49170.diff
View Options
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -49,6 +49,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/boottrace.h>
+#include <sys/cfi.h>
#include <sys/conf.h>
#include <sys/cpuset.h>
#include <sys/dtrace_bsd.h>
@@ -254,7 +255,7 @@
* module. Finally, it allows for optional "kernel threads".
*/
void
-mi_startup(void)
+mi_startup(void) __NOCFI
{
struct sysinit *sip;
int last;
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -42,6 +42,7 @@
#include <sys/systm.h>
#include <sys/bitstring.h>
#include <sys/sysproto.h>
+#include <sys/cfi.h>
#include <sys/eventhandler.h>
#include <sys/fcntl.h>
#include <sys/filedesc.h>
@@ -81,6 +82,7 @@
#include <vm/vm_extern.h>
#include <vm/uma.h>
+
#ifdef KDTRACE_HOOKS
#include <sys/dtrace_bsd.h>
dtrace_fork_func_t dtrace_fasttrap_fork;
@@ -1113,8 +1115,8 @@
* is called from the MD fork_trampoline() entry point.
*/
void
-fork_exit(void (*callout)(void *, struct trapframe *), void *arg,
- struct trapframe *frame)
+fork_exit(void (*callout)(struct thread *, struct trapframe *), void *arg,
+ struct trapframe *frame) __NOCFI
{
struct proc *p;
struct thread *td;
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c
--- a/sys/kern/kern_intr.c
+++ b/sys/kern/kern_intr.c
@@ -33,6 +33,7 @@
#include <sys/param.h>
#include <sys/bus.h>
+#include <sys/cfi.h>
#include <sys/conf.h>
#include <sys/cpuset.h>
#include <sys/rtprio.h>
@@ -1187,7 +1188,7 @@
}
static void
-ithread_execute_handlers(struct proc *p, struct intr_event *ie)
+ithread_execute_handlers(struct proc *p, struct intr_event *ie) __NOCFI
{
/* Interrupt handlers should not sleep. */
@@ -1334,7 +1335,7 @@
* o EINVAL: stray interrupt.
*/
int
-intr_event_handle(struct intr_event *ie, struct trapframe *frame)
+intr_event_handle(struct intr_event *ie, struct trapframe *frame) __NOCFI
{
struct intr_handler *ih;
struct trapframe *oldframe;
diff --git a/sys/kern/subr_epoch.c b/sys/kern/subr_epoch.c
--- a/sys/kern/subr_epoch.c
+++ b/sys/kern/subr_epoch.c
@@ -28,6 +28,7 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/cfi.h>
#include <sys/counter.h>
#include <sys/epoch.h>
#include <sys/gtaskqueue.h>
@@ -801,7 +802,7 @@
}
static void
-epoch_call_task(void *arg __unused)
+epoch_call_task(void *arg __unused) __NOCFI
{
ck_stack_entry_t *cursor, *head, *next;
ck_epoch_record_t *record;
diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c
--- a/sys/kern/subr_pctrie.c
+++ b/sys/kern/subr_pctrie.c
@@ -51,6 +51,7 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/cfi.h>
#include <sys/kernel.h>
#include <sys/libkern.h>
#include <sys/pctrie.h>
@@ -1159,7 +1160,7 @@
*/
static __always_inline struct pctrie_node *
pctrie_reclaim_prune(struct pctrie_node **pnode, struct pctrie_node *parent,
- pctrie_cb_t callback, int keyoff, void *arg)
+ pctrie_cb_t callback, int keyoff, void *arg) __NOCFI
{
struct pctrie_node *child, *node;
int slot;
@@ -1191,8 +1192,8 @@
* Recover the node parent from its first child and continue pruning.
*/
static __always_inline struct pctrie_node *
-pctrie_reclaim_resume_compound(struct pctrie_node **pnode,
- pctrie_cb_t callback, int keyoff, void *arg)
+pctrie_reclaim_resume_compound(struct pctrie_node **pnode, pctrie_cb_t callback,
+ int keyoff, void *arg) __NOCFI
{
struct pctrie_node *parent, *node;
@@ -1210,9 +1211,8 @@
* Find the trie root, and start pruning with a NULL parent.
*/
static __always_inline struct pctrie_node *
-pctrie_reclaim_begin_compound(struct pctrie_node **pnode,
- struct pctrie *ptree,
- pctrie_cb_t callback, int keyoff, void *arg)
+pctrie_reclaim_begin_compound(struct pctrie_node **pnode, struct pctrie *ptree,
+ pctrie_cb_t callback, int keyoff, void *arg) __NOCFI
{
struct pctrie_node *node;
diff --git a/sys/kern/subr_scanf.c b/sys/kern/subr_scanf.c
--- a/sys/kern/subr_scanf.c
+++ b/sys/kern/subr_scanf.c
@@ -36,6 +36,7 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/cfi.h>
#include <sys/ctype.h>
#include <sys/limits.h>
#include <sys/stddef.h>
@@ -100,7 +101,7 @@
}
int
-vsscanf(const char *inp, char const *fmt0, va_list ap)
+vsscanf(const char *inp, char const *fmt0, va_list ap) __NOCFI
{
int inr;
const u_char *fmt = (const u_char *)fmt0;
diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c
--- a/sys/kern/subr_syscall.c
+++ b/sys/kern/subr_syscall.c
@@ -40,7 +40,9 @@
#include "opt_capsicum.h"
#include "opt_ktrace.h"
+
#include <sys/capsicum.h>
+#include <sys/cfi.h>
#include <sys/ktr.h>
#include <sys/vmmeter.h>
#ifdef KTRACE
@@ -50,7 +52,7 @@
#include <security/audit/audit.h>
static inline void
-syscallenter(struct thread *td)
+syscallenter(struct thread *td) __NOCFI
{
struct proc *p;
struct syscall_args *sa;
diff --git a/sys/net/radix.c b/sys/net/radix.c
--- a/sys/net/radix.c
+++ b/sys/net/radix.c
@@ -34,6 +34,7 @@
*/
#include <sys/param.h>
#ifdef _KERNEL
+#include <sys/cfi.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/rmlock.h>
@@ -1055,7 +1056,7 @@
}
int
-rn_walktree(struct radix_head *h, walktree_f_t *f, void *w)
+rn_walktree(struct radix_head *h, walktree_f_t *f, void *w) __NOCFI
{
int error;
struct radix_node *base, *next;
diff --git a/sys/net/vnet.c b/sys/net/vnet.c
--- a/sys/net/vnet.c
+++ b/sys/net/vnet.c
@@ -45,7 +45,7 @@
#include <sys/jail.h>
#include <sys/sdt.h>
#include <sys/systm.h>
-#include <sys/sysctl.h>
+#include <sys/cfi.h>
#include <sys/eventhandler.h>
#include <sys/lock.h>
#include <sys/malloc.h>
@@ -511,7 +511,7 @@
* and VNET_SYSUNINIT().
*/
void
-vnet_register_sysinit(void *arg)
+vnet_register_sysinit(void *arg) __NOCFI
{
struct vnet_sysinit *vs, *vs2;
struct vnet *vnet;
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -1154,7 +1154,7 @@
struct session *sess);
int enterthispgrp(struct proc *p, struct pgrp *pgrp);
int fork1(struct thread *, struct fork_req *);
-void fork_exit(void (*)(void *, struct trapframe *), void *,
+void fork_exit(void (*)(struct thread *, struct trapframe *), void *,
struct trapframe *);
void fork_return(struct thread *, struct trapframe *);
int inferior(struct proc *p);
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -144,7 +144,6 @@
int setjmp(struct _jmp_buf *) __returns_twice;
void longjmp(struct _jmp_buf *, int) __dead2;
int dumpstatus(vm_offset_t addr, off_t count);
-int nullop(void);
int eopnotsupp(void);
int ureadc(int, struct uio *);
void hashdestroy(void *, struct malloc_type *, u_long);
diff --git a/sys/tools/vnode_if.awk b/sys/tools/vnode_if.awk
--- a/sys/tools/vnode_if.awk
+++ b/sys/tools/vnode_if.awk
@@ -199,6 +199,7 @@
"#include <sys/signalvar.h>\n" \
"#include <sys/systm.h>\n" \
"#include <sys/vnode.h>\n" \
+ "#include <sys/cfi.h>\n" \
"\n" \
"SDT_PROVIDER_DECLARE(vfs);\n" \
"\n" \
@@ -389,7 +390,7 @@
printc("");
printc("\treturn(" uname "_APV(a->a_" args[0] "->v_op, a));");
printc("}");
- printc("\nint\n" uname "_APV(const struct vop_vector *vop, struct " name "_args *a)");
+ printc("\nint\n" uname "_APV(const struct vop_vector *vop, struct " name "_args *a) __NOCFI");
printc("{");
printc("\tint rc;");
printc("");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 3, 11:54 PM (10 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16954504
Default Alt Text
D49170.diff (7 KB)
Attached To
Mode
D49170: kcfi: add _NOCFI in kernel
Attached
Detach File
Event Timeline
Log In to Comment