SecurityContext

CVE-2021-47515: Linux Kernel - Null Pointer Dereference

  • Cve: CVE-2021-47515
  • Name: Linux Kernel - Null Pointer Dereference
  • Description: 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.
  • Impact: Potential NULL pointer dereference leading to kernel crash or denial of service when processing encapsulated IPv4 packets in IPv6 SRH headers.
  • Remediation: Apply the patch that sets the IPv6 socket control block's interface index after encapsulation, or update to the latest kernel version where this fix is included.
  • Vulnerability type: null_pointer_dereference
  • Vulnerability impact: denial_of_service
  • Requirement type: none
  • Labels source: projectdiscovery
  • Severity: medium
  • Cvss score: 5.5
  • Cvss vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
  • Epss score: 0.00746
  • Epss percentile: 0.55565
  • Assignee: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
  • Published at: 2024-05-24T15:15:12Z
  • Age in days: 914
  • Modified at: 2026-08-04T10:17:06Z
  • Patch available: yes
  • References total: 6
  • Products total: 1
  • Oss: yes
  • Projects total: 1
  • Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2021-47515
  • Nvd status: modified
  • Checked, none or zero: known exploited entries, nuclei templates, public exploits total, public exploits capped, public exploits, rejected by nvd
  • Not known: requirements, hackerone

Cwe

IdName
CWE-476NULL Pointer Dereference

References

Same in every row:

  • Source: nvd
  • Tags: Patch
Url
https://git.kernel.org/stable/c/6431e71093f3da586a00c6d931481ffb0dc2db0e
https://git.kernel.org/stable/c/666521b3852d2b2f52d570f9122b1e4b50d96831
https://git.kernel.org/stable/c/98adb2bbfa407c9290bda299d4c6f7a1c4ebd5e1
https://git.kernel.org/stable/c/ae68d93354e5bf5191ee673982251864ea24dd5c
https://git.kernel.org/stable/c/b16d412e5f79734033df04e97d7ea2f50a8e9fe3
https://git.kernel.org/stable/c/ef8804e47c0a44ae106ead1740408af5ea6c6ee9

Products

ProductAffectedPlatform boundSourcesUrl
linux:linux_kernel= 5.0 rc8; = 5.0 rc7; = 5.0 rc6; = 5.16 rc1; = 5.16 rc2; = 5.16 rc3; = 5.16 rc4; >= 5.11, < 5.15.8; >= 5.5, < 5.10.85; >= 5.0.1, < 5.4.165; = 5.0; >= 4.20.7, < 5.0; >= 4.19.20, < 4.19.221; >= 4.14.98, < 4.14.258nonvd/v1/products/linux/linux_kernel

Projects

RepositoryLink kindsIndexedUrl
torvalds/linuxcna_commit, commityes/v1/repositories/torvalds/linux

Index

  • Checked, none or zero: repositories, repositories high signal, packages

Exploitation

  • Authentication required: yes
  • Exposed hosts: 10038339
  • Checked, none or zero: known exploited, known exploited by, exploitation seen, public exploit, public exploit count, initial access, remote
  • Not known: known exploited since, vulncheck known exploited since, public exploit first date, nuclei template, initial access since, hackerone reports