Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F131865935
D38505.id116984.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D38505.id116984.diff
View Options
diff --git a/sys/net/route/route_tables.c b/sys/net/route/route_tables.c
--- a/sys/net/route/route_tables.c
+++ b/sys/net/route/route_tables.c
@@ -42,6 +42,7 @@
#include <sys/systm.h>
#include <sys/malloc.h>
#include <sys/jail.h>
+#include <sys/osd.h>
#include <sys/proc.h>
#include <sys/sysctl.h>
#include <sys/syslog.h>
@@ -162,6 +163,38 @@
return (error);
}
+static int
+rtables_check_proc_fib(void *obj, void *data)
+{
+ struct prison *pr = obj;
+ struct thread *td = data;
+ bool error = 0;
+
+ if (TD_TO_VNET(td) != pr->pr_vnet) {
+ /* number of fibs may be lower in a new vnet */
+ CURVNET_SET(pr->pr_vnet);
+ error = (td->td_proc->p_fibnum < V_rt_numfibs) ? 0 : EINVAL;
+ CURVNET_RESTORE();
+ }
+ return (error);
+}
+
+static void
+rtables_prison_destructor(void *data)
+{
+}
+
+static void
+rtables_init(void)
+{
+ osd_method_t methods[PR_MAXMETHOD] = {
+ [PR_METHOD_ATTACH] = rtables_check_proc_fib,
+ };
+ osd_jail_register(rtables_prison_destructor, methods);
+}
+SYSINIT(rtables_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, rtables_init, NULL);
+
+
/*
* If required, copy interface routes from existing tables to the
* newly-created routing table.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 12, 7:44 PM (1 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23620153
Default Alt Text
D38505.id116984.diff (1 KB)
Attached To
Mode
D38505: fibs: restrict jail_attach(2) if process fibnum >= numfibs in the jail.
Attached
Detach File
Event Timeline
Log In to Comment