git: 921480fc2144 - releng/15.2 - bsnmp: reject an oversized vacmViewTreeFamilyMask
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 17 Nov 2026 17:09:52 UTC
The branch releng/15.2 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=921480fc21443da65fe810fb101bc9b4e5fc284d
commit 921480fc21443da65fe810fb101bc9b4e5fc284d
Author: Maxim Konovalov <maxim@FreeBSD.org>
AuthorDate: 2026-11-13 03:07:48 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-11-17 13:36:18 +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: re (cperciva)
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);