Skip to content
Heist/ feed
Back to feed
UnratedFix available

bpf: Fix stack-out-of-bounds write in devmap

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: bpf: Fix stack-out-of-bounds write in devmap get_upper_ifindexes() iterates over all upper devices and writes their indices into an array without checking bounds. Also the callers assume that the max number of upper devices is MAX_NEST_DEV and allocate excluded_devices[1+MAX_NEST_DEV] on the stack, but that assumption is not correct and the number of upper devices could be larger than MAX_NEST_DEV (e.g., many macvlans), causing a stack-out-of-bounds write. Add a max parameter to get_upper_ifindexes() to avoid the issue. When there are too many upper devices, return -EOVERFLOW and abort the redirect. To reproduce, create more than MAX_NEST_DEV(8) macvlans on a device with an XDP program attached using BPF_F_BROADCAST | BPF_F_EXCLUDE_INGRESS. Then send a packet to the device to trigger the XDP redirect path.

Products
Kernel
Affected versions
Not specified
Fixed versions
5.15.203, 6.1.167, 6.12.77, 6.18.17, 6.19.7, 6.6.130
CVEs
CVE-2026-23359
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 13:30 UTC · Revision 1

Source evidence

bpf: Fix stack-out-of-bounds write in devmap

core-osv · Original source

Published 25 Mar 2026, 10:27 UTC

In the Linux kernel, the following vulnerability has been resolved: bpf: Fix stack-out-of-bounds write in devmap get_upper_ifindexes() iterates over all upper devices and writes their indices into an array without checking bounds. Also the callers assume that the max number of upper devices is MAX_NEST_DEV and allocate excluded_devices[1+MAX_NEST_DEV] on the stack, but that assumption is not correct and the number of upper devices could be larger than MAX_NEST_DEV (e.g., many macvlans), causing a stack-out-of-bounds write. Add a max parameter to get_upper_ifindexes() to avoid the issue. When there are too many upper devices, return -EOVERFLOW and abort the redirect. To reproduce, create more than MAX_NEST_DEV(8) macvlans on a device with an XDP program attached using BPF_F_BROADCAST | BPF_F_EXCLUDE_INGRESS. Then send a packet to the device to trigger the XDP redirect path.

osv:CVE-2026-23359

Kernel

Fixed versions: 5.15.203, 6.1.167, 6.6.130, 6.12.77, 6.18.17, 6.19.7

Complete source record
{
  "id": "1afe5ea0b55224268079d82320fb80f646c67666616ace75f4e1272dc1c549dc",
  "url": "https://osv.dev/vulnerability/CVE-2026-23359",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "bpf: Fix stack-out-of-bounds write in devmap",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: bpf: Fix stack-out-of-bounds write in devmap get_upper_ifindexes() iterates over all upper devices and writes their indices into an array without checking bounds. Also the callers assume that the max number of upper devices is MAX_NEST_DEV and allocate excluded_devices[1+MAX_NEST_DEV] on the stack, but that assumption is not correct and the number of upper devices could be larger than MAX_NEST_DEV (e.g., many macvlans), causing a stack-out-of-bounds write. Add a max parameter to get_upper_ifindexes() to avoid the issue. When there are too many upper devices, return -EOVERFLOW and abort the redirect. To reproduce, create more than MAX_NEST_DEV(8) macvlans on a device with an XDP program attached using BPF_F_BROADCAST | BPF_F_EXCLUDE_INGRESS. Then send a packet to the device to trigger the XDP redirect path.",
    "evidence": "osv:CVE-2026-23359",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "5.15.203",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.1.167",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.6.130",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.12.77",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.18.17",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.19.7",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2026-23359",
      "aliases": [
        "CVE-2026-23359"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "aeea1b86f9363f3feabb496534d886f082a89f21"
                },
                {
                  "fixed": "88df604f0d16a692867582350ce3f2fcd22243f1"
                },
                {
                  "fixed": "5000e40acc8d0c36ab709662e32120986ac22e7e"
                },
                {
                  "fixed": "8a95fb9df1105b1618872c2846a6c01e3ba20b45"
                },
                {
                  "fixed": "d2c31d8e03d05edc16656e5ffe187f0d1da763d7"
                },
                {
                  "fixed": "75d474702b2ba8b6bcb26eb3004dbc5e95ffd5d2"
                },
                {
                  "fixed": "ca831567908fd3f73cf97d8a6c09a5054697a182"
                },
                {
                  "fixed": "b7bf516c3ecd9a2aae2dc2635178ab87b734fef1"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-23359.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.15.0"
                },
                {
                  "fixed": "5.15.203"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.16.0"
                },
                {
                  "fixed": "6.1.167"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.2.0"
                },
                {
                  "fixed": "6.6.130"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.7.0"
                },
                {
                  "fixed": "6.12.77"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.13.0"
                },
                {
                  "fixed": "6.18.17"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.19.0"
                },
                {
                  "fixed": "6.19.7"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-23359.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:35.844896481Z",
      "provider": "osv",
      "references": [
        "https://cert-portal.siemens.com/productcert/html/ssa-019113.html",
        "https://cert-portal.siemens.com/productcert/html/ssa-082556.html",
        "https://cert-portal.siemens.com/productcert/html/ssa-457936.html",
        "https://cert-portal.siemens.com/productcert/html/ssa-784472.html",
        "https://git.kernel.org/stable/c/5000e40acc8d0c36ab709662e32120986ac22e7e",
        "https://git.kernel.org/stable/c/75d474702b2ba8b6bcb26eb3004dbc5e95ffd5d2",
        "https://git.kernel.org/stable/c/88df604f0d16a692867582350ce3f2fcd22243f1",
        "https://git.kernel.org/stable/c/8a95fb9df1105b1618872c2846a6c01e3ba20b45",
        "https://git.kernel.org/stable/c/b7bf516c3ecd9a2aae2dc2635178ab87b734fef1",
        "https://git.kernel.org/stable/c/ca831567908fd3f73cf97d8a6c09a5054697a182",
        "https://git.kernel.org/stable/c/d2c31d8e03d05edc16656e5ffe187f0d1da763d7",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/23xxx/CVE-2026-23359.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-23359",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/23xxx/CVE-2026-23359.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-23359",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 503146,
  "published_at": "2026-03-25T10:27:43.07+00:00"
}