{"id":"CVE-2021-47515","published":"2024-05-24T15:09:29Z","modified":"2026-08-05T08:48:12Z","title":"seg6: fix the iif in the IPv6 socket control block","vendor":"Linux","product":"Linux","tier":"tail","description":{"text":"In the Linux kernel, the following vulnerability has been resolved:\n\nseg6: fix the iif in the IPv6 socket control block\n\nWhen an IPv4 packet is received, the ip_rcv_core(...) sets the receiving\ninterface index into the IPv4 socket control block (v5.16-rc4,\nnet/ipv4/ip_input.c line 510):\n\n    IPCB(skb)->iif = skb->skb_iif;\n\nIf that IPv4 packet is meant to be encapsulated in an outer IPv6+SRH\nheader, the seg6_do_srh_encap(...) performs the required encapsulation.\nIn this case, the seg6_do_srh_encap function clears the IPv6 socket control\nblock (v5.16-rc4 net/ipv6/seg6_iptunnel.c line 163):\n\n    memset(IP6CB(skb), 0, sizeof(*IP6CB(skb)));\n\nThe memset(...) was introduced in commit ef489749aae5 (\"ipv6: sr: clear\nIP6CB(skb) on SRH ip4ip6 encapsulation\") a long time ago (2019-01-29).\n\nSince the IPv6 socket control block and the IPv4 socket control block share\nthe same memory area (skb->cb), the receiving interface index info is lost\n(IP6CB(skb)->iif is set to zero).\n\nAs a side effect, that condition triggers a NULL pointer dereference if\ncommit 0857d6f8c759 (\"ipv6: When forwarding count rx stats on the orig\nnetdev\") is applied.\n\nTo fix that issue, we set the IP6CB(skb)->iif with the index of the\nreceiving interface once again.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0091,"percentile":0.58052,"provenance":"source"},"cwes":[],"references":[{"url":"https://git.kernel.org/stable/c/b16d412e5f79734033df04e97d7ea2f50a8e9fe3","tags":[]},{"url":"https://git.kernel.org/stable/c/6431e71093f3da586a00c6d931481ffb0dc2db0e","tags":[]},{"url":"https://git.kernel.org/stable/c/ef8804e47c0a44ae106ead1740408af5ea6c6ee9","tags":[]},{"url":"https://git.kernel.org/stable/c/666521b3852d2b2f52d570f9122b1e4b50d96831","tags":[]},{"url":"https://git.kernel.org/stable/c/98adb2bbfa407c9290bda299d4c6f7a1c4ebd5e1","tags":[]},{"url":"https://git.kernel.org/stable/c/ae68d93354e5bf5191ee673982251864ea24dd5c","tags":[]}],"priority":{"score":16.9,"factors":[{"name":"EPSS percentile","points":11.61},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= c630ec8bdadae9d557b1ceb9d6c06e149108a0d4, < b16d412e5f79734033df04e97d7ea2f50a8e9fe3",">= 2f704348c93ff8119e642dae6a72327f90b82810, < 6431e71093f3da586a00c6d931481ffb0dc2db0e",">= ef489749aae508e6f17886775c075f12ff919fb1, < ef8804e47c0a44ae106ead1740408af5ea6c6ee9",">= ef489749aae508e6f17886775c075f12ff919fb1, < 666521b3852d2b2f52d570f9122b1e4b50d96831",">= ef489749aae508e6f17886775c075f12ff919fb1, < 98adb2bbfa407c9290bda299d4c6f7a1c4ebd5e1",">= ef489749aae508e6f17886775c075f12ff919fb1, < ae68d93354e5bf5191ee673982251864ea24dd5c","b71b7e0280f47b4ac633fbfd153423814ea87810",">= 4.14.98, < 4.14.258",">= 4.19.20, < 4.19.221",">= 4.20.7, < 4.21"]},{"vendor":"Linux","product":"Linux","versions":["5.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2024-09-10T15:35:33.340330Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2021-34519","exploited":false,"provenance":"source"}}