Red Hat Bugzilla – Bug 1006287
digest_nss.c should call SECMOD_RestartModules() on fork()
Last modified: 2015-06-29 08:21:23 EDT
Description of problem:
Apparently, this is what NSS requires to survive a fork() now, e.g. bug 800304.
Also related bug 1006280 shows a case where even calling SECMOD_RestartModules() doesn't help NSS to function properly afterwards.
> or if you do:
> agin, you don't need to do a restartmodule.
...which is basically what rpm does, this was introduced precisely to allow things to work after a fork(): http://rpm.org/gitweb?p=rpm.git;a=commitdiff;h=2ce7b56e621b097b76a2e5059def7d0e5a64d53b
So there shouldn't be any need to additionally call SECMOD_RestartModules(). However both methods of reinitializing only allow *new* handles to work, so whether rpm/nss breaks after a fork() or not might well depend on where and when exactly the fork() occurs. We'd probably need some more debuggable reproducer than anaconda to track down what's going on :-/
However both what
(In reply to Panu Matilainen from comment #1)
> However both methods of reinitializing only allow *new* handles to work, so
> whether rpm/nss breaks after a fork() or not might well depend on where and
> when exactly the fork() occurs.
handles you mean e.g. HASHContext() objects?
The app is forked right before dnf's do_transaction(). So creating the transaction, ordering, test run and the actual run all happen after the fork. Of course, some rpm calls probably take place before that, but I don't see how the context is reused.
If you believe the nss reinit in RPM is correct I'm not against closing this. It just looked like the preferred way was doing RestartModules().
(In reply to Ales Kozumplik from comment #2)
> (In reply to Panu Matilainen from comment #1)
> > However both methods of reinitializing only allow *new* handles to work, so
> > whether rpm/nss breaks after a fork() or not might well depend on where and
> > when exactly the fork() occurs.
> handles you mean e.g. HASHContext() objects?
Those, key objects etc, although I'm nowhere near sure what all gets broken by a fork().
> The app is forked right before dnf's do_transaction(). So creating the
> transaction, ordering, test run and the actual run all happen after the
> fork. Of course, some rpm calls probably take place before that, but I don't
> see how the context is reused.
Not sure either, but given the "yum legacy" in dnf (transaction wrappers etc) the transaction, associated keyring and such objects might live longer than is obvious. Or something...
> If you believe the nss reinit in RPM is correct I'm not against closing
> this. It just looked like the preferred way was doing RestartModules().
SECMOD_RestartModules() is supposed to be, and likely is, a better way of reinitializing than what rpm is doing, but AIUI what rpm does is supposed to work just as well. As SECMOD_RestartModules() is a fairly new addition to NSS, I'm not keen to make it a required function and at that point using the simpler option actually means adding even more fluff to rpm codebase for handling the same thing it already does (at least supposedly).
Basically I'd like some kind of confirmation that calling SECMOD_RestartModules() actually fixes something. Otherwise adding another way of reinitializing seems kinda pointless...
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora 'version'
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.
Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 20 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
Thank you for reporting this bug and we are sorry it could not be fixed.