git: fe06a7617f89 - releng/14.5 - bsnmp: reject an oversized vacmViewTreeFamilyMask
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 17 Nov 2026 17:05:20 UTC
The branch releng/14.5 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=fe06a7617f89d528c50a594cd967d24e31040507
commit fe06a7617f89d528c50a594cd967d24e31040507
Author: Maxim Konovalov <maxim@FreeBSD.org>
AuthorDate: 2026-11-13 03:07:48 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-11-16 21:17:13 +0000
bsnmp: reject an oversized vacmViewTreeFamilyMask
The SET handler for vacmViewTreeFamilyMask compared the value length
against the 16-byte view->mask, but the check had no statement of its
own: it guarded the following malloc() instead of rejecting the
request. A value longer than 16 bytes was therefore copied into
view->mask with memcpy(), overflowing struct vacm_view. Add the
missing return so an over-long value is refused with wrongValue.
Approved by: so
Security: FreeBSD-SA-26:89.bsnmp
Security: CVE-2026-127743
Reviewed by: harti
Fixes: 135f7de5ddb6
---
contrib/bsnmp/snmp_vacm/vacm_snmp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/contrib/bsnmp/snmp_vacm/vacm_snmp.c b/contrib/bsnmp/snmp_vacm/vacm_snmp.c
index 39371176e493..29d1b8ffcb1e 100644
--- a/contrib/bsnmp/snmp_vacm/vacm_snmp.c
+++ b/contrib/bsnmp/snmp_vacm/vacm_snmp.c
@@ -490,6 +490,7 @@ op_vacm_view(struct snmp_context *ctx, struct snmp_value *val, uint32_t sub,
switch (val->var.subs[sub - 1]) {
case LEAF_vacmViewTreeFamilyMask:
if (val->v.octetstring.len > sizeof(view->mask))
+ return (SNMP_ERR_WRONG_VALUE);
ctx->scratch->ptr1 = malloc(sizeof(view->mask));
if (ctx->scratch->ptr1 == NULL)
return (SNMP_ERR_GENERR);