В ядре Linux устранена следующая уязвимость: sunrpc: pin gss модуль через auth_domain RCU free A gss auth_domain хранит необработанный указатель на svcauthops_gss в dom->flavour, и его выпуск очереди svcauth_gss_domain_release_rcu() через call_rcu(). Оба живут в тексте auth_rpcgss.ko, и ничто не прикрепляет модуль, в то время как домен, ссылающийся на него, доступен. rmmod auth_rpcgss может, следовательно, отобразить этот текст, в то время как экспорт NFSD все еще содержит ссылку на домен. Экспортный кэш является одним из таких держателей.
Когда экспорт, наконец, выпущен, ссылка на домен падает из текста модуля: svc_export_put() auth_domain_put(exp->ex_client) auth_domain_release() dom->flavour->domain_release(dom) / * в текст модуля * / svcauth_gss_domain_release() call_rcu(&dom->rcu_head, svcauth_gss_domain_release_rcu) Once auth_rpcgss выгружается, вызов domain_release попадает в неотображенную память. rcu_barrier() в exit_rpcsec_gss() не помогает: он ждет только вызовов, уже стоящих в очереди, и этот не стоит в очереди, пока экспорт не исчезнет. Объекты NFSD NFSv4 импортируют символы из auth_rpcgss.ko, поэтому только сервер, построенный без CONFIG_NFSD_V4, может выгрузить auth_rpcgss, в то время как экспорт все еще называет домен gss. Возьмите ссылку на модуль в svcauth_gss_register_pseudoflavor() перед публикацией домена и сбросьте ее в конце svcauth_gss_domain_release_rcu().
Затем rcu_barrier() сохраняет образ модуля до тех пор, пока этот обратный звонок не вернется. [ cel: переписал описание ]
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: sunrpc: pin gss module across auth_domain RCU free A gss auth_domain stores a raw pointer to svcauthops_gss in dom->flavour, and its release queues svcauth_gss_domain_release_rcu() via call_rcu(). Both live in auth_rpcgss.ko text, and nothing pins the module while a domain referencing it is reachable. rmmod auth_rpcgss can therefore unmap that text while an NFSD export still holds a reference to the domain. The export cache is one such holder. When the export is finally released, the domain reference drops from module text: svc_export_put() auth_domain_put(exp->ex_client) auth_domain_release() dom->flavour->domain_release(dom) /* into module text */ svcauth_gss_domain_release() call_rcu(&dom->rcu_head, svcauth_gss_domain_release_rcu) Once auth_rpcgss is unloaded, the domain_release call lands in unmapped memory. The rcu_barrier() in exit_rpcsec_gss() does not help: it waits only for callbacks already queued, and this one is not queued until the export goes away. NFSD's NFSv4 objects import symbols from auth_rpcgss.ko, so only a server built without CONFIG_NFSD_V4 can unload auth_rpcgss while exports still name a gss domain. Take a module reference in svcauth_gss_register_pseudoflavor() before publishing the domain and drop it at the end of svcauth_gss_domain_release_rcu(). The rcu_barrier() then holds the module image until this callback has returned. [ cel: rewrote description ]