# CVE-2022-50310: ip6mr: fix UAF issue in ip6mr_sk_done() when addrconf_init_net() failed

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.17%, higher than 6% of CVEs (2026-12-01)
- Published: 2025-09-15T14:46:05.486Z
- Modified: 2026-11-23T08:17:09.463Z
- Weaknesses: CWE-416
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

ip6mr: fix UAF issue in ip6mr_sk_done() when addrconf_init_net() failed

If the initialization fails in calling addrconf_init_net(), devconf_all is
the pointer that has been released. Then ip6mr_sk_done() is called to
release the net, accessing devconf->mc_forwarding directly causes invalid
pointer access.

The process is as follows:
setup_net()
	ops_init()
		addrconf_init_net()
		all = kmemdup(...)           ---> alloc "all"
		...
		net->ipv6.devconf_all = all;
		__addrconf_sysctl_register() ---> failed
		...
		kfree(all);                  ---> ipv6.devconf_all invalid
		...
	ops_exit_list()
		...
		ip6mr_sk_done()
			devconf = net->ipv6.devconf_all;
			//devconf is invalid pointer
			if (!devconf || !atomic_read(&devconf->mc_forwarding))

The following is the Call Trace information:
BUG: KASAN: use-after-free in ip6mr_sk_done+0x112/0x3a0
Read of size 4 at addr ffff888075508e88 by task ip/14554
Call Trace:
<TASK>
dump_stack_lvl+0x8e/0xd1
print_report+0x155/0x454
kasan_report+0xba/0x1f0
kasan_check_range+0x35/0x1b0
ip6mr_sk_done+0x112/0x3a0
rawv6_close+0x48/0x70
inet_release+0x109/0x230
inet6_release+0x4c/0x70
sock_release+0x87/0x1b0
igmp6_net_exit+0x6b/0x170
ops_exit_list+0xb0/0x170
setup_net+0x7ac/0xbd0
copy_net_ns+0x2e6/0x6b0
create_new_namespaces+0x382/0xa50
unshare_nsproxy_namespaces+0xa6/0x1c0
ksys_unshare+0x3a4/0x7e0
__x64_sys_unshare+0x2d/0x40
do_syscall_64+0x35/0x80
entry_SYSCALL_64_after_hwframe+0x46/0xb0
RIP: 0033:0x7f7963322547

</TASK>
Allocated by task 14554:
kasan_save_stack+0x1e/0x40
kasan_set_track+0x21/0x30
__kasan_kmalloc+0xa1/0xb0
__kmalloc_node_track_caller+0x4a/0xb0
kmemdup+0x28/0x60
addrconf_init_net+0x1be/0x840
ops_init+0xa5/0x410
setup_net+0x5aa/0xbd0
copy_net_ns+0x2e6/0x6b0
create_new_namespaces+0x382/0xa50
unshare_nsproxy_namespaces+0xa6/0x1c0
ksys_unshare+0x3a4/0x7e0
__x64_sys_unshare+0x2d/0x40
do_syscall_64+0x35/0x80
entry_SYSCALL_64_after_hwframe+0x46/0xb0

Freed by task 14554:
kasan_save_stack+0x1e/0x40
kasan_set_track+0x21/0x30
kasan_save_free_info+0x2a/0x40
____kasan_slab_free+0x155/0x1b0
slab_free_freelist_hook+0x11b/0x220
__kmem_cache_free+0xa4/0x360
addrconf_init_net+0x623/0x840
ops_init+0xa5/0x410
setup_net+0x5aa/0xbd0
copy_net_ns+0x2e6/0x6b0
create_new_namespaces+0x382/0xa50
unshare_nsproxy_namespaces+0xa6/0x1c0
ksys_unshare+0x3a4/0x7e0
__x64_sys_unshare+0x2d/0x40
do_syscall_64+0x35/0x80
entry_SYSCALL_64_after_hwframe+0x46/0xb0

(As written by CVE List.)

## Affected

- Linux Linux: from 75561afeb9ca9f442021fdfe2c9d10482585ccf3 before 7cd0f52ee4813854cad75775b78476b32f679abb; from 60a319d4606bb505a5f9f2e26983f157b0c908dc before 339f3a03547ac65efe828168c7b94f25bf030ef1; from 7d9b1b578d67a14ae7a7a526ee115b233fa264c4 before 22a68c3b9362eaac7b035eba09e95e6b3f7a912c; from 7d9b1b578d67a14ae7a7a526ee115b233fa264c4 before 1ca695207ed2271ecbf8ee6c641970f621c157cc; 5.18 (not affected: before 5.18; from 6.0.6 up to 6.0.*; from 6.1 up to *)
- linux linux_kernel: from 5.18 before 6.0.6; 6.1

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://git.kernel.org/stable/c/7cd0f52ee4813854cad75775b78476b32f679abb>
- <https://git.kernel.org/stable/c/339f3a03547ac65efe828168c7b94f25bf030ef1>
- <https://git.kernel.org/stable/c/22a68c3b9362eaac7b035eba09e95e6b3f7a912c> (patch)
- <https://git.kernel.org/stable/c/1ca695207ed2271ecbf8ee6c641970f621c157cc> (patch)

## Sources

- CVE List: [CVE-2022-50310](https://www.cve.org/CVERecord?id=CVE-2022-50310), CVE Terms of Use, modified 2026-11-23
- NVD: [CVE-2022-50310](https://nvd.nist.gov/vuln/detail/CVE-2022-50310), Public domain, modified 2026-11-23

---

Page: https://cve.day/CVE-2022-50310 · Whole record: https://cve.day/CVE-2022-50310.json · Rebuilt by cve.day 2026-11-25T22:58:21.158Z
