CVE-2021-47238 json
net: ipv4: fix memory leak in ip_mc_add1_src
published 2024-05-21 2 y ago modified 2026-06-17 4 mo ago also EUVD-2021-33886
- cvss
- 5.5
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.2%
- EPSS 0.2% chance of exploitation in 30 days, percentile 14%
- public exploits
- 0
- none known
Summary
In the Linux kernel, the following vulnerability has been resolved:
net: ipv4: fix memory leak in ip_mc_add1_src
BUG: memory leak unreferenced object 0xffff888101bc4c00 (size 32): comm "syz-executor527", pid 360, jiffies 4294807421 (age 19.329s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 01 00 00 00 00 00 00 00 ac 14 14 bb 00 00 02 00 ................ backtrace: [<00000000f17c5244>] kmalloc include/linux/slab.h:558 [inline] [<00000000f17c5244>] kzalloc include/linux/slab.h:688 [inline] [<00000000f17c5244>] ip_mc_add1_src net/ipv4/igmp.c:1971 [inline] [<00000000f17c5244>] ip_mc_add_src+0x95f/0xdb0 net/ipv4/igmp.c:2095 [<000000001cb99709>] ip_mc_source+0x84c/0xea0 net/ipv4/igmp.c:2416 [<0000000052cf19ed>] do_ip_setsockopt net/ipv4/ip_sockglue.c:1294 [inline] [<0000000052cf19ed>] ip_setsockopt+0x114b/0x30c0 net/ipv4/ip_sockglue.c:1423 [<00000000477edfbc>] raw_setsockopt+0x13d/0x170 net/ipv4/raw.c:857 [<00000000e75ca9bb>] __sys_setsockopt+0x158/0x270 net/socket.c:2117 [<00000000bdb993a8>] __do_sys_setsockopt net/socket.c:2128 [inline] [<00000000bdb993a8>] __se_sys_setsockopt net/socket.c:2125 [inline] [<00000000bdb993a8>] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2125 [<000000006a1ffdbd>] do_syscall_64+0x40/0x80 arch/x86/entry/common.c:47 [<00000000b11467c4>] entry_SYSCALL_64_after_hwframe+0x44/0xae
In commit 24803f38a5c0 ("igmp: do not remove igmp souce list info when set link down"), the ip_mc_clear_src() in ip_mc_destroy_dev() was removed, because it was also called in igmpv3_clear_delrec().
Rough callgraph:
inetdev_destroy -> ip_mc_destroy_dev -> igmpv3_clear_delrec -> ip_mc_clear_src -> RCU_INIT_POINTER(dev->ip_ptr, NULL)
However, ip_mc_clear_src() called in igmpv3_clear_delrec() doesn't release in_dev->mc_list->sources. And RCU_INIT_POINTER() assigns the NULL to dev->ip_ptr. As a result, in_dev cannot be obtained through inetdev_by_index() and then in_dev->mc_list->sources cannot be released by ip_mc_del1_src() in the sock_close. Rough call sequence goes like:
sock_close -> __sock_release -> inet_release -> ip_mc_drop_socket -> inetdev_by_index -> ip_mc_leave_src -> ip_mc_del_src -> ip_mc_del1_src
So we still need to call ip_mc_clear_src() in ip_mc_destroy_dev() to free in_dev->mc_list->sources.
Patch / fix
- Linux Linux 3.3, 3.17, 4.9.274, 4.14.238, 4.19.196, 5.4.128, 5.10.46, 5.12.13, 5.13
- linux linux_kernel 0dc13e75507f, 1e28018b5c83, 3dd2aeac2e96, 6cff57eea334, 77de6ee73f54, ac31cc837caf, d8e2973029b8
- linux Debian 14, Debian 13, Debian 12 5.10.46-1
debian advisories DEBIAN-CVE-2021-47238
- linux Ubuntu 18.04 LTS 4.15.0-156.163
- linux Ubuntu 20.04 LTS 5.4.0-81.91
- linux-aws Ubuntu 18.04 LTS 4.15.0-1111.118
- linux-aws Ubuntu 20.04 LTS 5.4.0-1055.58
- linux-gcp Ubuntu 20.04 LTS 5.4.0-1051.55
- linux-kvm Ubuntu 18.04 LTS 4.15.0-1099.101
- linux-kvm Ubuntu 20.04 LTS 5.4.0-1045.47
- linux-azure Ubuntu 20.04 LTS 5.4.0-1056.58
ubuntu advisories UBUNTU-CVE-2021-47238
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- kernel-syms SLES for SAP 12 SP5, SLES 12 SP5 4.12.14-122.219.1
- kernel-source SLES for SAP 12 SP5, SLES 12 SP5 4.12.14-122.219.1
- kernel-default SLES for SAP 12 SP5, SLES 12 SP5, SLE Workstation Extension 12 SP5 +2 more 4.12.14-122.219.1
- kernel-obs-build SLE Software Development Kit 12 SP5 4.12.14-122.219.1
- kernel-rt SLE Real Time 12 SP5 4.12.14-10.188.1
- kernel-syms-rt SLE Real Time 12 SP5 4.12.14-10.188.1
- kernel-rt_debug SLE Real Time 12 SP5 4.12.14-10.188.1
- kernel-source-rt SLE Real Time 12 SP5 4.12.14-10.188.1
suse advisories SUSE-SU-2024:2184-1SUSE-SU-2024:1983-1SUSE-SU-2024:1979-1
- git.kernel.org/stable/c/0dc13e75507faa17ac9f7562b4ef7bf8fcd78422 commit
- git.kernel.org/stable/c/6cff57eea3347f79f1867cc53e1093b6614138d8 commit
- git.kernel.org/stable/c/1e28018b5c83d5073f74a6fb72eabe8370b2f501 commit
- git.kernel.org/stable/c/3dd2aeac2e9624cff9fa634710837e4f2e352758 commit
- git.kernel.org/stable/c/ac31cc837cafb57a271babad8ccffbf733caa076 commit
- git.kernel.org/stable/c/77de6ee73f54a9a89c0afa0bf4c53b239aa9953a commit
- git.kernel.org/stable/c/d8e2973029b8b2ce477b564824431f3385c77083 commit
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2021-47238 updated cvss 5.3
kernel: net: ipv4: fix memory leak in ip_mc_add1_src
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 more Red Hat Enterprise Linux 8 kernel-rt, kernel-rt-kvm, kernel-rt-core, kernel-rt-modules, kernel-rt-debug-kvm, kernel-rt-debug-core, +6 moreaffected: workaround, no fix planned “Red Hat has investigated whether a possible mitigation exists for this issue, and has not been able to identify a practical example. Please update the affected package as soon as possible.”
-
Red Hat Enterprise Linux 9 kernel-rt, kernel-rt-selftests-internalaffected: workaround, no fix available “Red Hat has investigated whether a possible mitigation exists for this issue, and has not been able to identify a practical example. Please update the affected package as soon as possible.”
-
Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-core, kernel-tools, python3-perf, +17 more Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +82 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 18 mo ago
Exploit prediction
0.24% chance of exploitation in the next 30 days, higher than 14% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CISA ADP | 3.1 | 5.5 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| CNA | 3.1 | 5.5 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
Affected products
- Linux Linux
- linux linux_kernel
Classification
- Weakness
-
- CWE-400 Uncontrolled Resource Consumption
- Technology feeds
References
-
git.kernel.org
/stable/c/0dc13e75507faa17ac9f7562b4ef7bf8fcd78422
patch
-
git.kernel.org
/stable/c/6cff57eea3347f79f1867cc53e1093b6614138d8
patch
-
git.kernel.org
/stable/c/1e28018b5c83d5073f74a6fb72eabe8370b2f501
patch
-
git.kernel.org
/stable/c/3dd2aeac2e9624cff9fa634710837e4f2e352758
patch
-
git.kernel.org
/stable/c/ac31cc837cafb57a271babad8ccffbf733caa076
patch
-
git.kernel.org
/stable/c/77de6ee73f54a9a89c0afa0bf4c53b239aa9953a
patch
-
git.kernel.org
/stable/c/d8e2973029b8b2ce477b564824431f3385c77083
patch
Sources
- CVE List CVE-2021-47238
- NVD CVE-2021-47238
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.