Commit graph

15 commits

Author SHA1 Message Date
98356a2663 Board drivers: audit fixes V6, V8, V9, V11; relabel ported drivers GPL-2.0
Security fixes from the audit:
- V8 caam: the HMAC raw key (up to 128 bytes) was copied into a buffer
  of the split key's size (32 bytes for MD5, 48 for SHA-1), reachable
  through /dev/crypto. The buffer now fits both. caam_dma_free() zeroes
  every buffer itself, which also fixes the QI path clearing twice the
  split key buffer's size at each session teardown.
- V6 mwifiex: the uap_passphrase sysctl, readable by every local user,
  is write-only; mwifiex_uap says to keep the passphrase in a 0600
  /etc/rc.conf.d/mwifiex_uap.
- V9 dpaa_wifi: hardware frame lengths were copied into a 4 KB cluster
  unchecked, and scatter/gather frames read as one buffer. One helper
  now takes only contiguous frames within the buffer, at any length.
- V11: cdx frees IPsec keys and shared descriptors with zfree(); fmc's
  state file moves from /tmp (symlink attack by any local user) to
  /var/run.
- The firmware object pcieuart9098_combo_v1.bin.fwo is a build output
  and no longer tracked.

caam, ina2xx and lp5812 were ported from Linux and relabelled BSD-2 by
the vendor (8f9b3bf, 84e318c, ac81eea). They are GPL-2.0-only again,
with the Linux sources' copyright holders; LICENSING.md lists them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 21:30:15 -05:00
5e215f5997 20-kernel-update: leave kernel.bin where the kernel set put it
The hook deleted /boot/kernel/kernel.bin once it was on the FAT
partition, so the health audit always reported it missing (seen on the
gateway after the 26.7.9 upgrade). It now leaves the kernel set's files
alone and returns early, without a space check or a log line, when the
kernel and device tree on the FAT partition are already the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 18:54:16 -05:00
aa8c49368d rc.d/cmm: stop waits for cmm to exit, and checks it is cmm
The custom stop killed whatever pid the pid file held, ignored whether
that worked, removed the file and printed "Stopped cmm." On the gateway
cmm was still running right after it. rc.subr's own start, stop and
status (command=) send SIGTERM and wait for the exit, and only act on a
pid file that names a running cmm.

Tested through FreeBSD's rc.subr with a stand-in cmm that takes 2
seconds to exit, and with a stale pid file naming another process.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 18:48:49 -05:00
67ee1582c9 Turn hardware flow offload off; drop the Mono copyright line
The security audit of the vendor's fastpath found that offloaded flows
ignore pf route-to/reply-to and gateway rules (VPN-as-gateway traffic can
leave on WAN), that pf_notify marks every pf state sloppy while cmm runs,
that bridged traffic is offloaded without pf, that hardware flows can
outlive their pf state, and that the IPsec exception path panics. New
images no longer enable cmm, and RELEASE.md gives the commands for a
gateway that was installed from the vendor's image. The board modules
still load; nothing is offloaded without cmm.

rc.d/20-kernel-update is our rewrite: its Mono copyright line goes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:12:19 -05:00
ccebd54083 board package: build per series, harden kernel install for U-Boot
- Makefile: read the FreeBSD release from tools' config/<series>/build.conf
  and derive the compiler target and package ABI from it, version the
  package <release>_<commit count>, take libxml2 from our own packages
  set instead of pkg.FreeBSD.org, clone the NXP sources from the Forgejo
  mirrors, and drop the image target (release/build.sh replaces it)
- +MANIFEST: ABI from the series, new maintainer and www
- GATEWAY.conf: annotate mono-gateway as coming from the OPNsense
  repository; fail the image build if the package is missing
- mk-image.sh: remove the amd64 qemu binary setup_xtools leaves behind
- 20-kernel-update: drop the 26.1.3 guard; check room on the FAT
  partition, copy and verify the new kernel before replacing the old
  one, keep kernel.old, restore it on failure, retry at next shutdown
