git: 85533cf8f2ea - main - bsnmp: reject an oversized vacmViewTreeFamilyMask
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 17 Nov 2026 17:01:58 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=85533cf8f2ea9af93bf9550a1a165b99ba451fc8
commit 85533cf8f2ea9af93bf9550a1a165b99ba451fc8
Author: Maxim Konovalov <maxim@FreeBSD.org>
AuthorDate: 2026-11-13 03:07:48 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-11-17 16:57:01 +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);