CVE-2022-50459: scsi: iscsi: iscsi_tcp: Fix null-ptr-deref while calling getpeername()

Published Oct 1, 2025
·
Updated

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

scsi: iscsi: iscsitcp: Fix null-ptr-deref while calling getpeername()

Fix a NULL pointer crash that occurs when we are freeing the socket at the same time we access it via sysfs.

The problem is that:

1. iscsiswtcpconngetparam() and iscsiswtcphostgetparam() take the frwdlock and do sockhold() then drop the frwdlock. sockhold() does a get on the "struct sock".

2. iscsiswtcpreleaseconn() does sockfdput() which does the last put on the "struct socket" and that does sockrelease() which sets the sock->ops to NULL.

3. iscsiswtcpconngetparam() and iscsiswtcphostgetparam() then call kernelgetpeername() which accesses the NULL sock->ops.

Above we do a get on the "struct sock", but we needed a get on the "struct socket". Originally, we just held the frwdlock the entire time but in commit bcf3a2953d36 ("scsi: iscsi: iscsitcp: Avoid holding spinlock while calling getpeername()") we switched to refcount based because the network layer changed and started taking a mutex in that path, so we could no longer hold the frwdlock.

Instead of trying to maintain multiple refcounts, this just has us use a mutex for accessing the socket in the interface code paths.

Affected Software

8 affected components
Linux Linux kernel
Linux Linux kernel>=5.8.14<5.9
Linux Linux kernel>=5.9.1<5.10.150
Linux Linux kernel>=5.11<5.15.75
Linux Linux kernel>=5.16<5.19.17
Linux Linux kernel>=6.0<6.0.3
Linux Linux kernel=5.9
Linux Linux kernel=5.9-rc8

Event History

Oct 1, 2025
CVE Published
via MITRE·11:45 AM
Data Sourced
via MITRE·11:45 AM
DescriptionSeverity
Data Sourced
via NVD·12:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Nov 25, 58560
Event
via MITRE·12:10 AM

Frequently Asked Questions

1

What is the severity of CVE-2022-50459?

CVE-2022-50459 has a medium severity rating due to its potential to cause a system crash.

2

How do I fix CVE-2022-50459?

To fix CVE-2022-50459, upgrade to the latest version of the Linux kernel that includes the patch addressing this vulnerability.

3

What causes CVE-2022-50459?

CVE-2022-50459 is caused by a NULL pointer dereference when accessing the socket via sysfs while it is being freed.

4

Which versions of the Linux kernel are affected by CVE-2022-50459?

CVE-2022-50459 affects specific versions of the Linux kernel prior to the release of the fix.

5

Can CVE-2022-50459 be exploited remotely?

CVE-2022-50459 can potentially be exploited remotely under certain configurations, making it a significant security concern.

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