An action can carry an NXM/OXM field header directly, e.g. the zone
source of a ct action. If that header has the experimenter class, the
mask bit set and a length smaller than the 4-byte experimenter ID,
nxm_field_by_header() calls nxm_make_exact_header(), which hits the
assertion in nxm_payload_len() and aborts. This happens while decoding
actions, so a single OpenFlow message carrying such an action aborts
ovs-vswitchd, and 'ovs-ofctl parse-actions' aborts on the same bytes.

nx_pull_header__() already rejects these headers when they are pulled
from a match or an action payload, but headers stored in fixed action
fields don't go through it. Return NULL from nxm_field_by_header() for
them instead, so callers report OFPBAC_BAD_SET_TYPE as they do for any
other unknown field.

Fixes: 1936de256af4 ("nx-match: Fix potential integer underflow.")
Assisted-by: Claude Opus 5.5, Claude Code
Signed-off-by: Dickson Wu <[email protected]>
---
The patch is attached since my mail client mangles inline patches,
sorry about that.

I first sent this to the security list, and Ilya pointed out that
OpenFlow peers are trusted, so it isn't a security issue, but that a
fix would still be welcome.

Testing: the new case in the "OpenFlow 1.0 action translation" test
fails without the fix (ovs-ofctl aborts on the assertion) and passes
with it. A full 'make check' on main passes with the patch (2755
successful, 10 skipped).
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to