Ad

CVE-2026-99528

HIGH CVSS 3.1: 7,8 EPSS 0.17%
Обновлено 23 ноября 2026
Linux
Параметр Значение
CVSS 7,8 (HIGH)
Поставщик Linux
Публичный эксплойт Нет

В ядре Linux была устранена следующая уязвимость: SUNRPC: исправить netns use-after-free в write_gssp() While fuzzing с помощью настраиваемого syzkaller, я наткнулся на предупреждение о пересчете в xprt_alloc(), дошедшее от записи до /proc/net/rpc/use-gss-proxy: refcount_t: добавление на 0; use-after-free. WARNING: lib/refcount.c:25 at refcount_warn_saturate+0xf8/0x120 CPU: 0 PID: 10404 Comm: syz.0.17 Not tainted 7.3.0-rc1-00096-gcfebfd3db73d Call Trace: <TASK> xprt_alloc+0x83f/0x9d0 xs_setup_xprt+0xaf/0x3c0 xs_setup_local+0x47/0x7f0 xprt_create_transport+0x16c/0x730 rpc_create+0x38e/0x7f0 gssp_rpc_create+0xe2/0x180 set_gssp_clnt+0xba/0x1b0 write_gssp+0x200/0x310 proc_reg_write+0x240/0x330 vfs_write+0x2aa/0x1050 ksys_write+0x12a/0x250 do_syscall_64+0x117/0x750 entry_SYSCALL_64_after_hwframe+0x77/0x7f </TASK> create_use_gss_proxy_proc_entry() stores the struct net pointer as the proc entry's private data without taking a reference on it, and an open file descriptor does not pin the namespace either, as procfs only pins the proc_dir_entry. write_gssp() reads that pointer back with pde_data() and hands it to set_gssp_clnt(), which reaches xprt_init(): xprt->xprt_net = get_net_track(net, &xprt->ns_tracker, GFP_KERNEL); get_net_track() -> get_net() -> refcount_inc() is unconditional, so rpc_create() assumes its caller holds a reference on args.net. write_gssp() does not. __put_net() только очереди cleanup_net() на workque, и remove_proc_entry(), который отгораживает далее пишет бежит от rpcsec_gss pernet .exit метод, то есть изнутри cleanup_net(). cleanup_net() не пересчитывает ns.count, поэтому пространство имен в любом случае освобождается, и rpc_xprt - вместе с открытым для него сокетом AF_LOCAL - остается указателем на свободную память. Возрожденный счет также виден остальной части этого разрыва: с CONFIG_IPV6_MROUTE тот же работник cleanup_net (), а затем использует !mr_can_free_table () в ip6mr_free_table (), который тестирует check_net () в пространстве имен, которое он освобождает. Он сводится к открытию /proc/net/rpc/use-gss-proxy внутри нового сетевого пространства имен, вызывая settens() обратно к исходному, чтобы отбросить последнюю ссылку, а затем записывая «1» в все еще открытый дескриптор.

Возьмите ссылку в самом write_gssp() и откажитесь от записи, когда пространство имен уже исчезло. Это то, что procfs делает для любого другого файла /proc/net: get_proc_net() - это maybe_get_net(PDE_NET(PDE(inode)) и seq_open_net() возвращает -ENXIO, когда он терпит неудачу. PDE_NET() не может быть повторно использован здесь, потому что родительский каталог /proc/net/rpc не имеет указателя пространства имен. Добавление .pre_exit в rpcsec_gss_net_ops, чтобы запись была удалена раньше, только сузило бы окно, так как pre_exit также работает от cleanup_net().

Пространства имен в реальном времени не затронуты: запись по-прежнему возвращает ошибку из set_gssp_clnt(), запись "2" по-прежнему возвращает -EINVAL, и чтения остаются нетронутыми.

Показать оригинальное описание (EN)

In the Linux kernel, the following vulnerability has been resolved: SUNRPC: fix netns use-after-free in write_gssp() While fuzzing with a customized syzkaller, I hit a refcount warning in xprt_alloc(), reached from a write to /proc/net/rpc/use-gss-proxy: refcount_t: addition on 0; use-after-free. WARNING: lib/refcount.c:25 at refcount_warn_saturate+0xf8/0x120 CPU: 0 PID: 10404 Comm: syz.0.17 Not tainted 7.3.0-rc1-00096-gcfebfd3db73d Call Trace: <TASK> xprt_alloc+0x83f/0x9d0 xs_setup_xprt+0xaf/0x3c0 xs_setup_local+0x47/0x7f0 xprt_create_transport+0x16c/0x730 rpc_create+0x38e/0x7f0 gssp_rpc_create+0xe2/0x180 set_gssp_clnt+0xba/0x1b0 write_gssp+0x200/0x310 proc_reg_write+0x240/0x330 vfs_write+0x2aa/0x1050 ksys_write+0x12a/0x250 do_syscall_64+0x117/0x750 entry_SYSCALL_64_after_hwframe+0x77/0x7f </TASK> create_use_gss_proxy_proc_entry() stores the struct net pointer as the proc entry's private data without taking a reference on it, and an open file descriptor does not pin the namespace either, as procfs only pins the proc_dir_entry. write_gssp() reads that pointer back with pde_data() and hands it to set_gssp_clnt(), which reaches xprt_init(): xprt->xprt_net = get_net_track(net, &xprt->ns_tracker, GFP_KERNEL); get_net_track() -> get_net() -> refcount_inc() is unconditional, so rpc_create() assumes its caller holds a reference on args.net. write_gssp() does not. Dropping the last ns.count reference does not make the file go away. __put_net() only queues cleanup_net() on a workqueue, and the remove_proc_entry() that fences off further writes runs from the rpcsec_gss pernet .exit method, that is, from inside cleanup_net(). A write landing between those two points increments a refcount that is already zero. cleanup_net() does not re-read ns.count, so the namespace is freed anyway and the rpc_xprt -- along with the AF_LOCAL socket opened for it -- is left pointing at freed memory. The resurrected count is visible to the rest of that teardown too: with CONFIG_IPV6_MROUTE the same cleanup_net() worker then trips !mr_can_free_table() in ip6mr_free_table(), which tests check_net() on the namespace it is freeing. It reduces to opening /proc/net/rpc/use-gss-proxy inside a new network namespace, calling setns() back to the original one to drop the last reference, and then writing "1" to the still-open descriptor. Take the reference in write_gssp() itself and refuse the write when the namespace is already gone. This is what procfs does for every other /proc/net file: get_proc_net() is maybe_get_net(PDE_NET(PDE(inode))) and seq_open_net() returns -ENXIO when it fails. PDE_NET() cannot be reused here because the parent directory /proc/net/rpc carries no namespace pointer. Adding a .pre_exit to rpcsec_gss_net_ops so the entry is removed earlier would only narrow the window, since pre_exit also runs from cleanup_net(). Live namespaces are unaffected: a write still returns the error from set_gssp_clnt(), a write of "2" still returns -EINVAL, and reads are untouched.

Характеристики атаки

Способ атаки
Локальный
Нужен локальный доступ
Сложность
Низкая
Легко эксплуатировать
Нужны права
Низкие
Нужны базовые права
Участие пользователя
Не требуется
Не нужно действие пользователя

Последствия

Конфиденциальность
Высокое
Полная утечка данных
Целостность
Высокое
Полная модификация данных
Доступность
Высокое
Полный отказ в обслуживании

Строка CVSS v3.1