CVE-2021-47515: seg6: fix the iif in the IPv6 socket control block
In the Linux kernel, the following vulnerability has been resolved:
seg6: fix the iif in the IPv6 socket control block
When an IPv4 packet is received, the ip_rcv_core(...) sets the receiving
interface index into the IPv4 socket control block (v5.16-rc4,
net/ipv4/ip_input.c line 510):
IPCB(skb)->iif = skb->skb_iif;
If that IPv4 packet is meant to be encapsulated in an outer IPv6+SRH
header, the seg6_do_srh_encap(...) performs the required encapsulation.
In this case, the seg6_do_srh_encap function clears the IPv6 socket control
block (v5.16-rc4 net/ipv6/seg6_iptunnel.c line 163):
memset(IP6CB(skb), 0, sizeof(*IP6CB(skb)));
The memset(...) was introduced in commit ef489749aae5 ("ipv6: sr: clear
IP6CB(skb) on SRH ip4ip6 encapsulation") a long time ago (2019-01-29).
Since the IPv6 socket control block and the IPv4 socket control block share
the same memory area (skb->cb), the receiving interface index info is lost
(IP6CB(skb)->iif is set to zero).
As a side effect, that condition triggers a NULL pointer dereference if
commit 0857d6f8c759 ("ipv6: When forwarding count rx stats on the orig
netdev") is applied.
To fix that issue, we set the IP6CB(skb)->iif with the index of the
receiving interface once again.
Security readout for executives and security teams
Plain-English summary
This Linux kernel flaw can cause a crash in a specific IPv6 Segment Routing encapsulation path. It is most relevant to Linux systems acting as routers or network infrastructure using SRv6/seg6 behavior. Public sources do not show active exploitation or a CVSS score.
Executive priority
Treat this as a targeted kernel stability risk for Linux-based routing or SRv6 environments. Patch during normal kernel maintenance unless affected systems handle critical network forwarding, where earlier remediation is justified.
Technical view
During IPv4-to-IPv6 SRH encapsulation, seg6_do_srh_encap cleared the shared skb control buffer, erasing the receiving interface index. With later IPv6 forwarding stats logic, the missing interface value can lead to a NULL pointer dereference. Stable kernel fixes restore IP6CB(skb)->iif after encapsulation.
Likely exposure
Exposure is likely limited to affected Linux kernel versions where IPv6 Segment Routing encapsulates IPv4 traffic. General-purpose Linux servers not using SRv6/seg6 forwarding paths are less likely to encounter this condition, based on the provided evidence.
Exploitation context
The source bundle describes a kernel NULL pointer dereference condition, not a public exploit. CISA KEV status is false in the supplied data, and no cited source claims active exploitation.
Researcher notes
The key condition is loss of iif because IPv4 and IPv6 socket control blocks share skb->cb. The provided sources identify the fix direction but do not provide CVSS, exploitability analysis, or evidence of attacker-controlled triggering beyond the affected packet-processing path.
Mitigation direction
Apply Linux kernel or distribution updates that include the referenced stable fixes.
Prioritize network appliances and hosts using IPv6 Segment Routing or seg6 tunneling.
If patching is delayed, review vendor guidance for disabling or reducing affected seg6 paths.
Track distribution backports rather than relying only on upstream kernel version numbers.
Validation and detection
Inventory Linux kernel versions against the affected ranges in the CVE record.
Confirm whether systems use IPv6 Segment Routing, seg6, or SRH encapsulation.
Check vendor kernel changelogs for the referenced stable fix commits.
Review kernel logs for NULL pointer dereferences in IPv6 forwarding or seg6 paths.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2021-47515 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.