{"id":"CVE-2024-49940","aliases":["CVE-2024-49940"],"related":[],"kind":"vulnerability","state":"published","title":"l2tp: prevent possible tunnel refcount underflow","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nl2tp: prevent possible tunnel refcount underflow\n\nWhen a session is created, it sets a backpointer to its tunnel. When\nthe session refcount drops to 0, l2tp_session_free drops the tunnel\nrefcount if session->tunnel is non-NULL. However, session->tunnel is\nset in l2tp_session_create, before the tunnel refcount is incremented\nby l2tp_session_register, which leaves a small window where\nsession->tunnel is non-NULL when the tunnel refcount hasn't been\nbumped.\n\nMoving the assignment to l2tp_session_register is trivial but\nl2tp_session_create calls l2tp_session_set_header_len which uses\nsession->tunnel to get the tunnel's encap. Add an encap arg to\nl2tp_session_set_header_len to avoid using session->tunnel.\n\nIf l2tpv3 sessions have colliding IDs, it is possible for\nl2tp_v3_session_get to race with l2tp_session_register and fetch a\nsession which doesn't yet have session->tunnel set. Add a check for\nthis case.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nl2tp: prevent possible tunnel refcount underflow\n\nWhen a session is created, it sets a backpointer to its tunnel. When\nthe session refcount drops to 0, l2tp_session_free drops the tunnel\nrefcount if session->tunnel is non-NULL. However, session->tunnel is\nset in l2tp_session_create, before the tunnel refcount is incremented\nby l2tp_session_register, which leaves a small window where\nsession->tunnel is non-NULL when the tunnel refcount hasn't been\nbumped.\n\nMoving the assignment to l2tp_session_register is trivial but\nl2tp_session_create calls l2tp_session_set_header_len which uses\nsession->tunnel to get the tunnel's encap. Add an encap arg to\nl2tp_session_set_header_len to avoid using session->tunnel.\n\nIf l2tpv3 sessions have colliding IDs, it is possible for\nl2tp_v3_session_get to race with l2tp_session_register and fetch a\nsession which doesn't yet have session->tunnel set. Add a check for\nthis case.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: l2tp: evitar un posible desbordamiento del recuento de referencias del túnel Cuando se crea una sesión, establece un puntero hacia atrás a su túnel. Cuando el recuento de referencias de la sesión cae a 0, l2tp_session_free descarta el recuento de referencias del túnel si session-&gt;tunnel no es NULL. Sin embargo, session-&gt;tunnel se establece en l2tp_session_create, antes de que el recuento de referencias del túnel se incremente mediante l2tp_session_register, lo que deja una pequeña ventana donde session-&gt;tunnel no es NULL cuando el recuento de referencias del túnel no se ha incrementado. Mover la asignación a l2tp_session_register es trivial, pero l2tp_session_create llama a l2tp_session_set_header_len, que usa session-&gt;tunnel para obtener el encap del túnel. Agregue un argumento de encap a l2tp_session_set_header_len para evitar usar session-&gt;tunnel. Si las sesiones l2tpv3 tienen identificadores en conflicto, es posible que l2tp_v3_session_get compita con l2tp_session_register y obtenga una sesión que aún no tenga configurado session-&gt;tunnel. Agregue una verificación para este caso.","source":"nvd"}],"published":"2024-10-21T18:01:59.668Z","modified":"2026-10-30T13:17:39.873Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"3953ae7b218df4d1e544b98a393666f9ae58a78c","fixed":"aa7132362e79abc4f2add4d8657dd1679341edc5","status":"affected"},{"type":"git","introduced":"3953ae7b218df4d1e544b98a393666f9ae58a78c","fixed":"98691b2e28a6c3dac0680914493d54c77f215755","status":"affected"},{"type":"git","introduced":"3953ae7b218df4d1e544b98a393666f9ae58a78c","fixed":"f7415e60c25a6108cd7955a20b2e66b6251ffe02","status":"affected"},{"type":"git","introduced":"3953ae7b218df4d1e544b98a393666f9ae58a78c","fixed":"24256415d18695b46da06c93135f5b51c548b950","status":"affected"},{"type":"git","version":"b102bfc2a90d14f342580285782a9a51c74f7369","status":"affected"},{"type":"git","version":"10c15ddabbcf888922adbdd44ca3fecf6eab19d9","status":"affected"},{"type":"git","version":"8d1c650d452c53fcb3f02a7b1d772741639f89a4","status":"affected"},{"type":"git","version":"12b5fb58ac993c24210cf8cbc72d407d3a4e6490","status":"affected"},{"type":"git","version":"aef37401b467a0b1a9517c69924a1d66937e0789","status":"affected"},{"type":"semver","introduced":"3.2.99","fixed":"3.3","status":"affected"},{"type":"semver","introduced":"3.16.54","fixed":"3.17","status":"affected"},{"type":"semver","introduced":"4.4.225","fixed":"4.5","status":"affected"},{"type":"semver","introduced":"4.9.225","fixed":"4.10","status":"affected"},{"type":"semver","introduced":"4.14.182","fixed":"4.15","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"4.15","status":"affected"},{"type":"semver","introduced":"0","fixed":"4.15","status":"unaffected"},{"type":"semver","introduced":"6.1.191","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.160","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.11.3","lastAffected":"6.11.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.12","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","fixed":"6.11.3"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/aa7132362e79abc4f2add4d8657dd1679341edc5","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/98691b2e28a6c3dac0680914493d54c77f215755","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f7415e60c25a6108cd7955a20b2e66b6251ffe02","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/24256415d18695b46da06c93135f5b51c548b950","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-10-22T13:37:52.827Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-49940","url":"https://www.cve.org/CVERecord?id=CVE-2024-49940","licence":"CVE Terms of Use","modified":"2026-10-30T12:19:44.806Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-49940","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-49940","licence":"Public domain","modified":"2026-10-30T13:17:39.873Z"}],"updatedAt":"2026-11-25T22:58:47.055Z","epss":{"score":0.0032,"percentile":0.17473,"date":"2026-11-30T12:00:22.000Z"}}