l2tp: fix tunnel and session refcount leak on seq_file release
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 0e0c3fee3a59a387aeecc4fca6f3a2e9615a5443 · < 9006c116dd111d457bf5d074990210f70a4ad2c8| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
l2tp: fix tunnel and session refcount leak on seq_file release
In pppol2tp_proc_open() and l2tp_dfs_seq_open(), iteration state (pd->tunnel and pd->session) is kept in seq_file private data to allow iteration across multiple read() system calls.
However, if userspace closes /proc/net/pppol2tp or /sys/kernel/debug/l2tp/tunnels before reading to end-of-file (EOF), any tunnel or session reference stored in pd->tunnel / pd->session is left un-dropped when seq_file private data is freed.
Fix this by dropping any remaining pd->tunnel and pd->session references in pppol2tp_proc_release() and l2tp_dfs_seq_release() when closing the file.
From the CVE record · Linux
The Linux kernel’s L2TP proc and debugfs file handlers can leak tunnel or session references. A local user with access to the affected files can trigger the leak by closing one before reading to end-of-file; no other user interaction is required.
Engineers running Linux kernels with the affected L2TP proc or debugfs file handlers should check their kernel’s status.