CVE-2024-50059
JSON

7.8high

ntb: ntb_hw_switchtec: Fix use after free vulnerability in switchtec_ntb_remove due to race condition

Severity
7.8high CVSS:3.1 by Linux
Exploit likelihood
0.23% (higher than 15% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

Description

In the Linux kernel, the following vulnerability has been resolved: ntb: ntb_hw_switchtec: Fix use after free vulnerability in switchtec_ntb_remove due to race condition In the switchtec_ntb_add function, it can call switchtec_ntb_init_sndev function, then &sndev->check_link_status_work is bound with check_link_status_work. switchtec_ntb_link_notification may be called to start the work. If we remove the module which will call switchtec_ntb_remove to make cleanup, it will free sndev through kfree(sndev), while the work mentioned above will be used. The sequence of operations that may lead to a UAF bug is as follows: CPU0 CPU1 | check_link_status_work switchtec_ntb_remove | kfree(sndev); | | if (sndev->link_force_down) | // use sndev Fix it by ensuring that the work is canceled before proceeding with the cleanup in switchtec_ntb_remove.

Affected

Product or packageVersionsReported by
Linux Linuxfrom d04be142b8b61ffb3c9cc5c6d1abda8fc59a16c9 before 5126d8f5567f49b52e21fca320eaa97977055099, from d04be142b8b61ffb3c9cc5c6d1abda8fc59a16c9 before b650189687822b705711f0567a65a164a314d8df, from d04be142b8b61ffb3c9cc5c6d1abda8fc59a16c9 before 92728fceefdaa2a0a3aae675f86193b006eeaa43, from d04be142b8b61ffb3c9cc5c6d1abda8fc59a16c9 before 3ae45be8492460a35b5aebf6acac1f1d32708946, from d04be142b8b61ffb3c9cc5c6d1abda8fc59a16c9 before fa840ba4bd9f3bad7f104e5b32028ee73af8b3dd, from d04be142b8b61ffb3c9cc5c6d1abda8fc59a16c9 before 177925d9c8715a897bb79eca62628862213ba956, from d04be142b8b61ffb3c9cc5c6d1abda8fc59a16c9 before e51aded92d42784313ba16c12f4f88cc4f973bbb, 4.16
Not affected: before 4.16, from 5.4.285 up to 5.4.*, from 5.10.227 up to 5.10.*, from 5.15.168 up to 5.15.*, from 6.1.113 up to 6.1.*, from 6.6.57 up to 6.6.*
CVE List
linux linux_kernelbefore 5.10.227, from 5.11 before 5.15.168, from 5.16 before 6.1.113, from 6.2 before 6.6.57, from 6.7 before 6.11.4NVD

All scores

Linux7.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
NVD7.0high CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-416

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

In the Linux kernel, the following vulnerability has been resolved: ntb: ntb_hw_switchtec: Fix use after free vulnerability in switchtec_ntb_remove due to race condition In the switchtec_ntb_add function, it can call switchtec_ntb_init_sndev function, then &sndev->check_link_status_work is bound with check_link_status_work. switchtec_ntb_link_notification may be called to start the work. If we remove the module which will call switchtec_ntb_remove to make cleanup, it will free sndev through kfree(sndev), while the work mentioned above will be used. The sequence of operations that may lead to a UAF bug is as follows: CPU0 CPU1 | check_link_status_work switchtec_ntb_remove | kfree(sndev); | | if (sndev->link_force_down) | // use sndev Fix it by ensuring that the work is canceled before proceeding with the cleanup in switchtec_ntb_remove.

NVD (es)

En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: ntb: ntb_hw_switchtec: Se corrige la vulnerabilidad de use after free en switchtec_ntb_remove debido a la condición de ejecución En la función switchtec_ntb_add, puede llamar a la función switchtec_ntb_init_sndev, luego &sndev->check_link_status_work se vincula con check_link_status_work. Se puede llamar a switchtec_ntb_link_notification para iniciar el trabajo. Si eliminamos el módulo que llamará a switchtec_ntb_remove para realizar la limpieza, liberará sndev a través de kfree(sndev), mientras que se utilizará el trabajo mencionado anteriormente. La secuencia de operaciones que puede llevar a un error de UAF es la siguiente: CPU0 CPU1 | check_link_status_work switchtec_ntb_remove | kfree(sndev); | | if (sndev->link_force_down) | // use sndev Arréglelo asegurándose de que el trabajo se cancele antes de continuar con la limpieza en switchtec_ntb_remove.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-50059 changed 2026-08-05CVE Terms of Use
NVDCVE-2024-50059 changed 2026-08-04Public domain