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>
This commit is contained in:
parent
5e215f5997
commit
98356a2663
26 changed files with 151 additions and 84 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -28,3 +28,4 @@ __pycache__/
|
|||
# to clone a repository with symlinks)
|
||||
drivers/mwifiex/mlan_*.c
|
||||
drivers/mwifiex/pcieuart9098_combo_v1.bin
|
||||
drivers/mwifiex/pcieuart9098_combo_v1.bin.fwo
|
||||
|
|
|
|||
17
LICENSING.md
17
LICENSING.md
|
|
@ -2,20 +2,27 @@
|
|||
|
||||
This repository contains components under multiple open-source licenses. Each source file carries an SPDX-License-Identifier header which is the authoritative license for that file. Full license texts are in the `LICENSES/` directory.
|
||||
|
||||
## BSD-2-Clause — Clean Reimplementations
|
||||
## BSD-2-Clause — FreeBSD Drivers
|
||||
|
||||
These drivers were written from scratch for FreeBSD, inspired by hardware datasheets, vendor reference manuals, and existing Linux drivers. They share no code, function names, or struct names with their Linux counterparts.
|
||||
These drivers were written for FreeBSD from hardware datasheets and vendor reference manuals.
|
||||
|
||||
| Component | Path | Notes |
|
||||
|---|---|---|
|
||||
| CAAM crypto | `drivers/caam/` | NXP SEC v5.x crypto accelerator (JR + QI) |
|
||||
| INA2xx power monitor | `drivers/ina2xx/` | TI INA219/INA226/INA234 |
|
||||
| EMC2302 fan controller | `drivers/emc2302/` | Microchip EMC2301-2305 |
|
||||
| TMP431 temp sensor | `drivers/tmp431/` | TI TMP431 dual-channel |
|
||||
| PCF2131 RTC | `drivers/pcf2131/` | NXP PCF2131 real-time clock |
|
||||
| LP5812 LED controller | `drivers/lp5812/` | TI LP5812 12-channel LED |
|
||||
| pf_notify | `fastpath/pf_notify/` | PF state change notifications (no Linux counterpart) |
|
||||
|
||||
## GPL-2.0-only — Ported from Linux Drivers
|
||||
|
||||
These drivers were ported from their Linux counterparts. The vendor had relabelled them BSD-2-Clause after renaming constants and removing the "ported from Linux" notes (commits `8f9b3bf`, `84e318c`, `ac81eea`); they carry their Linux sources' license and copyright holders again. The CAAM sources are GPL-2.0+ except `desc.h`, `regs.h`, `key_gen.c` and `qi.c` (GPL-2.0), which every CAAM file uses, so the driver is GPL-2.0-only.
|
||||
|
||||
| Component | Path | Linux source |
|
||||
|---|---|---|
|
||||
| CAAM crypto | `drivers/caam/` | `drivers/crypto/caam` (Freescale Semiconductor, NXP) |
|
||||
| INA2xx power monitor | `drivers/ina2xx/` | `drivers/hwmon/ina2xx.c` (Lothar Felten and contributors) |
|
||||
| LP5812 LED controller | `drivers/lp5812/` | TI's LP5812 driver; `lp5812.h` is TI's header (Texas Instruments) |
|
||||
|
||||
## GPL-2.0+ — NXP Fastpath Stack
|
||||
|
||||
The DPAA1 flow offload stack derives from NXP's ASK (Application Solution Kit) SDK, which is GPL-2.0+ licensed. Some components compile unmodified NXP vendor source from `fastpath/vendor/`; others are FreeBSD rewrites that include GPL headers (`fpp.h`, `list.h`) or are derived from GPL originals. The entire stack is licensed as GPL-2.0+ with original copyright holders (Mindspeed Technologies, Freescale Semiconductor, NXP) retained.
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
* SPDX-License-Identifier: GPL-2.0-only
|
||||
*
|
||||
* Copyright (c) 2026 Mono Technologies Inc.
|
||||
*
|
||||
* Ported from the Linux CAAM driver (drivers/crypto/caam: GPL-2.0 and
|
||||
* GPL-2.0+), Copyright Freescale Semiconductor, Inc. and NXP.
|
||||
*
|
||||
* NXP CAAM (Cryptographic Acceleration and Assurance Module) controller driver.
|
||||
*
|
||||
* The CAAM controller (SEC v4.0+) acts as a simplebus parent that enumerates
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
* SPDX-License-Identifier: GPL-2.0-only
|
||||
*
|
||||
* Copyright (c) 2026 Mono Technologies Inc.
|
||||
*
|
||||
* Ported from the Linux CAAM driver (drivers/crypto/caam: GPL-2.0 and
|
||||
* GPL-2.0+), Copyright Freescale Semiconductor, Inc. and NXP.
|
||||
*
|
||||
* NXP CAAM (SEC v4.0+) crypto controller — shared types and accessors.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
* SPDX-License-Identifier: GPL-2.0-only
|
||||
*
|
||||
* Copyright (c) 2026 Mono Technologies Inc.
|
||||
*
|
||||
* Ported from the Linux CAAM driver (drivers/crypto/caam: GPL-2.0 and
|
||||
* GPL-2.0+), Copyright Freescale Semiconductor, Inc. and NXP.
|
||||
*
|
||||
* CAAM algorithm descriptor builders for all supported modes.
|
||||
*
|
||||
* Shared descriptors are built once per session and stored in DMA memory.
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
* SPDX-License-Identifier: GPL-2.0-only
|
||||
*
|
||||
* Copyright (c) 2026 Mono Technologies Inc.
|
||||
*
|
||||
* Ported from the Linux CAAM driver (drivers/crypto/caam: GPL-2.0 and
|
||||
* GPL-2.0+), Copyright Freescale Semiconductor, Inc. and NXP.
|
||||
*
|
||||
* CAAM opencrypto integration — connects CAAM Job Ring hardware to
|
||||
* FreeBSD's opencrypto framework for IPsec and kernel crypto.
|
||||
*
|
||||
|
|
@ -434,7 +437,10 @@ caam_auth_digest_len(int auth_alg)
|
|||
/*
|
||||
* Allocate DMA buffer for pre-computed split key.
|
||||
* Buffer will be filled by caam_gen_split_key() after allocation.
|
||||
* Must be called after sess->split_key_pad_len is set.
|
||||
* Must be called after sess->split_key_pad_len and auth_klen are set:
|
||||
* caam_gen_split_key() first copies the raw key (up to
|
||||
* CAAM_MAX_SPLIT_KEY_LEN bytes) into it, which can be longer than the
|
||||
* split key (32 bytes for MD5, 48 for SHA-1).
|
||||
*/
|
||||
int
|
||||
caam_session_alloc_auth_key_dma(device_t dev, struct caam_session *sess)
|
||||
|
|
@ -442,7 +448,7 @@ caam_session_alloc_auth_key_dma(device_t dev, struct caam_session *sess)
|
|||
int error;
|
||||
|
||||
error = caam_dma_alloc(dev, &sess->auth_key_dma,
|
||||
sess->split_key_pad_len);
|
||||
MAX(sess->split_key_pad_len, sess->auth_klen));
|
||||
if (error != 0)
|
||||
return (error);
|
||||
|
||||
|
|
@ -757,14 +763,9 @@ caam_freesession(device_t dev, crypto_session_t cses)
|
|||
/* Zero key material before freeing DMA descriptors */
|
||||
explicit_bzero(sess->enc_key, sizeof(sess->enc_key));
|
||||
explicit_bzero(sess->auth_key, sizeof(sess->auth_key));
|
||||
if (sess->auth_key_dma.vaddr != NULL)
|
||||
explicit_bzero(sess->auth_key_dma.vaddr,
|
||||
sess->split_key_pad_len);
|
||||
if (sess->enc_shdesc.vaddr != NULL)
|
||||
explicit_bzero(sess->enc_shdesc.vaddr, CAAM_DESC_MAX_BYTES);
|
||||
if (sess->dec_shdesc.vaddr != NULL)
|
||||
explicit_bzero(sess->dec_shdesc.vaddr, CAAM_DESC_MAX_BYTES);
|
||||
|
||||
/* caam_dma_free() zeroes each buffer: the split key, and the shared
|
||||
descriptors that carry the cipher key inline */
|
||||
caam_dma_free(&sess->auth_key_dma);
|
||||
caam_dma_free(&sess->enc_shdesc);
|
||||
caam_dma_free(&sess->dec_shdesc);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
* SPDX-License-Identifier: GPL-2.0-only
|
||||
*
|
||||
* Copyright (c) 2026 Mono Technologies Inc.
|
||||
*
|
||||
* Ported from the Linux CAAM driver (drivers/crypto/caam: GPL-2.0 and
|
||||
* GPL-2.0+), Copyright Freescale Semiconductor, Inc. and NXP.
|
||||
*
|
||||
* CAAM opencrypto integration — per-session and per-request structures.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
* SPDX-License-Identifier: GPL-2.0-only
|
||||
*
|
||||
* Copyright (c) 2026 Mono Technologies Inc.
|
||||
*
|
||||
* Ported from the Linux CAAM driver (drivers/crypto/caam: GPL-2.0 and
|
||||
* GPL-2.0+), Copyright Freescale Semiconductor, Inc. and NXP.
|
||||
*
|
||||
* CAAM descriptor command word definitions and construction helpers.
|
||||
* Field encodings from the NXP SEC v5.x descriptor format specification
|
||||
* (document SECMCRM, LS1046A variant).
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
* SPDX-License-Identifier: GPL-2.0-only
|
||||
*
|
||||
* Copyright (c) 2026 Mono Technologies Inc.
|
||||
*
|
||||
* Ported from the Linux CAAM driver (drivers/crypto/caam: GPL-2.0 and
|
||||
* GPL-2.0+), Copyright Freescale Semiconductor, Inc. and NXP.
|
||||
*
|
||||
* CAAM hash/HMAC descriptor builders for CSP_MODE_DIGEST.
|
||||
*
|
||||
* Standalone hash (SHA, MD5) and HMAC use Class 2 (MDHA) only.
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
* SPDX-License-Identifier: GPL-2.0-only
|
||||
*
|
||||
* Copyright (c) 2026 Mono Technologies Inc.
|
||||
*
|
||||
* Ported from the Linux CAAM driver (drivers/crypto/caam: GPL-2.0 and
|
||||
* GPL-2.0+), Copyright Freescale Semiconductor, Inc. and NXP.
|
||||
*
|
||||
* NXP CAAM Job Ring driver.
|
||||
*
|
||||
* Each Job Ring is a child device of the CAAM controller. It manages
|
||||
|
|
@ -118,6 +121,7 @@ caam_dma_alloc(device_t dev, struct caam_dma_mem *mem, bus_size_t size)
|
|||
mem->vaddr = NULL;
|
||||
return (error);
|
||||
}
|
||||
mem->size = size;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
|
@ -128,12 +132,15 @@ caam_dma_free(struct caam_dma_mem *mem)
|
|||
|
||||
if (mem->tag == NULL)
|
||||
return;
|
||||
/* key material, split keys and descriptors that embed keys */
|
||||
explicit_bzero(mem->vaddr, mem->size);
|
||||
bus_dmamap_unload(mem->tag, mem->map);
|
||||
bus_dmamem_free(mem->tag, mem->vaddr, mem->map);
|
||||
bus_dma_tag_destroy(mem->tag);
|
||||
mem->tag = NULL;
|
||||
mem->vaddr = NULL;
|
||||
mem->paddr = 0;
|
||||
mem->size = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
* SPDX-License-Identifier: GPL-2.0-only
|
||||
*
|
||||
* Copyright (c) 2026 Mono Technologies Inc.
|
||||
*
|
||||
* Ported from the Linux CAAM driver (drivers/crypto/caam: GPL-2.0 and
|
||||
* GPL-2.0+), Copyright Freescale Semiconductor, Inc. and NXP.
|
||||
*
|
||||
* NXP CAAM Job Ring driver — softc and ring structures.
|
||||
*/
|
||||
|
||||
|
|
@ -53,6 +56,7 @@ struct caam_dma_mem {
|
|||
bus_dmamap_t map;
|
||||
void *vaddr;
|
||||
bus_addr_t paddr;
|
||||
bus_size_t size; /* caam_dma_free() zeroes all of it */
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
* SPDX-License-Identifier: GPL-2.0-only
|
||||
*
|
||||
* Copyright (c) 2026 Mono Technologies Inc.
|
||||
*
|
||||
* Ported from the Linux CAAM driver (drivers/crypto/caam: GPL-2.0 and
|
||||
* GPL-2.0+), Copyright Freescale Semiconductor, Inc. and NXP.
|
||||
*
|
||||
* CAAM QI (Queue Interface) crypto backend.
|
||||
*
|
||||
* Submits crypto operations through QMan frame queues instead of Job Rings.
|
||||
|
|
@ -513,10 +516,7 @@ caam_qi_drv_ctx_destroy(struct caam_qi_drv_ctx *ctx)
|
|||
qman_fqr_free(ctx->req_fqr[cpu]);
|
||||
}
|
||||
|
||||
/* Zero inline key material in shared descriptor before freeing */
|
||||
if (ctx->prehdr_shdesc.vaddr != NULL)
|
||||
explicit_bzero(ctx->prehdr_shdesc.vaddr, CAAM_QI_PREHDR_SZ);
|
||||
caam_dma_free(&ctx->prehdr_shdesc);
|
||||
caam_dma_free(&ctx->prehdr_shdesc); /* zeroes the inline key */
|
||||
free(ctx, M_CAAM_QI);
|
||||
}
|
||||
|
||||
|
|
@ -702,10 +702,8 @@ caam_qi_freesession(device_t dev, crypto_session_t cses)
|
|||
/* Zero key material before freeing contexts */
|
||||
explicit_bzero(sess->enc_key, sizeof(sess->enc_key));
|
||||
explicit_bzero(sess->auth_key, sizeof(sess->auth_key));
|
||||
if (sess->auth_key_dma.vaddr != NULL)
|
||||
explicit_bzero(sess->auth_key_dma.vaddr,
|
||||
sess->split_key_pad_len * 2);
|
||||
|
||||
/* zeroed by caam_dma_free(); this used to clear twice its size */
|
||||
caam_dma_free(&sess->auth_key_dma);
|
||||
caam_qi_drv_ctx_destroy(sess->qi_enc_ctx);
|
||||
caam_qi_drv_ctx_destroy(sess->qi_dec_ctx);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
* SPDX-License-Identifier: GPL-2.0-only
|
||||
*
|
||||
* Copyright (c) 2026 Mono Technologies Inc.
|
||||
*
|
||||
* Ported from the Linux CAAM driver (drivers/crypto/caam: GPL-2.0 and
|
||||
* GPL-2.0+), Copyright Freescale Semiconductor, Inc. and NXP.
|
||||
*
|
||||
* CAAM QI (Queue Interface) backend — data structures.
|
||||
*
|
||||
* QI submits crypto operations through QMan frame queues instead of Job
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
* SPDX-License-Identifier: GPL-2.0-only
|
||||
*
|
||||
* Copyright (c) 2026 Mono Technologies Inc.
|
||||
*
|
||||
* Ported from the Linux CAAM driver (drivers/crypto/caam: GPL-2.0 and
|
||||
* GPL-2.0+), Copyright Freescale Semiconductor, Inc. and NXP.
|
||||
*
|
||||
* CAAM QI shared descriptor builders.
|
||||
*
|
||||
* QI shared descriptors differ from JR versions in two ways:
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
* SPDX-License-Identifier: GPL-2.0-only
|
||||
*
|
||||
* Copyright (c) 2026 Mono Technologies Inc.
|
||||
*
|
||||
* Ported from the Linux CAAM driver (drivers/crypto/caam: GPL-2.0 and
|
||||
* GPL-2.0+), Copyright Freescale Semiconductor, Inc. and NXP.
|
||||
*
|
||||
* Hardware register definitions for NXP CAAM (SEC v4.0+) crypto engine.
|
||||
* Derived from the NXP Layerscape LS1046A Security Engine Reference Manual.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
* SPDX-License-Identifier: GPL-2.0-only
|
||||
*
|
||||
* Copyright (c) 2026 Mono Technologies Inc.
|
||||
*
|
||||
* Ported from the Linux CAAM driver (drivers/crypto/caam: GPL-2.0 and
|
||||
* GPL-2.0+), Copyright Freescale Semiconductor, Inc. and NXP.
|
||||
*
|
||||
* CAAM hardware entropy source for FreeBSD's kernel random subsystem.
|
||||
*
|
||||
* Submits RNG descriptors to a Job Ring to generate random data from the
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
* SPDX-License-Identifier: GPL-2.0-only
|
||||
*
|
||||
* Copyright (c) 2026 Mono Technologies Inc.
|
||||
*
|
||||
* Ported from the Linux CAAM driver (drivers/crypto/caam: GPL-2.0 and
|
||||
* GPL-2.0+), Copyright Freescale Semiconductor, Inc. and NXP.
|
||||
*
|
||||
* CAAM hardware entropy source — interface.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -272,6 +272,29 @@ dpaa_wifi_find_vap_for_rx(const void *frame_data)
|
|||
* The VAP is known from the callback context (no MAC lookup).
|
||||
* Same logic as the CDX→WiFi path in dpaa_wifi_rx_cb().
|
||||
*/
|
||||
/*
|
||||
* Copy a contiguous frame out of an FMan buffer into a new mbuf chain.
|
||||
* Offset and length come from the hardware frame descriptor: only a
|
||||
* single-buffer frame lying within the buffer (FM_PORT_BUFFER_SIZE, as
|
||||
* WIFI_BUF_SIZE) is copied, at any length up to that. NULL when the frame
|
||||
* is malformed or no mbuf is free; the caller drops it.
|
||||
*/
|
||||
static struct mbuf *
|
||||
dpaa_wifi_copy_frame(void *buf, t_DpaaFD *frame, struct ifnet *ifp)
|
||||
{
|
||||
uint32_t off, len;
|
||||
|
||||
if (__predict_false(DPAA_FD_GET_FORMAT(frame) !=
|
||||
e_DPAA_FD_FORMAT_TYPE_SHORT_SBSF))
|
||||
return (NULL);
|
||||
off = DPAA_FD_GET_OFFSET(frame);
|
||||
len = DPAA_FD_GET_LENGTH(frame);
|
||||
if (__predict_false(len == 0 || off >= WIFI_BUF_SIZE ||
|
||||
len > WIFI_BUF_SIZE - off))
|
||||
return (NULL);
|
||||
return (m_devget((char *)buf + off, len, 0, ifp, NULL));
|
||||
}
|
||||
|
||||
static e_RxStoreResponse
|
||||
dpaa_wifi_fwd_rx_cb(t_Handle app, t_Handle fqr, t_Handle portal,
|
||||
uint32_t fqid_off, t_DpaaFD *frame)
|
||||
|
|
@ -280,7 +303,7 @@ dpaa_wifi_fwd_rx_cb(t_Handle app, t_Handle fqr, t_Handle portal,
|
|||
struct dpaa_wifi_vap *vap = ctx->vap;
|
||||
void *buf;
|
||||
struct mbuf *m;
|
||||
uint32_t fd_status, frame_len;
|
||||
uint32_t fd_status;
|
||||
uint8_t bpid;
|
||||
|
||||
buf = DPAA_FD_GET_ADDR(frame);
|
||||
|
|
@ -305,9 +328,7 @@ dpaa_wifi_fwd_rx_cb(t_Handle app, t_Handle fqr, t_Handle portal,
|
|||
return (e_RX_STORE_RESPONSE_CONTINUE);
|
||||
}
|
||||
|
||||
frame_len = DPAA_FD_GET_LENGTH(frame);
|
||||
m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR,
|
||||
frame_len > MCLBYTES ? MJUMPAGESIZE : MCLBYTES);
|
||||
m = dpaa_wifi_copy_frame(buf, frame, vap->ifp);
|
||||
if (__predict_false(m == NULL)) {
|
||||
atomic_add_64(&wifi_rx_drop, 1);
|
||||
dtsec_rm_buf_free_external(bpid, buf);
|
||||
|
|
@ -316,12 +337,6 @@ dpaa_wifi_fwd_rx_cb(t_Handle app, t_Handle fqr, t_Handle portal,
|
|||
return (e_RX_STORE_RESPONSE_CONTINUE);
|
||||
}
|
||||
|
||||
memcpy(mtod(m, void *),
|
||||
(char *)buf + DPAA_FD_GET_OFFSET(frame), frame_len);
|
||||
m->m_len = frame_len;
|
||||
m->m_pkthdr.len = frame_len;
|
||||
m->m_pkthdr.rcvif = vap->ifp;
|
||||
|
||||
/* Release dtsec buffer and refill BMan pool */
|
||||
dtsec_rm_buf_free_external(bpid, buf);
|
||||
dtsec_rm_pool_rx_refill_bpid(bpid);
|
||||
|
|
@ -722,7 +737,6 @@ dpaa_wifi_deliver_to_stack(void *buf, t_DpaaFD *frame)
|
|||
struct mbuf *m;
|
||||
struct dpaa_wifi_vap *vap;
|
||||
uint8_t vap_idx;
|
||||
uint32_t frame_len;
|
||||
|
||||
vap_idx = *(uint8_t *)((char *)buf + PRIVDATA_VAP_OFF);
|
||||
if (__predict_false(vap_idx >= DPAA_WIFI_MAX_VAPS ||
|
||||
|
|
@ -733,22 +747,13 @@ dpaa_wifi_deliver_to_stack(void *buf, t_DpaaFD *frame)
|
|||
}
|
||||
vap = &wifi_vaps[vap_idx];
|
||||
|
||||
frame_len = DPAA_FD_GET_LENGTH(frame);
|
||||
|
||||
m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR,
|
||||
frame_len > MCLBYTES ? MJUMPAGESIZE : MCLBYTES);
|
||||
m = dpaa_wifi_copy_frame(buf, frame, vap->ifp);
|
||||
if (__predict_false(m == NULL)) {
|
||||
atomic_add_64(&wifi_rx_drop, 1);
|
||||
wifi_buf_return(buf);
|
||||
return (e_RX_STORE_RESPONSE_CONTINUE);
|
||||
}
|
||||
|
||||
memcpy(mtod(m, void *),
|
||||
(char *)buf + DPAA_FD_GET_OFFSET(frame), frame_len);
|
||||
m->m_len = frame_len;
|
||||
m->m_pkthdr.len = frame_len;
|
||||
m->m_pkthdr.rcvif = vap->ifp;
|
||||
|
||||
/* Return BMan buffer to pool immediately */
|
||||
wifi_buf_return(buf);
|
||||
|
||||
|
|
@ -850,7 +855,7 @@ dpaa_wifi_rx_cb(t_Handle app, t_Handle fqr, t_Handle portal,
|
|||
struct mbuf *m;
|
||||
struct dpaa_wifi_vap *vap;
|
||||
uint8_t bpid;
|
||||
uint32_t fd_status, frame_len;
|
||||
uint32_t fd_status;
|
||||
|
||||
buf = DPAA_FD_GET_ADDR(frame);
|
||||
if (__predict_false(buf == NULL))
|
||||
|
|
@ -913,20 +918,12 @@ dpaa_wifi_rx_cb(t_Handle app, t_Handle fqr, t_Handle portal,
|
|||
goto drop;
|
||||
}
|
||||
|
||||
frame_len = DPAA_FD_GET_LENGTH(frame);
|
||||
m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR,
|
||||
frame_len > MCLBYTES ? MJUMPAGESIZE : MCLBYTES);
|
||||
m = dpaa_wifi_copy_frame(buf, frame, vap->ifp);
|
||||
if (__predict_false(m == NULL)) {
|
||||
atomic_add_64(&wifi_rx_drop, 1);
|
||||
goto drop;
|
||||
}
|
||||
|
||||
memcpy(mtod(m, void *),
|
||||
(char *)buf + DPAA_FD_GET_OFFSET(frame), frame_len);
|
||||
m->m_len = frame_len;
|
||||
m->m_pkthdr.len = frame_len;
|
||||
m->m_pkthdr.rcvif = vap->ifp;
|
||||
|
||||
/* Release dtsec buffer and refill BMan pool */
|
||||
dtsec_rm_buf_free_external(bpid, buf);
|
||||
dtsec_rm_pool_rx_refill_bpid(bpid);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
* SPDX-License-Identifier: GPL-2.0-only
|
||||
*
|
||||
* Copyright (c) 2026 Mono Technologies Inc.
|
||||
*
|
||||
|
|
@ -7,7 +7,8 @@
|
|||
* Reads bus voltage, shunt voltage, current, and power from
|
||||
* INA2xx-family digital power monitors over I2C.
|
||||
*
|
||||
* Inspired by Linux hwmon/ina2xx.c by Lothar Felten.
|
||||
* Ported from Linux drivers/hwmon/ina2xx.c (GPL-2.0-only),
|
||||
* Copyright Lothar Felten and the Linux INA2xx driver's contributors.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
* SPDX-License-Identifier: GPL-2.0-only
|
||||
*
|
||||
* Copyright 2026 Mono Technologies Inc.
|
||||
* Author: Tomaz Zaman <tomaz@mono.si>
|
||||
*
|
||||
* Uses lp5812.h from TI's Linux LP5812 driver (GPL-2.0-only),
|
||||
* Copyright (C) 2025 Texas Instruments.
|
||||
*
|
||||
* TI LP5812 I2C LED Driver for FreeBSD
|
||||
*
|
||||
* Controls up to 12 LED channels via I2C in direct (non-multiplexed) mode.
|
||||
|
|
|
|||
|
|
@ -957,6 +957,10 @@ mwifiex_sysctl_uap_ssid(SYSCTL_HANDLER_ARGS)
|
|||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Write-only: sysctl reads are open to every local user, so a read
|
||||
* returns an empty string, never the passphrase.
|
||||
*/
|
||||
static int
|
||||
mwifiex_sysctl_uap_passphrase(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
|
|
@ -964,12 +968,15 @@ mwifiex_sysctl_uap_passphrase(SYSCTL_HANDLER_ARGS)
|
|||
char buf[65];
|
||||
int error;
|
||||
|
||||
strlcpy(buf, handle->uap_passphrase, sizeof(buf));
|
||||
buf[0] = '\0';
|
||||
error = sysctl_handle_string(oidp, buf, sizeof(buf), req);
|
||||
if (error || req->newptr == NULL)
|
||||
if (error || req->newptr == NULL) {
|
||||
explicit_bzero(buf, sizeof(buf));
|
||||
return (error);
|
||||
}
|
||||
strlcpy(handle->uap_passphrase, buf,
|
||||
sizeof(handle->uap_passphrase));
|
||||
explicit_bzero(buf, sizeof(buf));
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
|
@ -1546,7 +1553,7 @@ mwifiex_attach(device_t dev)
|
|||
CTLFLAG_MPSAFE,
|
||||
handle, 0,
|
||||
mwifiex_sysctl_uap_passphrase, "A",
|
||||
"UAP WPA2 passphrase");
|
||||
"UAP WPA2 passphrase (write-only)");
|
||||
SYSCTL_ADD_PROC(ctx,
|
||||
SYSCTL_CHILDREN(tree), OID_AUTO,
|
||||
"uap_channel",
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -180,19 +180,20 @@ cdx_ipsec_sec_sa_context_free(void *arg)
|
|||
if (pdpa_sec_context == NULL)
|
||||
return;
|
||||
|
||||
/* zfree: keys, split keys and descriptors that carry them inline */
|
||||
if (pdpa_sec_context->dpa_ipsecsa_handle)
|
||||
cdx_dpa_ipsecsa_release(pdpa_sec_context->dpa_ipsecsa_handle);
|
||||
if (pdpa_sec_context->cipher_data.cipher_key)
|
||||
free(pdpa_sec_context->cipher_data.cipher_key, M_CDX);
|
||||
zfree(pdpa_sec_context->cipher_data.cipher_key, M_CDX);
|
||||
if (pdpa_sec_context->auth_data.auth_key)
|
||||
free(pdpa_sec_context->auth_data.auth_key, M_CDX);
|
||||
zfree(pdpa_sec_context->auth_data.auth_key, M_CDX);
|
||||
if (pdpa_sec_context->auth_data.split_key)
|
||||
free(pdpa_sec_context->auth_data.split_key, M_CDX);
|
||||
zfree(pdpa_sec_context->auth_data.split_key, M_CDX);
|
||||
if (pdpa_sec_context->sec_desc_extra_cmds_unaligned)
|
||||
free(pdpa_sec_context->sec_desc_extra_cmds_unaligned, M_CDX);
|
||||
zfree(pdpa_sec_context->sec_desc_extra_cmds_unaligned, M_CDX);
|
||||
if (pdpa_sec_context->rjob_desc_unaligned)
|
||||
free(pdpa_sec_context->rjob_desc_unaligned, M_CDX);
|
||||
free(pdpa_sec_context, M_CDX);
|
||||
zfree(pdpa_sec_context->rjob_desc_unaligned, M_CDX);
|
||||
zfree(pdpa_sec_context, M_CDX);
|
||||
}
|
||||
|
||||
void *
|
||||
|
|
|
|||
|
|
@ -533,8 +533,8 @@ err_from:
|
|||
if (sainfo->fqr[FQ_TO_CP] != NULL)
|
||||
qman_fqr_free(sainfo->fqr[FQ_TO_CP]);
|
||||
err_cp:
|
||||
free(sainfo->shdesc_mem, M_CDX);
|
||||
free(sainfo, M_CDX);
|
||||
zfree(sainfo->shdesc_mem, M_CDX); /* the SA's keys, inline */
|
||||
zfree(sainfo, M_CDX);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
|
@ -616,8 +616,8 @@ cdx_dpa_ipsecsa_release(void *handle)
|
|||
}
|
||||
}
|
||||
|
||||
free(sainfo->shdesc_mem, M_CDX);
|
||||
free(sainfo, M_CDX);
|
||||
zfree(sainfo->shdesc_mem, M_CDX); /* the SA's keys, inline */
|
||||
zfree(sainfo, M_CDX);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,10 @@
|
|||
#define DEFINE_LOGGER_INSTANCE
|
||||
#include "logger.hpp"
|
||||
|
||||
const char* TMPFILENAME = "/tmp/fmc.bin";
|
||||
// fmc keeps its compiled model here between runs. /var/run is
|
||||
// writable by root only: in /tmp another user could plant a symlink for
|
||||
// root to write through.
|
||||
const char* TMPFILENAME = "/var/run/fmc.bin";
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@
|
|||
# mwifiex_uap — Configure and start the 88W9098 WiFi Access Point.
|
||||
# Settings are applied via sysctl to the mwifiex driver.
|
||||
#
|
||||
# /etc/rc.conf and rc.conf.local are readable by every local user: put
|
||||
# mwifiex_uap_passphrase in /etc/rc.conf.d/mwifiex_uap (mode 0600), which
|
||||
# rc.subr also reads. The driver's uap_passphrase sysctl is write-only.
|
||||
#
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue