{
  "threat_severity" : "Moderate",
  "public_date" : "2026-04-13T00:00:00Z",
  "bugzilla" : {
    "description" : "kernel: ipv6: avoid overflows in ip6_datagram_send_ctl()",
    "id" : "2457840",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2457840"
  },
  "cvss3" : {
    "cvss3_base_score" : "5.5",
    "cvss3_scoring_vector" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H",
    "status" : "draft"
  },
  "cwe" : "CWE-190",
  "details" : [ "In the Linux kernel, the following vulnerability has been resolved:\nipv6: avoid overflows in ip6_datagram_send_ctl()\nYiming Qian reported :\n<quote>\nI believe I found a locally triggerable kernel bug in the IPv6 sendmsg\nancillary-data path that can panic the kernel via `skb_under_panic()`\n(local DoS).\nThe core issue is a mismatch between:\n- a 16-bit length accumulator (`struct ipv6_txoptions::opt_flen`, type\n`__u16`) and\n- a pointer to the *last* provided destination-options header (`opt->dst1opt`)\nwhen multiple `IPV6_DSTOPTS` control messages (cmsgs) are provided.\n- `include/net/ipv6.h`:\n- `struct ipv6_txoptions::opt_flen` is `__u16` (wrap possible).\n(lines 291-307, especially 298)\n- `net/ipv6/datagram.c:ip6_datagram_send_ctl()`:\n- Accepts repeated `IPV6_DSTOPTS` and accumulates into `opt_flen`\nwithout rejecting duplicates. (lines 909-933)\n- `net/ipv6/ip6_output.c:__ip6_append_data()`:\n- Uses `opt->opt_flen + opt->opt_nflen` to compute header\nsizes/headroom decisions. (lines 1448-1466, especially 1463-1465)\n- `net/ipv6/ip6_output.c:__ip6_make_skb()`:\n- Calls `ipv6_push_frag_opts()` if `opt->opt_flen` is non-zero.\n(lines 1930-1934)\n- `net/ipv6/exthdrs.c:ipv6_push_frag_opts()` / `ipv6_push_exthdr()`:\n- Push size comes from `ipv6_optlen(opt->dst1opt)` (based on the\npointed-to header). (lines 1179-1185 and 1206-1211)\n1. `opt_flen` is a 16-bit accumulator:\n- `include/net/ipv6.h:298` defines `__u16 opt_flen; /* after fragment hdr */`.\n2. `ip6_datagram_send_ctl()` accepts *repeated* `IPV6_DSTOPTS` cmsgs\nand increments `opt_flen` each time:\n- In `net/ipv6/datagram.c:909-933`, for `IPV6_DSTOPTS`:\n- It computes `len = ((hdr->hdrlen + 1) << 3);`\n- It checks `CAP_NET_RAW` using `ns_capable(net->user_ns,\nCAP_NET_RAW)`. (line 922)\n- Then it does:\n- `opt->opt_flen += len;` (line 927)\n- `opt->dst1opt = hdr;` (line 928)\nThere is no duplicate rejection here (unlike the legacy\n`IPV6_2292DSTOPTS` path which rejects duplicates at\n`net/ipv6/datagram.c:901-904`).\nIf enough large `IPV6_DSTOPTS` cmsgs are provided, `opt_flen` wraps\nwhile `dst1opt` still points to a large (2048-byte)\ndestination-options header.\nIn the attached PoC (`poc.c`):\n- 32 cmsgs with `hdrlen=255` => `len = (255+1)*8 = 2048`\n- 1 cmsg with `hdrlen=0` => `len = 8`\n- Total increment: `32*2048 + 8 = 65544`, so `(__u16)opt_flen == 8`\n- The last cmsg is 2048 bytes, so `dst1opt` points to a 2048-byte header.\n3. The transmit path sizes headers using the wrapped `opt_flen`:\n- In `net/ipv6/ip6_output.c:1463-1465`:\n- `headersize = sizeof(struct ipv6hdr) + (opt ? opt->opt_flen +\nopt->opt_nflen : 0) + ...;`\nWith wrapped `opt_flen`, `headersize`/headroom decisions underestimate\nwhat will be pushed later.\n4. When building the final skb, the actual push length comes from\n`dst1opt` and is not limited by wrapped `opt_flen`:\n- In `net/ipv6/ip6_output.c:1930-1934`:\n- `if (opt->opt_flen) proto = ipv6_push_frag_opts(skb, opt, proto);`\n- In `net/ipv6/exthdrs.c:1206-1211`, `ipv6_push_frag_opts()` pushes\n`dst1opt` via `ipv6_push_exthdr()`.\n- In `net/ipv6/exthdrs.c:1179-1184`, `ipv6_push_exthdr()` does:\n- `skb_push(skb, ipv6_optlen(opt));`\n- `memcpy(h, opt, ipv6_optlen(opt));`\nWith insufficient headroom, `skb_push()` underflows and triggers\n`skb_under_panic()` -> `BUG()`:\n- `net/core/skbuff.c:2669-2675` (`skb_push()` calls `skb_under_panic()`)\n- `net/core/skbuff.c:207-214` (`skb_panic()` ends in `BUG()`)\n- The `IPV6_DSTOPTS` cmsg path requires `CAP_NET_RAW` in the target\nnetns user namespace (`ns_capable(net->user_ns, CAP_NET_RAW)`).\n- Root (or any task with `CAP_NET_RAW`) can trigger this without user\nnamespaces.\n- An unprivileged `uid=1000` user can trigger this if unprivileged\nuser namespaces are enabled and it can create a userns+netns to obtain\nnamespaced `CAP_NET_RAW` (the attached PoC does this).\n- Local denial of service: kernel BUG/panic (system crash).\n-\n---truncated---", "A flaw was found in the Linux kernel. A local attacker can exploit an integer overflow vulnerability in the `ip6_datagram_send_ctl()` function when processing multiple IPv6 Destination Options (DSTOPTS) control messages. This issue causes an incorrect calculation of header sizes, leading to a buffer underflow during packet construction. Successful exploitation can result in a kernel panic, causing a denial of service." ],
  "package_state" : [ {
    "product_name" : "Red Hat Enterprise Linux 10",
    "fix_state" : "Fix deferred",
    "package_name" : "kernel",
    "cpe" : "cpe:/o:redhat:enterprise_linux:10"
  }, {
    "product_name" : "Red Hat Enterprise Linux 6",
    "fix_state" : "Out of support scope",
    "package_name" : "kernel",
    "cpe" : "cpe:/o:redhat:enterprise_linux:6"
  }, {
    "product_name" : "Red Hat Enterprise Linux 7",
    "fix_state" : "Fix deferred",
    "package_name" : "kernel",
    "cpe" : "cpe:/o:redhat:enterprise_linux:7"
  }, {
    "product_name" : "Red Hat Enterprise Linux 7",
    "fix_state" : "Fix deferred",
    "package_name" : "kernel-rt",
    "cpe" : "cpe:/o:redhat:enterprise_linux:7"
  }, {
    "product_name" : "Red Hat Enterprise Linux 8",
    "fix_state" : "Fix deferred",
    "package_name" : "kernel",
    "cpe" : "cpe:/o:redhat:enterprise_linux:8"
  }, {
    "product_name" : "Red Hat Enterprise Linux 8",
    "fix_state" : "Fix deferred",
    "package_name" : "kernel-rt",
    "cpe" : "cpe:/o:redhat:enterprise_linux:8"
  }, {
    "product_name" : "Red Hat Enterprise Linux 9",
    "fix_state" : "Fix deferred",
    "package_name" : "kernel",
    "cpe" : "cpe:/o:redhat:enterprise_linux:9"
  }, {
    "product_name" : "Red Hat Enterprise Linux 9",
    "fix_state" : "Fix deferred",
    "package_name" : "kernel-rt",
    "cpe" : "cpe:/o:redhat:enterprise_linux:9"
  } ],
  "references" : [ "https://www.cve.org/CVERecord?id=CVE-2026-31415\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-31415\nhttps://lore.kernel.org/linux-cve-announce/2026041310-CVE-2026-31415-f7e1@gregkh/T" ],
  "name" : "CVE-2026-31415",
  "csaw" : false
}