{"id":"CVE-2024-49940","published":"2024-10-21T18:01:59Z","modified":"2026-10-30T12:19:44Z","title":"l2tp: prevent possible tunnel refcount underflow","vendor":"Linux","product":"Linux","tier":"tail","description":{"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.8,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00325,"percentile":0.26205,"provenance":"source"},"cwes":[],"references":[{"url":"https://git.kernel.org/stable/c/aa7132362e79abc4f2add4d8657dd1679341edc5","tags":[]},{"url":"https://git.kernel.org/stable/c/98691b2e28a6c3dac0680914493d54c77f215755","tags":[]},{"url":"https://git.kernel.org/stable/c/f7415e60c25a6108cd7955a20b2e66b6251ffe02","tags":[]},{"url":"https://git.kernel.org/stable/c/24256415d18695b46da06c93135f5b51c548b950","tags":[]}],"priority":{"score":10.7,"factors":[{"name":"EPSS percentile","points":5.24},{"name":"CVSS severity","points":5.46}]},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= 3953ae7b218df4d1e544b98a393666f9ae58a78c, < aa7132362e79abc4f2add4d8657dd1679341edc5",">= 3953ae7b218df4d1e544b98a393666f9ae58a78c, < 98691b2e28a6c3dac0680914493d54c77f215755",">= 3953ae7b218df4d1e544b98a393666f9ae58a78c, < f7415e60c25a6108cd7955a20b2e66b6251ffe02",">= 3953ae7b218df4d1e544b98a393666f9ae58a78c, < 24256415d18695b46da06c93135f5b51c548b950","b102bfc2a90d14f342580285782a9a51c74f7369","10c15ddabbcf888922adbdd44ca3fecf6eab19d9","8d1c650d452c53fcb3f02a7b1d772741639f89a4","12b5fb58ac993c24210cf8cbc72d407d3a4e6490","aef37401b467a0b1a9517c69924a1d66937e0789",">= 3.2.99, < 3.3"]},{"vendor":"Linux","product":"Linux","versions":["4.15"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2024-10-22T13:37:52.827630Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2024-43621","exploited":false,"provenance":"source"}}