{"id":"CVE-2026-23450","aliases":["CVE-2026-23450"],"related":[],"kind":"vulnerability","state":"published","title":"net/smc: fix NULL dereference and UAF in smc_tcp_syn_recv_sock()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet/smc: fix NULL dereference and UAF in smc_tcp_syn_recv_sock()\n\nSyzkaller reported a panic in smc_tcp_syn_recv_sock() [1].\n\nsmc_tcp_syn_recv_sock() is called in the TCP receive path\n(softirq) via icsk_af_ops->syn_recv_sock on the clcsock (TCP\nlistening socket). It reads sk_user_data to get the smc_sock\npointer. However, when the SMC listen socket is being closed\nconcurrently, smc_close_active() sets clcsock->sk_user_data\nto NULL under sk_callback_lock, and then the smc_sock itself\ncan be freed via sock_put() in smc_release().\n\nThis leads to two issues:\n\n1) NULL pointer dereference: sk_user_data is NULL when\n   accessed.\n2) Use-after-free: sk_user_data is read as non-NULL, but the\n   smc_sock is freed before its fields (e.g., queued_smc_hs,\n   ori_af_ops) are accessed.\n\nThe race window looks like this (the syzkaller crash [1]\ntriggers via the SYN cookie path: tcp_get_cookie_sock() ->\nsmc_tcp_syn_recv_sock(), but the normal tcp_check_req() path\nhas the same race):\n\n  CPU A (softirq)              CPU B (process ctx)\n\n  tcp_v4_rcv()\n    TCP_NEW_SYN_RECV:\n    sk = req->rsk_listener\n    sock_hold(sk)\n    /* No lock on listener */\n                               smc_close_active():\n                                 write_lock_bh(cb_lock)\n                                 sk_user_data = NULL\n                                 write_unlock_bh(cb_lock)\n                                 ...\n                                 smc_clcsock_release()\n                                 sock_put(smc->sk) x2\n                                   -> smc_sock freed!\n    tcp_check_req()\n      smc_tcp_syn_recv_sock():\n        smc = user_data(sk)\n          -> NULL or dangling\n        smc->queued_smc_hs\n          -> crash!\n\nNote that the clcsock and smc_sock are two independent objects\nwith separate refcounts. TCP stack holds a reference on the\nclcsock, which keeps it alive, but this does NOT prevent the\nsmc_sock from being freed.\n\nFix this by using RCU and refcount_inc_not_zero() to safely\naccess smc_sock. Since smc_tcp_syn_recv_sock() is called in\nthe TCP three-way handshake path, taking read_lock_bh on\nsk_callback_lock is too heavy and would not survive a SYN\nflood attack. Using rcu_read_lock() is much more lightweight.\n\n- Set SOCK_RCU_FREE on the SMC listen socket so that\n  smc_sock freeing is deferred until after the RCU grace\n  period. This guarantees the memory is still valid when\n  accessed inside rcu_read_lock().\n- Use rcu_read_lock() to protect reading sk_user_data.\n- Use refcount_inc_not_zero(&smc->sk.sk_refcnt) to pin the\n  smc_sock. If the refcount has already reached zero (close\n  path completed), it returns false and we bail out safely.\n\nNote: smc_hs_congested() has a similar lockless read of\nsk_user_data without rcu_read_lock(), but it only checks for\nNULL and accesses the global smc_hs_wq, never dereferencing\nany smc_sock field, so it is not affected.\n\nReproducer was verified with mdelay injection and smc_run,\nthe issue no longer occurs with this patch applied.\n\n[1] https://syzkaller.appspot.com/bug?extid=827ae2bfb3a3529333e9","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet/smc: fix NULL dereference and UAF in smc_tcp_syn_recv_sock()\n\nSyzkaller reported a panic in smc_tcp_syn_recv_sock() [1].\n\nsmc_tcp_syn_recv_sock() is called in the TCP receive path\n(softirq) via icsk_af_ops->syn_recv_sock on the clcsock (TCP\nlistening socket). It reads sk_user_data to get the smc_sock\npointer. However, when the SMC listen socket is being closed\nconcurrently, smc_close_active() sets clcsock->sk_user_data\nto NULL under sk_callback_lock, and then the smc_sock itself\ncan be freed via sock_put() in smc_release().\n\nThis leads to two issues:\n\n1) NULL pointer dereference: sk_user_data is NULL when\n   accessed.\n2) Use-after-free: sk_user_data is read as non-NULL, but the\n   smc_sock is freed before its fields (e.g., queued_smc_hs,\n   ori_af_ops) are accessed.\n\nThe race window looks like this (the syzkaller crash [1]\ntriggers via the SYN cookie path: tcp_get_cookie_sock() ->\nsmc_tcp_syn_recv_sock(), but the normal tcp_check_req() path\nhas the same race):\n\n  CPU A (softirq)              CPU B (process ctx)\n\n  tcp_v4_rcv()\n    TCP_NEW_SYN_RECV:\n    sk = req->rsk_listener\n    sock_hold(sk)\n    /* No lock on listener */\n                               smc_close_active():\n                                 write_lock_bh(cb_lock)\n                                 sk_user_data = NULL\n                                 write_unlock_bh(cb_lock)\n                                 ...\n                                 smc_clcsock_release()\n                                 sock_put(smc->sk) x2\n                                   -> smc_sock freed!\n    tcp_check_req()\n      smc_tcp_syn_recv_sock():\n        smc = user_data(sk)\n          -> NULL or dangling\n        smc->queued_smc_hs\n          -> crash!\n\nNote that the clcsock and smc_sock are two independent objects\nwith separate refcounts. TCP stack holds a reference on the\nclcsock, which keeps it alive, but this does NOT prevent the\nsmc_sock from being freed.\n\nFix this by using RCU and refcount_inc_not_zero() to safely\naccess smc_sock. Since smc_tcp_syn_recv_sock() is called in\nthe TCP three-way handshake path, taking read_lock_bh on\nsk_callback_lock is too heavy and would not survive a SYN\nflood attack. Using rcu_read_lock() is much more lightweight.\n\n- Set SOCK_RCU_FREE on the SMC listen socket so that\n  smc_sock freeing is deferred until after the RCU grace\n  period. This guarantees the memory is still valid when\n  accessed inside rcu_read_lock().\n- Use rcu_read_lock() to protect reading sk_user_data.\n- Use refcount_inc_not_zero(&smc->sk.sk_refcnt) to pin the\n  smc_sock. If the refcount has already reached zero (close\n  path completed), it returns false and we bail out safely.\n\nNote: smc_hs_congested() has a similar lockless read of\nsk_user_data without rcu_read_lock(), but it only checks for\nNULL and accesses the global smc_hs_wq, never dereferencing\nany smc_sock field, so it is not affected.\n\nReproducer was verified with mdelay injection and smc_run,\nthe issue no longer occurs with this patch applied.\n\n[1] https://syzkaller.appspot.com/bug?extid=827ae2bfb3a3529333e9","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nnet/smc: corrige la desreferencia de NULL y el UAF en smc_tcp_syn_recv_sock()\n\nSyzkaller informó un pánico en smc_tcp_syn_recv_sock() [1].\n\nsmc_tcp_syn_recv_sock() se llama en la ruta de recepción TCP (softirq) a través de icsk_af_ops -> syn_recv_sock en el clcsock (socket de escucha TCP). Lee sk_user_data para obtener el puntero smc_sock. Sin embargo, cuando el socket de escucha SMC se está cerrando concurrentemente, smc_close_active() establece clcsock -> sk_user_data en NULL bajo sk_callback_lock, y luego el propio smc_sock puede ser liberado a través de sock_put() en smc_release().\n\nEsto lleva a dos problemas:\n\n1) Desreferencia de puntero NULL: sk_user_data es NULL cuando se accede.\n2) Uso después de liberación: sk_user_data se lee como no-NULL, pero el smc_sock es liberado antes de que se acceda a sus campos (por ejemplo, queued_smc_hs, ori_af_ops).\n\nLa ventana de carrera se ve así (el fallo de syzkaller [1] se activa a través de la ruta de la cookie SYN: tcp_get_cookie_sock()  ->  smc_tcp_syn_recv_sock(), pero la ruta normal de tcp_check_req() tiene la misma carrera):\n\n  CPU A (softirq)              CPU B (contexto de proceso)\n\n  tcp_v4_rcv()\n    TCP_NEW_SYN_RECV:\n    sk = req -> rsk_listener\n    sock_hold(sk)\n    /* Sin bloqueo en el oyente */\n                               smc_close_active():\n                                 write_lock_bh(cb_lock)\n                                 sk_user_data = NULL\n                                 write_unlock_bh(cb_lock)\n                                 ...\n                                 smc_clcsock_release()\n                                 sock_put(smc -> sk) x2\n                                    ->  ¡smc_sock liberado!\n    tcp_check_req()\n      smc_tcp_syn_recv_sock():\n        smc = user_data(sk)\n           ->  NULL o colgante\n        smc -> queued_smc_hs\n           ->  ¡fallo!\n\nTenga en cuenta que el clcsock y el smc_sock son dos objetos independientes con recuentos de referencia separados. La pila TCP mantiene una referencia en el clcsock, lo que lo mantiene vivo, pero esto NO evita que el smc_sock sea liberado.\n\nSolucione esto utilizando RCU y refcount_inc_not_zero() para acceder de forma segura a smc_sock. Dado que smc_tcp_syn_recv_sock() se llama en la ruta del handshake de tres vías de TCP, tomar read_lock_bh en sk_callback_lock es demasiado pesado y no sobreviviría a un ataque de inundación SYN. Usar rcu_read_lock() es mucho más ligero.\n\n- Establezca SOCK_RCU_FREE en el socket de escucha SMC para que la liberación de smc_sock se posponga hasta después del período de gracia de RCU. Esto garantiza que la memoria sigue siendo válida cuando se accede dentro de rcu_read_lock().\n- Use rcu_read_lock() para proteger la lectura de sk_user_data.\n- Use refcount_inc_not_zero(&smc -> sk.sk_refcnt) para fijar el smc_sock. Si el recuento de referencias ya ha llegado a cero (ruta de cierre completada), devuelve falso y salimos de forma segura.\n\nNota: smc_hs_congested() tiene una lectura similar sin bloqueo de sk_user_data sin rcu_read_lock(), pero solo verifica si es NULL y accede al smc_hs_wq global, nunca desreferenciando ningún campo de smc_sock, por lo que no se ve afectado.\n\nEl reproductor fue verificado con inyección de mdelay y smc_run, el problema ya no ocurre con este parche aplicado.\n\n[1] https://syzkaller.appspot.com/bug?extid=827ae2bfb3a3529333e9","source":"nvd"}],"published":"2026-04-03T15:15:33.144Z","modified":"2026-11-10T13:18:46.850Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-362","CWE-416"],"affected":[{"ranges":[{"type":"git","introduced":"ebfee3e153f67c8b38eb94a7062ee94aa6f92708","fixed":"f315277856caeafcd996c2611afc085ca2d53275","status":"affected"},{"type":"git","introduced":"8270d9c21041470f58348248b9d9dcf3bf79592e","fixed":"1e4f873879e075bbd4eb1c644d6933303ac5eba4","status":"affected"},{"type":"git","introduced":"8270d9c21041470f58348248b9d9dcf3bf79592e","fixed":"f00fc26c8a06442b225a350fe000c0a11483e6a3","status":"affected"},{"type":"git","introduced":"8270d9c21041470f58348248b9d9dcf3bf79592e","fixed":"cadf3da46c15523fba90d80c9955f536ee3b4023","status":"affected"},{"type":"git","introduced":"8270d9c21041470f58348248b9d9dcf3bf79592e","fixed":"fd7579f0a2c84ba8a7d4f206201b50dc8ddf90c2","status":"affected"},{"type":"git","introduced":"8270d9c21041470f58348248b9d9dcf3bf79592e","fixed":"1fab5ece76fb42a761178dcd0ebcbf578377b0dd","status":"affected"},{"type":"git","introduced":"8270d9c21041470f58348248b9d9dcf3bf79592e","fixed":"6d5e4538364b9ceb1ac2941a4deb86650afb3538","status":"affected"},{"type":"semver","introduced":"5.15.174","fixed":"5.15.203","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.18","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.18","status":"unaffected"},{"type":"semver","introduced":"5.15.203","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.167","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.130","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.78","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.20","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"6.19.10","lastAffected":"6.19.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.0","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"5.15.174","fixed":"5.15.203"},{"status":"affected","introduced":"5.18","fixed":"6.1.167"},{"status":"affected","introduced":"6.2","fixed":"6.6.130"},{"status":"affected","introduced":"6.7","fixed":"6.12.78"},{"status":"affected","introduced":"6.13","fixed":"6.18.20"},{"status":"affected","introduced":"6.19","fixed":"6.19.10"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/f315277856caeafcd996c2611afc085ca2d53275","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/1e4f873879e075bbd4eb1c644d6933303ac5eba4","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f00fc26c8a06442b225a350fe000c0a11483e6a3","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/cadf3da46c15523fba90d80c9955f536ee3b4023","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/fd7579f0a2c84ba8a7d4f206201b50dc8ddf90c2","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/1fab5ece76fb42a761178dcd0ebcbf578377b0dd","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6d5e4538364b9ceb1ac2941a4deb86650afb3538","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-082556.html","tags":[],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-019113.html","tags":[],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-457936.html","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2026-10-16T15:08:20.612Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-23450","url":"https://www.cve.org/CVERecord?id=CVE-2026-23450","licence":"CVE Terms of Use","modified":"2026-11-10T12:43:20.243Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-23450","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-23450","licence":"Public domain","modified":"2026-11-10T13:18:46.850Z"}],"updatedAt":"2026-11-25T22:59:17.883Z","epss":{"score":0.00604,"percentile":0.50279,"date":"2026-12-01T12:00:22.000Z"}}