CVE-2022-50459

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

MEDIUM
5.5
CVSS Score
Published: October 1, 2025 at 11:45 AM UTC
Updated: August 5, 2026 at 09:24 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.5
Exploit prediction
EPSS 0.2%

Description

In the Linux kernel, the following vulnerability has been resolved: scsi: iscsi: iscsi_tcp: 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. iscsi_sw_tcp_conn_get_param() and iscsi_sw_tcp_host_get_param() take the frwd_lock and do sock_hold() then drop the frwd_lock. sock_hold() does a get on the "struct sock". 2. iscsi_sw_tcp_release_conn() does sockfd_put() which does the last put on the "struct socket" and that does __sock_release() which sets the sock->ops to NULL. 3. iscsi_sw_tcp_conn_get_param() and iscsi_sw_tcp_host_get_param() then call kernel_getpeername() 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 frwd_lock the entire time but in commit bcf3a2953d36 ("scsi: iscsi: iscsi_tcp: 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 frwd_lock. Instead of trying to maintain multiple refcounts, this just has us use a mutex for accessing the socket in the interface code paths.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v ≥ 5.8.145.11 ≤ v < 5.15.755.16 ≤ v < 5.19.175.8.14 ≤ v < 5.95.9 ≤ v < 5.10.1505.9 ≤ v < 5.15.755.9 ≤ v < 5.19.175.9 ≤ v < 6.0.35.9 ≤ v < 6.15.9.1 ≤ v < 5.10.1506.0 ≤ v < 6.0.35.8.145.95.9 rc87d29e950766327f658cb92722b9445ac3b3ae023bcf3a2953d36bbfb9bd44ccb3db0897d935cc485
Vendor states this is fixed in 0a0b861fce2657ba08ec356a74346b37ca4b2008 (fixed)
Vendor states this is fixed in 57569c37f0add1b6489e1a1563c71519daf732cf (fixed)
Vendor states this is fixed in 884a788f065578bb640382279a83d1df433b13e6 (fixed)
Vendor states this is fixed in 897dbbc57d71e8a34ec1af8e573a142de457da38 (fixed)
Vendor states this is fixed in a26b0658751bb0a3b28386fca715333b104d32a2 (fixed)
Vendor states this is fixed in 5.10.150 (unaffected)
Vendor states this is fixed in 5.15.75 (unaffected)
Vendor states this is fixed in 5.19.17 (unaffected)
Vendor states this is fixed in 5.9 (unaffected)
Vendor states this is fixed in 6.0.3 (unaffected)
Vendor states this is fixed in 6.1 (unaffected)

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-476

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card