- 01-mono-modules: log modules that fail to load instead of hiding it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 18:56:54 -05:00
Maurice Walker
f52da03e64 pkg: add dtb updater to kernel updater 2026-04-09 05:56:46 +02:00
Maurice Walker
fc51b3794b pkg: add kernel updater
mono-gateway package installs an rc.syshook script which moves the U-Boot booti compatible kernel image from /boot/kernel to the FAT partition on reboot / shutdown.
2026-04-09 03:59:52 +02:00
Maurice Walker
f6152d5c6e remove custom growfs script
Not applicable or required for ZFS. OPNsense core has its own growfs feature.
https://github.com/opnsense/core/blob/stable/26.1/src/etc/rc
2026-03-26 23:42:11 +01:00
Tomaz Zaman
4408aa0ab8 PPPoE termination offload: session detection, flow offload, soft parser fix
CMM: detect PPPoE sessions via netgraph (NGM_PPPOE_GET_SESSION_INFO),
register with CDX (FPP_CMD_PPPOE_ENTRY), resolve point-to-point neighbor
MAC from session info instead of ARP.  Prevent duplicate CMM instances
via pidfile(3) locking.

CDX: fix egress PPPoE flags in dpa_get_tx_info_by_itf() — set
add_pppoe_hdr/ac_mac_addr instead of pppoe_present.  Add
pppoe_stats_offset for IPsec path.  Remove CDX_TODO_PPPOE ifdefs
in control_pppoe.c (timer always marks active, PF handles timeouts).

Soft parser (cdx_sp.xml): PPPoE data frames now return to HXS instead
of short-circuiting to relay CC table.  HXS chains PPPoE→IPv4→TCP/UDP
naturally, enabling PCD KeyGen to build 5-tuple hash keys for IPv4 CC
table matching.  LCP control packets still go directly to host.

Verified: 1.6 Gbps through PPPoE with hardware offload (all cores idle,
zero FMan drops).  Bottleneck is test infrastructure PPPoE server, not GDK.
2026-03-13 15:55:21 +01:00
Tomaz Zaman
ef5b163670 WiFi UAP: WPA3-SAE PMF fix, rc.d service, CMM loopback fix
- Fix WPA3-SAE authentication failure by injecting custom RSN IE with
  PMF capability bits (MFPC/MFPR) via MLAN_OID_MISC_CUSTOM_IE. Without
  PMF advertised in beacons, WPA3 clients reject the connection.
- Use PROTOCOL_WPA2 + KEY_MGMT_SAE instead of PROTOCOL_WPA3_SAE so
  mlan TLV builder emits AKMP/cipher/passphrase TLVs correctly.
- Add SAE password field population for WPA3 and WPA2+WPA3 modes.
- Add UAP sysctls: country code, beacon interval, DTIM period.
- Add mwifiex_uap rc.d service script for rc.conf-based AP config.
- Load dpaa_wifi module before mwifiex in early syshook script.
- Fix CMM route offload logging thousands of errors for loopback input
  device — skip lo0 in cmm_fe_route_register() since CDX can't use it.
- Remove uninformative debug printk from CDX control_wifi.c.
2026-03-06 21:59:21 +01:00
Tomaz Zaman
f535564d2d Add TI TMP431 dual-channel temperature sensor driver 2026-03-03 01:42:55 +01:00
Tomaz Zaman
f88576c880 Move pcf2131 and caam to out-of-tree kernel modules 2026-03-02 13:57:35 +01:00
Tomaz Zaman
6dae3f78f7 Add mono-gateway FreeBSD package build target 2026-02-27 13:19:20 +01:00
Tomaz Zaman
96db298a82 growfs early script bugfix 2026-02-25 19:57:54 +01:00
Tomaz Zaman
5514d65ac5 Hello world. 2026-02-25 15:13:46 +01:00