From patchwork Sun Dec 6 03:39:50 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Tyagi X-Patchwork-Id: 107538 Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.2142.1796528411373239673 for ; Sat, 05 Dec 2026 19:40:11 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=LF2qcVh+; spf=pass (domain: gmail.com, ip: 209.85.215.174, mailfrom: ankur.tyagi85@gmail.com) Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-ce12248de51so911714a12.0 for ; Sat, 05 Dec 2026 19:40:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796528410; x=1797133210; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=NJ69x5T+ihFM43pCdF4+YIa2s2D0daQObMnqErodI0E=; b=LF2qcVh+TTRPG114mtxSV0En4n78Fg9tdbSe/JrPAWc3boidffnNJX4Xc0yn93Hmwo zroRIGKwUPm+5LnmzWE398DY6lavDtmmzvIot1MiF/dLjQxpLh3sDJv5vJ6HlRZme9bV 3F1HuLBMuiSE8GqmkiumP1HrfE3w6MO6VVMKK/QunW1P9ETu8nt1xC8HWasaTBZC2wn7 Jky+6Sq67yTpE25QyyaRKpYM9h0AlckmTnQA8Ad8/1EVuu23Qs9nFedCZkP0Q5X1nF0Y IU3IU0PXOImre4aL6h3n5R7bGSfWNuMNWBaObqTvNDYWRkZDKfW0YlEK2xL2QGBZi2Sg dPtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796528410; x=1797133210; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=NJ69x5T+ihFM43pCdF4+YIa2s2D0daQObMnqErodI0E=; b=jTg3csK6hHSOs0BPFxMTyLvIE2UbF1VBpOq6vfxc3FzgeZilsoAFmLI0cGgmZk405W wQKHJKqEpnonQ3kQ8YLa/swOGGAtpE/tftBXXpjXTibXNFrsK75JuZXTOThVllo12mGc TUfDmG9oeQdLj9OIT9Uh7B37fjVJAjharx+M3uMl1IUQKWhH1rZgWg5iDMAIT3vxDgsh 6pBVER8RX4pXr/9yLBIqCSy7AH14Q0Abw+r82vOyZi2EUTRVuyhvsRjSijTywNWp0b11 zR08TSu/L+2edJ4kfoZLwZcS44JU2F6hbyEGcE6j/ZawvUFp4qTR4E63hPpnoSdJlMGH 1tQA== X-Gm-Message-State: AB4q+uFtgzO6PSrkWRJqT6eho4ChhH+VSepUhxlUOfnBEy527nlIZZOV oqp3tDCc9JIEDQED9cI84HwkXk6r59o+g+FK8tbxVm+BLh/jk6EzZ0kWZji81w/a X-Gm-Gg: AZFdTZchNQQac6fpG3YyWDfofkOoPKCd5S97hPqweYvkzGtqaKz68kgJwn0eJvvPM2R Hq5qGkFNb1tM6wwk4ODgq5epVf3YeV8Y0QrPEBT3sbkFK19nHus3HT4Q7H3a73XbUC8B1H4QuJ5 TmgKCvUlMp2k6ku2a2bN3WbRG6TrptbQvk73wIqufSSUJ/HYr12MeqPDAwwoFLe4gIMDMvNiiek 269bh4k/4/M2qFnNle/EhPhKEgP8nlTHM9BftwdADtOykH3Qxxg30LlgQMc/mxiudHLSevURKBv pcFJ6NpJEOPtvrnpZ8BNzbF2fpXQ2HO/JcBygyMLAjGJlSZxS0gwEhXfslglVIbXJxWe9OwKC4V je5r9Z2e8nGC50ddfwEvZj9nUgueKJ0aWJDYSYrA7+5xcB6aKVmmtEbLCMF7BkZpXo32Tjt26oG 9ol3H0ib71A+hkPqeVUF0kfdKN80L4E6w+sRgalMyQG8QQ38OZIBQy2XELjXp2Tw1+ut93hjKci uCPTpFKnzV24qvpe0///jCg5ZVslGY02hKMZkZOxGtRStrYWLif1RZ0CiM6HgwacCX8dZKTNWwL 7M7W5C4emiBotN0OBChHrcRJ++PhBT6JBo64THmzx45CEXe5KbZKN11UljqYeawFFISQXOmKBz5 Y6ayfUdksaYJQMy17MNjesA== X-Received: by 2002:a17:90b:278c:b0:3aa:fc22:8aad with SMTP id 98e67ed59e1d1-3b5e06a6525mr6263672a91.54.1796528410373; Sat, 05 Dec 2026 19:40:10 -0800 (PST) Return-Path: Received: from NVAPF55DW0D-IPD.. ([147.161.219.8]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5ddc36965sm10915161a91.8.2026.12.05.19.40.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2026 19:40:09 -0800 (PST) From: ankur.tyagi85@gmail.com To: openembedded-devel@lists.openembedded.org Cc: Ankur Tyagi Subject: [oe][meta-networking][blacksail][PATCH 1/5] net-snmp: patch CVE-2026-138295 Date: Sun, 6 Dec 2026 16:39:50 +1300 Message-ID: <20261206033955.584654-1-ankur.tyagi85@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Sun, 06 Dec 2026 03:40:13 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/134135 From: Ankur Tyagi Dropped commit[1] out of 3 identified by nvd as it is only adding credits in the news file. Details: https://nvd.nist.gov/vuln/detail/CVE-2026-138295 [1]https://github.com/net-snmp/net-snmp/commit/b44e7f15bdb9014e5cb199c81f787ce9398c7d14 Signed-off-by: Ankur Tyagi --- .../net-snmp/net-snmp/CVE-2026-138295_1.patch | 110 ++++++++ .../net-snmp/net-snmp/CVE-2026-138295_2.patch | 241 ++++++++++++++++++ .../net-snmp/net-snmp_5.9.5.2.bb | 2 + 3 files changed, 353 insertions(+) create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/CVE-2026-138295_1.patch create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/CVE-2026-138295_2.patch diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/CVE-2026-138295_1.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/CVE-2026-138295_1.patch new file mode 100644 index 0000000000..11a41be443 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/CVE-2026-138295_1.patch @@ -0,0 +1,110 @@ +From b5398cafe301616d39bf6fd3df86b456ee51011d Mon Sep 17 00:00:00 2001 +From: Bart Van Assche +Date: Thu, 11 Jun 2026 13:03:22 -0700 +Subject: [PATCH] snmpd: VACM: Fix out-of-bounds reads and integer overflows + +In sec2group_parse_oid(), change oidLen <= 0 into oidLen < 2 to +guarantee that oidIndex[1] may be read. + +In access_parse_oid(), change oidLen <= 0 into oidLen < 4 to ensure that +the following expressions stay inside the array bounds: oidIndex[0], +oidIndex[groupNameL + 1], oidIndex[groupNameL + contextPrefixL + 2] and +oidIndex[groupNameL + contextPrefixL + 3]. + +In view_parse_oid(), check whether viewNameL < oidLen before +subtracting these two variables. Remove the subtreeL < 0 test because it +is guaranteed that subtreeL >= 0. + +(cherry picked from commit e96e212a101d4c4beb51cf7cd7d89f1e342f9eed) +CVE: CVE-2026-138295 +Upstream-Status: Backport [https://github.com/net-snmp/net-snmp/commit/e96e212a101d4c4beb51cf7cd7d89f1e342f9eed] +Signed-off-by: Ankur Tyagi +--- + agent/mibgroup/mibII/vacm_vars.c | 29 ++++++++++++++--------------- + 1 file changed, 14 insertions(+), 15 deletions(-) + +diff --git a/agent/mibgroup/mibII/vacm_vars.c b/agent/mibgroup/mibII/vacm_vars.c +index ad6f6ddf9..43ca491a5 100644 +--- a/agent/mibgroup/mibII/vacm_vars.c ++++ b/agent/mibgroup/mibII/vacm_vars.c +@@ -683,17 +683,17 @@ int + sec2group_parse_oid(oid * oidIndex, size_t oidLen, + int *model, unsigned char **name, size_t * nameLen) + { +- int nameL; +- int i; ++ oid nameL; ++ size_t i; + + /* + * first check the validity of the oid + */ +- if ((oidLen <= 0) || (!oidIndex)) { ++ if (oidLen < 2 || !oidIndex) { + return 1; + } + nameL = oidIndex[1]; /* the initial name length */ +- if ((int) oidLen != nameL + 2) { ++ if (oidLen != nameL + 2) { + return 1; + } + +@@ -987,21 +987,21 @@ access_parse_oid(oid * oidIndex, size_t oidLen, + unsigned char **contextPrefix, size_t * contextPrefixLen, + int *model, int *level) + { +- int groupNameL, contextPrefixL; +- int i; ++ oid groupNameL, contextPrefixL; ++ size_t i; + + /* + * first check the validity of the oid + */ +- if ((oidLen <= 0) || (!oidIndex)) { ++ if (oidLen < 4 || !oidIndex) { + return 1; + } + groupNameL = oidIndex[0]; +- if ((groupNameL + 1) > (int) oidLen) { ++ if (groupNameL >= oidLen || oidLen - groupNameL < 4) { + return 1; + } + contextPrefixL = oidIndex[groupNameL + 1]; /* the initial name length */ +- if ((int) oidLen != groupNameL + contextPrefixL + 4) { ++ if (oidLen - groupNameL - 4 != contextPrefixL) { + return 1; + } + +@@ -1468,15 +1468,18 @@ view_parse_oid(oid * oidIndex, size_t oidLen, + unsigned char **viewName, size_t * viewNameLen, + oid ** subtree, size_t * subtreeLen) + { +- int viewNameL, subtreeL, i; ++ size_t viewNameL, subtreeL, i; + + /* + * first check the validity of the oid + */ +- if ((oidLen <= 0) || (!oidIndex)) { ++ if (oidLen < 1 || !oidIndex) { + return SNMP_ERR_INCONSISTENTNAME; + } + viewNameL = oidIndex[0]; ++ if (viewNameL >= oidLen) { ++ return SNMP_ERR_INCONSISTENTNAME; ++ } + subtreeL = oidLen - viewNameL - 1; /* the initial name length */ + + /* +@@ -1486,10 +1489,6 @@ view_parse_oid(oid * oidIndex, size_t oidLen, + return SNMP_ERR_RESOURCEUNAVAILABLE; + } + +- if (subtreeL < 0) { +- return SNMP_ERR_NOCREATION; +- } +- + *viewName = (unsigned char *) malloc(viewNameL + 1); + + if (*viewName == NULL) { diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/CVE-2026-138295_2.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/CVE-2026-138295_2.patch new file mode 100644 index 0000000000..0ad8fcd1ee --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/CVE-2026-138295_2.patch @@ -0,0 +1,241 @@ +From 1bf1e257d0920f6cb983d9cfba9446a57feeed3e Mon Sep 17 00:00:00 2001 +From: Bart Van Assche +Date: Tue, 11 Aug 2026 23:14:28 +0000 +Subject: [PATCH] testing: Add regression unit tests for VACM OID parsing and + display hints + +Add unit test coverage for memory safety defects reported in VACM OID +parsing functions and numeric DISPLAY-HINT formatting: + +- In testing/fulltests/unit-tests/T025sprint_realloc_octet_string_clib.c, + extend test suite with multi-byte numeric display hints (2d, 4d, 2x, + 2o, 2d-2d) where data length is shorter than hint field width. + This verifies that sprint_realloc_octet_string() bounds reading + against remaining buffer length rather than over-reading (F-4/F-3). + +- In testing/fulltests/unit-tests/T031vacm_parse_oid_clib.c, add unit + tests for access_parse_oid(), view_parse_oid(), and + sec2group_parse_oid(). Test rejection of 0xFFFFFFFF OID length + sub-identifiers, lengths exceeding remaining OID array size, + sub-identifier values greater than 255 in string fields, + zero/short lengths, and NULL pointers, as well as successful + parsing of valid table entry OIDs (F-1 and F-5). + +These tests fix issues detected by Michalis Vasileiadis and his Hacker Bob +v2.0.1 software, an open-source autonomous source-audit framework. See +also https://github.com/vmihalis/hacker-bob. The underlying AI model is +Claude Opus 4.8. + +CVE: CVE-2026-138295 +Upstream-Status: Backport [https://github.com/net-snmp/net-snmp/commit/11a86c9aeb31f3cf07d6cc9259fcae34de6b3474] + +Dropped change to T025sprint_realloc_octet_string_clib.c which was added +by commit[1] after v5.9.5.2 + +[1] https://github.com/net-snmp/net-snmp/commit/4d779b69087f3e082fa3293f3b6f513bac2f5e7a + +Signed-off-by: Ankur Tyagi +--- + .../unit-tests/T031vacm_parse_oid_clib.c | 193 ++++++++++++++++++ + 1 file changed, 193 insertions(+) + create mode 100644 testing/fulltests/unit-tests/T031vacm_parse_oid_clib.c + +diff --git a/testing/fulltests/unit-tests/T031vacm_parse_oid_clib.c b/testing/fulltests/unit-tests/T031vacm_parse_oid_clib.c +new file mode 100644 +index 000000000..cf0d0ea0e +--- /dev/null ++++ b/testing/fulltests/unit-tests/T031vacm_parse_oid_clib.c +@@ -0,0 +1,193 @@ ++/* HEADER Testing VACM OID parsing (access_parse_oid, view_parse_oid, sec2group_parse_oid) */ ++ ++#include ++#include ++#include ++#include ++ ++#if !defined(NETSNMP_NO_WRITE_SUPPORT) && defined(HAVE_LIBNL3) ++ ++/* ========================================================================= ++ * Test access_parse_oid() (Finding F-1 and edge cases) ++ * ========================================================================= */ ++{ ++ unsigned char *groupName = NULL, *contextPrefix = NULL; ++ size_t groupNameLen = 0, contextPrefixLen = 0; ++ int model = 0, level = 0; ++ int res; ++ ++ /* ++ * Finding F-1: 0xFFFFFFFF in oidIndex[0] and oidIndex[1] with short oidLen. ++ * Must be rejected without buffer underwrite or out-of-bounds access. ++ */ ++ oid f1_oid[] = { 0xFFFFFFFFUL, 0xFFFFFFFFUL }; ++ res = access_parse_oid(f1_oid, sizeof(f1_oid) / sizeof(f1_oid[0]), ++ &groupName, &groupNameLen, ++ &contextPrefix, &contextPrefixLen, ++ &model, &level); ++ OK(res != 0, "access_parse_oid with F-1 truncated OID rejected"); ++ ++ /* Large groupName length exceeding oidLen */ ++ oid large_gn_oid[] = { 0xFFFFFFFFUL, 0, 0, 0, 0, 0 }; ++ res = access_parse_oid(large_gn_oid, sizeof(large_gn_oid) / sizeof(large_gn_oid[0]), ++ &groupName, &groupNameLen, ++ &contextPrefix, &contextPrefixLen, ++ &model, &level); ++ OK(res != 0, "access_parse_oid with large groupName length rejected"); ++ ++ /* Large contextPrefix length exceeding oidLen */ ++ oid large_cp_oid[] = { 1, 'a', 0xFFFFFFFFUL, 0, 0, 0 }; ++ res = access_parse_oid(large_cp_oid, sizeof(large_cp_oid) / sizeof(large_cp_oid[0]), ++ &groupName, &groupNameLen, ++ &contextPrefix, &contextPrefixLen, ++ &model, &level); ++ OK(res != 0, "access_parse_oid with large contextPrefix length rejected"); ++ ++ /* Short oidLen / NULL pointer checks */ ++ res = access_parse_oid(NULL, 10, &groupName, &groupNameLen, ++ &contextPrefix, &contextPrefixLen, &model, &level); ++ OK(res != 0, "access_parse_oid with NULL oidIndex rejected"); ++ ++ res = access_parse_oid(f1_oid, 0, &groupName, &groupNameLen, ++ &contextPrefix, &contextPrefixLen, &model, &level); ++ OK(res != 0, "access_parse_oid with oidLen=0 rejected"); ++ ++ res = access_parse_oid(f1_oid, 3, &groupName, &groupNameLen, ++ &contextPrefix, &contextPrefixLen, &model, &level); ++ OK(res != 0, "access_parse_oid with oidLen=3 rejected"); ++ ++ /* Character > 255 in groupName */ ++ oid oob_char_gn[] = { 1, 300, 0, 3, 1 }; ++ res = access_parse_oid(oob_char_gn, sizeof(oob_char_gn) / sizeof(oob_char_gn[0]), ++ &groupName, &groupNameLen, ++ &contextPrefix, &contextPrefixLen, ++ &model, &level); ++ OK(res != 0, "access_parse_oid with groupName char > 255 rejected"); ++ ++ /* Character > 255 in contextPrefix */ ++ oid oob_char_cp[] = { 1, 'a', 1, 300, 3, 1 }; ++ res = access_parse_oid(oob_char_cp, sizeof(oob_char_cp) / sizeof(oob_char_cp[0]), ++ &groupName, &groupNameLen, ++ &contextPrefix, &contextPrefixLen, ++ &model, &level); ++ OK(res != 0, "access_parse_oid with contextPrefix char > 255 rejected"); ++ ++ /* Valid access entry OID parsing */ ++ oid valid_access_oid[] = { 3, 'g', 'r', 'p', 3, 'c', 't', 'x', 3, 1 }; ++ groupName = NULL; ++ contextPrefix = NULL; ++ res = access_parse_oid(valid_access_oid, ++ sizeof(valid_access_oid) / sizeof(valid_access_oid[0]), ++ &groupName, &groupNameLen, ++ &contextPrefix, &contextPrefixLen, ++ &model, &level); ++ OK(res == 0, "access_parse_oid with valid OID succeeded"); ++ OK(groupName != NULL && groupNameLen == 3 && strcmp((char *)groupName, "grp") == 0, ++ "access_parse_oid parsed groupName correctly"); ++ OK(contextPrefix != NULL && contextPrefixLen == 3 && strcmp((char *)contextPrefix, "ctx") == 0, ++ "access_parse_oid parsed contextPrefix correctly"); ++ OK(model == 3, "access_parse_oid parsed model correctly"); ++ OK(level == 1, "access_parse_oid parsed level correctly"); ++ free(groupName); ++ free(contextPrefix); ++} ++ ++/* ========================================================================= ++ * Test view_parse_oid() (Finding F-5 and edge cases) ++ * ========================================================================= */ ++{ ++ unsigned char *viewName = NULL; ++ size_t viewNameLen = 0, subtreeLen = 0; ++ oid *subtree = NULL; ++ int res; ++ ++ /* ++ * Finding F-5: 0xFFFFFFFF in oidIndex[0] with short oidLen. ++ * Must be rejected without buffer underwrite or out-of-bounds access. ++ */ ++ oid f5_oid[] = { 0xFFFFFFFFUL }; ++ res = view_parse_oid(f5_oid, sizeof(f5_oid) / sizeof(f5_oid[0]), ++ &viewName, &viewNameLen, &subtree, &subtreeLen); ++ OK(res != 0, "view_parse_oid with F-5 truncated OID rejected"); ++ ++ /* Large viewName length exceeding oidLen */ ++ oid large_vn_oid[] = { 0xFFFFFFFFUL, 1, 3, 6, 1 }; ++ res = view_parse_oid(large_vn_oid, sizeof(large_vn_oid) / sizeof(large_vn_oid[0]), ++ &viewName, &viewNameLen, &subtree, &subtreeLen); ++ OK(res != 0, "view_parse_oid with large viewName length rejected"); ++ ++ /* Short oidLen / NULL pointer checks */ ++ res = view_parse_oid(NULL, 10, &viewName, &viewNameLen, &subtree, &subtreeLen); ++ OK(res != 0, "view_parse_oid with NULL oidIndex rejected"); ++ ++ res = view_parse_oid(f5_oid, 0, &viewName, &viewNameLen, &subtree, &subtreeLen); ++ OK(res != 0, "view_parse_oid with oidLen=0 rejected"); ++ ++ /* viewNameL >= oidLen */ ++ oid vn_ge_oid[] = { 5, 'a', 'b' }; ++ res = view_parse_oid(vn_ge_oid, sizeof(vn_ge_oid) / sizeof(vn_ge_oid[0]), ++ &viewName, &viewNameLen, &subtree, &subtreeLen); ++ OK(res != 0, "view_parse_oid with viewNameLen >= oidLen rejected"); ++ ++ /* Character > 255 in viewName */ ++ oid oob_char_vn[] = { 1, 300, 1, 3, 6, 1 }; ++ res = view_parse_oid(oob_char_vn, sizeof(oob_char_vn) / sizeof(oob_char_vn[0]), ++ &viewName, &viewNameLen, &subtree, &subtreeLen); ++ OK(res != 0, "view_parse_oid with viewName char > 255 rejected"); ++ ++ /* Valid view entry OID parsing */ ++ oid valid_view_oid[] = { 5, 'v', 'i', 'e', 'w', '1', 1, 3, 6, 1 }; ++ viewName = NULL; ++ subtree = NULL; ++ res = view_parse_oid(valid_view_oid, ++ sizeof(valid_view_oid) / sizeof(valid_view_oid[0]), ++ &viewName, &viewNameLen, &subtree, &subtreeLen); ++ OK(res == 0, "view_parse_oid with valid OID succeeded"); ++ OK(viewName != NULL && viewNameLen == 5 && strcmp((char *)viewName, "view1") == 0, ++ "view_parse_oid parsed viewName correctly"); ++ OK(subtree != NULL && subtreeLen == 4 && ++ subtree[0] == 1 && subtree[1] == 3 && subtree[2] == 6 && subtree[3] == 1, ++ "view_parse_oid parsed subtree correctly"); ++ free(viewName); ++ free(subtree); ++} ++ ++/* ========================================================================= ++ * Test sec2group_parse_oid() (Related VACM OID parsing) ++ * ========================================================================= */ ++{ ++ unsigned char *name = NULL; ++ size_t nameLen = 0; ++ int model = 0; ++ int res; ++ ++ /* Large name length exceeding oidLen */ ++ oid large_s2g_oid[] = { 3, 0xFFFFFFFFUL }; ++ res = sec2group_parse_oid(large_s2g_oid, sizeof(large_s2g_oid) / sizeof(large_s2g_oid[0]), ++ &model, &name, &nameLen); ++ OK(res != 0, "sec2group_parse_oid with large name length rejected"); ++ ++ /* Short oidLen / NULL checks */ ++ res = sec2group_parse_oid(NULL, 10, &model, &name, &nameLen); ++ OK(res != 0, "sec2group_parse_oid with NULL oidIndex rejected"); ++ ++ res = sec2group_parse_oid(large_s2g_oid, 0, &model, &name, &nameLen); ++ OK(res != 0, "sec2group_parse_oid with oidLen=0 rejected"); ++ ++ res = sec2group_parse_oid(large_s2g_oid, 1, &model, &name, &nameLen); ++ OK(res != 0, "sec2group_parse_oid with oidLen=1 rejected"); ++ ++ /* Valid sec2group entry OID parsing */ ++ oid valid_s2g_oid[] = { 3, 5, 'u', 's', 'e', 'r', '1' }; ++ name = NULL; ++ res = sec2group_parse_oid(valid_s2g_oid, ++ sizeof(valid_s2g_oid) / sizeof(valid_s2g_oid[0]), ++ &model, &name, &nameLen); ++ OK(res == 0, "sec2group_parse_oid with valid OID succeeded"); ++ OK(model == 3, "sec2group_parse_oid parsed model correctly"); ++ OK(name != NULL && nameLen == 5 && strcmp((char *)name, "user1") == 0, ++ "sec2group_parse_oid parsed name correctly"); ++ free(name); ++} ++ ++#endif /* !NETSNMP_NO_WRITE_SUPPORT */ diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.5.2.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.5.2.bb index 48704d020f..2fa02c3f22 100644 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.5.2.bb +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.5.2.bb @@ -26,6 +26,8 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \ file://0011-ac_add_search_path.m4-keep-consistent-between-32bit-.patch \ file://0012-apps-Makefile.in-Link-libraries-explicitly.patch \ file://netsnmp-swinst-crash.patch \ + file://CVE-2026-138295_1.patch \ + file://CVE-2026-138295_2.patch \ " SRC_URI[sha256sum] = "16707719f833184a4b72835dac359ae188123b06b5e42817c00790d7dc1384bf"