{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2022-50459","id":"CVE-2022-50459","title":"scsi: iscsi: iscsi_tcp: Fix null-ptr-deref while calling getpeername()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nscsi: iscsi: iscsi_tcp: Fix null-ptr-deref while calling getpeername()\n\nFix a NULL pointer crash that occurs when we are freeing the socket at the\nsame time we access it via sysfs.\n\nThe problem is that:\n\n 1. iscsi_sw_tcp_conn_get_param() and iscsi_sw_tcp_host_get_param() take\n    the frwd_lock and do sock_hold() then drop the frw","descriptionLong":"In the Linux kernel, the following vulnerability has been resolved:\n\nscsi: iscsi: iscsi_tcp: Fix null-ptr-deref while calling getpeername()\n\nFix a NULL pointer crash that occurs when we are freeing the socket at the\nsame time we access it via sysfs.\n\nThe problem is that:\n\n 1. iscsi_sw_tcp_conn_get_param() and iscsi_sw_tcp_host_get_param() take\n    the frwd_lock and do sock_hold() then drop the frwd_lock. sock_hold()\n    does a get on the \"struct sock\".\n\n 2. iscsi_sw_tcp_release_conn() does sockfd_put() which does the last put\n    on the \"struct socket\" and that does __sock_release() which sets the\n    sock->ops to NULL.\n\n 3. iscsi_sw_tcp_conn_get_param() and iscsi_sw_tcp_host_get_param() then\n    call kernel_getpeername() which accesses the NULL sock->ops.\n\nAbove we do a get on the \"struct sock\", but we needed a get on the \"struct\nsocket\". Originally, we just held the frwd_lock the entire time but in\ncommit bcf3a2953d36 (\"scsi: iscsi: iscsi_tcp: Avoid holding spinlock while\ncalling getpeername()\") we switched to refcount based because the network\nlayer changed and started taking a mutex in that path, so we could no\nlonger hold the frwd_lock.\n\nInstead of trying to maintain multiple refcounts, this just has us use a\nmutex for accessing the socket in the interface code paths.","published":"2025-10-01T11:45:31.740Z","updated":"2026-11-17T07:01:32.834167007Z","reserved":"2025-10-01T11:38:45.640Z","status":"Modified","rejected":false,"assigner":"Linux","metric":{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"Linux"},"metrics":[{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"Linux"},{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"NVD"},{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"OSV"}],"rating":"high","products":["Linux"],"affectedProducts":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"bcf3a2953d36bbfb9bd44ccb3db0897d935cc485","lessThan":"884a788f065578bb640382279a83d1df433b13e6","status":"affected","versionType":"git"},{"version":"bcf3a2953d36bbfb9bd44ccb3db0897d935cc485","lessThan":"a26b0658751bb0a3b28386fca715333b104d32a2","status":"affected","versionType":"git"},{"version":"bcf3a2953d36bbfb9bd44ccb3db0897d935cc485","lessThan":"897dbbc57d71e8a34ec1af8e573a142de457da38","status":"affected","versionType":"git"},{"version":"bcf3a2953d36bbfb9bd44ccb3db0897d935cc485","lessThan":"0a0b861fce2657ba08ec356a74346b37ca4b2008","status":"affected","versionType":"git"},{"version":"bcf3a2953d36bbfb9bd44ccb3db0897d935cc485","lessThan":"57569c37f0add1b6489e1a1563c71519daf732cf","status":"affected","versionType":"git"},{"version":"7d29e950766327f658cb92722b9445ac3b3ae023","status":"affected","versionType":"git"},{"version":"5.8.14","lessThan":"5.9","status":"affected","versionType":"semver"}],"platforms":[]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.9","status":"affected"},{"version":"0","lessThan":"5.9","status":"unaffected","versionType":"semver"},{"version":"5.10.150","lessThanOrEqual":"5.10.*","status":"unaffected","versionType":"semver"},{"version":"5.15.75","lessThanOrEqual":"5.15.*","status":"unaffected","versionType":"semver"},{"version":"5.19.17","lessThanOrEqual":"5.19.*","status":"unaffected","versionType":"semver"},{"version":"6.0.3","lessThanOrEqual":"6.0.*","status":"unaffected","versionType":"semver"},{"version":"6.1","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}],"platforms":[]}],"packages":[],"cwes":["CWE-476"],"aliases":[],"references":[{"url":"https://git.kernel.org/stable/c/884a788f065578bb640382279a83d1df433b13e6","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/a26b0658751bb0a3b28386fca715333b104d32a2","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/897dbbc57d71e8a34ec1af8e573a142de457da38","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/0a0b861fce2657ba08ec356a74346b37ca4b2008","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/57569c37f0add1b6489e1a1563c71519daf732cf","tags":["Patch","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50459.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50459","tags":["advisory"]},{"url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":null,"epss":0.0018,"epssPercentile":0.07668,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2022-50459","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50459","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2022-50459","ok":true,"note":"0 packages"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2022-50459","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}