Skip to content

netmap: harden nmreq option size and overflow checks (defensive)#265

Open
SORencber wants to merge 1 commit into
opnsense:stable/25.7from
SORencber:harden/netmap-nmreq-size-overflow
Open

netmap: harden nmreq option size and overflow checks (defensive)#265
SORencber wants to merge 1 commit into
opnsense:stable/25.7from
SORencber:harden/netmap-nmreq-size-overflow

Conversation

@SORencber
Copy link
Copy Markdown

Summary: Enforce exact per‑option body size equality; add explicit overflow guards for size arithmetic; reject invalid lengths with EINVAL. Defensive hardening; no API break.

Test Plan: malformed NIOCCTRL (oversized nro_size, invalid types) → EINVAL/ENOTTY/ENXIO; no panic; valid flows unchanged.

Risk: Low; only invalid inputs are rejected earlier.

…ct option body size equality per option type\n- Add explicit overflow guards to size arithmetic (sum)\n- Return EINVAL for invalid sizes; keep behavior for valid requests\n- Defensive hardening; no API break; reduces potential DoS/OOB surfaces
@AdSchellevis
Copy link
Copy Markdown
Member

hi @SORencber best open a request upstream (https://github.com/freebsd/freebsd-src / https://reviews.freebsd.org/) to avoid future breakage.

@SORencber

This comment was marked as abuse.

@AdSchellevis AdSchellevis added the upstream Third party issue label Oct 3, 2025
@SORencber

This comment was marked as abuse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upstream Third party issue

Development

Successfully merging this pull request may close these issues.

2 participants