{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2024-49940","id":"CVE-2024-49940","title":"l2tp: prevent possible tunnel refcount underflow","description":"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 l2","descriptionLong":"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.","published":"2024-10-21T18:01:59.668Z","updated":"2026-11-17T07:03:34.849916233Z","reserved":"2024-10-21T12:17:06.043Z","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":"3953ae7b218df4d1e544b98a393666f9ae58a78c","lessThan":"aa7132362e79abc4f2add4d8657dd1679341edc5","status":"affected","versionType":"git"},{"version":"3953ae7b218df4d1e544b98a393666f9ae58a78c","lessThan":"98691b2e28a6c3dac0680914493d54c77f215755","status":"affected","versionType":"git"},{"version":"3953ae7b218df4d1e544b98a393666f9ae58a78c","lessThan":"f7415e60c25a6108cd7955a20b2e66b6251ffe02","status":"affected","versionType":"git"},{"version":"3953ae7b218df4d1e544b98a393666f9ae58a78c","lessThan":"24256415d18695b46da06c93135f5b51c548b950","status":"affected","versionType":"git"},{"version":"b102bfc2a90d14f342580285782a9a51c74f7369","status":"affected","versionType":"git"},{"version":"10c15ddabbcf888922adbdd44ca3fecf6eab19d9","status":"affected","versionType":"git"},{"version":"8d1c650d452c53fcb3f02a7b1d772741639f89a4","status":"affected","versionType":"git"},{"version":"12b5fb58ac993c24210cf8cbc72d407d3a4e6490","status":"affected","versionType":"git"},{"version":"aef37401b467a0b1a9517c69924a1d66937e0789","status":"affected","versionType":"git"},{"version":"3.2.99","lessThan":"3.3","status":"affected","versionType":"semver"},{"version":"3.16.54","lessThan":"3.17","status":"affected","versionType":"semver"},{"version":"4.4.225","lessThan":"4.5","status":"affected","versionType":"semver"},{"version":"4.9.225","lessThan":"4.10","status":"affected","versionType":"semver"},{"version":"4.14.182","lessThan":"4.15","status":"affected","versionType":"semver"}],"platforms":[]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.15","status":"affected"},{"version":"0","lessThan":"4.15","status":"unaffected","versionType":"semver"},{"version":"6.1.191","lessThanOrEqual":"6.1.*","status":"unaffected","versionType":"semver"},{"version":"6.6.160","lessThanOrEqual":"6.6.*","status":"unaffected","versionType":"semver"},{"version":"6.11.3","lessThanOrEqual":"6.11.*","status":"unaffected","versionType":"semver"},{"version":"6.12","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}],"platforms":[]}],"packages":[],"cwes":[],"aliases":[],"references":[{"url":"https://git.kernel.org/stable/c/aa7132362e79abc4f2add4d8657dd1679341edc5","tags":["web"]},{"url":"https://git.kernel.org/stable/c/98691b2e28a6c3dac0680914493d54c77f215755","tags":["web"]},{"url":"https://git.kernel.org/stable/c/f7415e60c25a6108cd7955a20b2e66b6251ffe02","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/24256415d18695b46da06c93135f5b51c548b950","tags":["Patch","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/49xxx/CVE-2024-49940.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-49940","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":{"exploitation":"none","automatable":"no","technicalImpact":"partial"},"epss":0.00325,"epssPercentile":0.26073,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2024-49940","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-49940","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2024-49940","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-2024-49940","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}