CVE-2022-49926: net: dsa: Fix possible memory leaks in dsa_loop_init()

Published May 1, 2025
·
Updated

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

net: dsa: Fix possible memory leaks in dsaloopinit()

kmemleak reported memory leaks in dsaloopinit():

kmemleak: 12 new suspected memory leaks

unreferenced object 0xffff8880138ce000 (size 2048): comm "modprobe", pid 390, jiffies 4295040478 (age 238.976s) backtrace: [<000000006a94f1d5>] kmalloctrace+0x26/0x60 [<00000000a9c44622>] phydevicecreate+0x5d/0x970 [<00000000d0ee2afc>] getphydevice+0xf3/0x2b0 [<00000000dca0c71f>] fixedphyregister.part.0+0x92/0x4e0 [<000000008a834798>] fixedphyregister+0x84/0xb0 [<0000000055223fcb>] dsaloopinit+0xa9/0x116 [dsaloop] ...

There are two reasons for memleak in dsaloopinit().

First, fixedphyregister() create and register phydevice:

fixedphyregister() getphydevice() phydevicecreate() # freed by phydevicefree() phydeviceregister() # freed by phydeviceremove()

But fixedphyunregister() only calls phydeviceremove(). So the memory allocated in phydevicecreate() is leaked.

Second, when mdiodriverregister() fail in dsaloopinit(), it just returns and there is no cleanup for phydevs.

Fix the problems by catching the error of mdiodriverregister() in dsaloopinit(), then calling both fixedphyunregister() and phydevicefree() to release phydevs. Also add a function for phydevs cleanup to avoid duplacate.

Affected Software

10 affected components
Linux Foundation Linux Kernel
Linux Linux kernel>=4.12<4.14.299
Linux Linux kernel>=4.15<4.19.265
Linux Linux kernel>=4.20<5.4.224
Linux Linux kernel>=5.5<5.10.154
Linux Linux kernel>=5.11<5.15.78
Linux Linux kernel>=5.16<6.0.8
Linux Linux kernel=6.1-rc1
Linux Linux kernel=6.1-rc2
Linux Linux kernel=6.1-rc3

Event History

May 1, 2025
CVE Published
via MITRE·02:11 PM
Data Sourced
via MITRE·02:11 PM
Description
Data Sourced
via NVD·03:16 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2022-49926?

CVE-2022-49926 has been classified with medium severity due to potential memory leaks in the Linux kernel.

2

How do I fix CVE-2022-49926?

To fix CVE-2022-49926, update your Linux kernel to the latest stable version that includes the patch addressing this vulnerability.

3

What is affected by CVE-2022-49926?

CVE-2022-49926 affects the Linux Kernel, specifically the networking subsystem handling DSA.

4

What kind of vulnerability is CVE-2022-49926?

CVE-2022-49926 is a memory leak vulnerability in the dsa_loop_init() function within the Linux kernel.

5

Is CVE-2022-49926 exploitable?

While CVE-2022-49926 is primarily a memory leak issue, unauthorized access could be exploited in specific conditions depending on the system configuration.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203