Bug 1131307 - needs-restarting may not handle cases where processes map libraries without opening them
Summary: needs-restarting may not handle cases where processes map libraries without o...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: yum-utils
Version: 22
Hardware: All
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-19 01:26 UTC by Alice Lehman
Modified: 2016-07-19 12:02 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-07-19 12:02:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Alice Lehman 2014-08-19 01:26:14 UTC
Description of problem:
The following description of the reported problem comes from http://ingvar.blog.redpill-linpro.com/2014/01/20/finding-what-binaries-to-restart-revisited/

Processes may map libraries without opening them. If the underlying library is updated, needs-restarting won’t list the process as need to be restarted. But the process may crash or behave strangely when it some time in the future opens a mapped library, and that library has been changed by an update.
And yes, this is a real problem, experienced on production systems.


Additional info:
It is suggested for the needs-restarting script to dig a bit deeper, by running ldd on the running process binaries, and recursively checking all underlying libraries.

Comment 1 Valentina Mukhamedzhanova 2014-09-03 11:24:20 UTC
Hello, thank you for the report. Could you please provide a reproducer?

Comment 2 Ingvar Hagelund 2014-09-16 08:59:34 UTC
Hello, Valentina. I'm the one who wrote the script on that blog entry.

I can reproduce that the script does not pick up changes in a mapped but unopened library for a running process. Crashing that process may be a bit harder. We've seen this in a customer case, crashing a Java JVM some months ago, though.

Here is an example. After updating openssl, ntpd should be restarted. In most cases, this is not picked up by needs-restarting:

[root@nova ~]# rpm -q openssl ntp
openssl-0.9.8e-27.el5_10.4
ntp-4.2.2p1-17.el5_10

[root@nova ~]# needs-restarting | grep ntp || echo nothing
nothing

[root@nova ~]# ldd /sbin/ntpd | grep crypt
	libcrypto.so.6 => /lib64/libcrypto.so.6 (0x00002abf7b1a1000)

[root@nova ~]# date -d "@$(rpm -q --qf  "%{INSTALLTIME}\n" -f /lib64/libcrypto.so.6)"
Thu Aug 14 09:27:40 CEST 2014

[root@nova ~]# ps -o lstart,pid -p `pgrep ntpd`
                 STARTED   PID
Sat Jun  7 16:58:45 2014  1982

So the ntpd process is older than the library, and should be restarted. The needs-restarting script does discover this. My script does:

[root@nova ~]# check_newlibs  | grep ntp
Warning: Needs restart: /sbin/ntpd, pids 1982


Best regards, 
Ingvar Hagelund

Comment 3 Ingvar Hagelund 2014-09-24 07:49:45 UTC
Correction:

(...) the ntpd process is older than the library, and should be restarted. The needs-restarting script does NOT discover this. My script does (...)

Comment 4 Fedora End Of Life 2015-05-29 12:40:15 UTC
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'
of '20'.

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.

Comment 5 Fedora End Of Life 2015-06-29 22:08:07 UTC
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
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 6 Ingvar Hagelund 2015-06-30 09:17:20 UTC
Reproduced on Fedora 22

Steps to reproduce:

Downgrade openssl, for example to openssl-1.0.1j-3, http://koji.fedoraproject.org/koji/buildinfo?buildID=594471

 # rpm --oldpackage -Uvh openssl-1.0.1j-3.fc22.x86_64.rpm \
                         openssl-libs-1.0.1j-3.fc22.x86_64.rpm \
                         openssl-devel-1.0.1j-3.fc22.x86_64.rpm 


Restart ntpd

 # systemctl restart ntpd.service


Upgrade openssl

 # dnf update openssl
 (...)

 Upgraded:
   openssl.x86_64 1:1.0.1k-10.fc22
   openssl-devel.x86_64 1:1.0.1k-10.fc22
   openssl-libs.x86_64 1:1.0.1k-10.fc22


As ntpd links into openssl, it should be restarted:

 # ldd /usr/sbin/ntpd | grep libcrypto
	libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007fa6b3bfb000)

 # rpm -qf /lib64/libcrypto.so.10
 openssl-libs-1.0.1k-10.fc22.x86_64


But needs-restarting does not discover this:

 # needs-restarting | grep ntp
 (no output)


My script does discover this:

 # check_newlibs  | grep ntp
 Warning: Needs restart: /usr/sbin/ntpd, pids 14722

Comment 7 Fedora End Of Life 2016-07-19 12:02:29 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 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
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.