Commit f4b77d3
committed
runtime-fix #3: provide no-op rtbridge stubs + panic on stray vm_page_alloc
After fixes #1 and #2, helloworld reaches ifioctl() / IP configuration
and crashes again with SIGSEGV in rt_ifmsg():
rt_ifmsg -> ifioctl -> ff_freebsd_init -> ff_init -> main
FreeBSD 14.0+ refactored rt_ifmsg() / rt_routemsg() to dispatch via a
new "rtbridge" function pointer table:
rtsock_callback_p->ifmsg_f(ifp, if_flags_mask);
netlink_callback_p->ifmsg_f(ifp, if_flags_mask);
The earlier M5 stub set both pointers to NULL, which is exactly what
rt_ifmsg() then dereferences. F-Stack does not implement an in-process
routing-socket or netlink subsystem, but it must not crash either.
Provide a static `ff_stub_rtbridge_noop` whose route_f / ifmsg_f are
empty shims, and point both rtsock_callback_p and netlink_callback_p
at it. rt_ifmsg() / rt_routemsg() now dispatch into harmless no-ops.
Forward-declare the minimal types (struct rtbridge / route_event_f /
ifmsg_event_f) locally instead of pulling in <net/route/route_ctl.h> —
including that header creates conflicting prototypes with several other
rib_* stubs already defined later in this file.
Additionally, harden the original vm_page_alloc_noobj_domain stub (and
add a vm_page_alloc_noobj sibling) to panic() instead of silently
returning NULL. With the UMA_USE_DMAP fix in place, these stubs should
never be reached in the normal F-Stack flow; if a future regression
accidentally takes the vm-page path again, the process aborts loudly
with a clear pointer at vmparam.h instead of spinning the CPU forever.
Verified end-to-end: helloworld runs to "helloworld init success",
`tools/sbin/ifconfig` lists the f-stack-0 interface (UP/RUNNING), and
`tools/sbin/netstat -an` shows tcp4/tcp6 *.80 LISTEN.1 parent ee424b8 commit f4b77d3
1 file changed
Lines changed: 79 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
37 | 53 | | |
38 | 54 | | |
39 | 55 | | |
| |||
270 | 286 | | |
271 | 287 | | |
272 | 288 | | |
273 | | - | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
274 | 320 | | |
275 | 321 | | |
276 | 322 | | |
| |||
550 | 596 | | |
551 | 597 | | |
552 | 598 | | |
553 | | - | |
| 599 | + | |
| 600 | + | |
554 | 601 | | |
555 | 602 | | |
556 | 603 | | |
| |||
708 | 755 | | |
709 | 756 | | |
710 | 757 | | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
711 | 773 | | |
712 | 774 | | |
713 | 775 | | |
714 | | - | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
715 | 791 | | |
716 | 792 | | |
717 | 793 | | |
| |||
0 commit comments