From 59fef4c47ec96d7c10db3b8c24790142018f131c Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 16 May 2021 02:52:59 +0800 Subject: [PATCH] generalize ken's note for shared library update, ... and move it into package management section --- chapter08/openssl.xml | 13 ++----------- chapter08/pkgmgt.xml | 21 ++++++++++++++++++++- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/chapter08/openssl.xml b/chapter08/openssl.xml index b96c355f7..d1690efc6 100644 --- a/chapter08/openssl.xml +++ b/chapter08/openssl.xml @@ -90,19 +90,10 @@ make MANSUFFIX=ssl install However, any running programs linked to those libraries need to be stopped - and restarted. The following command, run as - root after udating, will list what is - using the old versions of those libraries: + and restarted. Read the related entries in + for details. -grep -l -e 'libssl.*deleted' -e 'libcrypto.*deleted' /proc/*/maps | - tr -cd 0-9\\n | xargs -r ps u - - - If you used OpenSSH to login to the system, you - need to logout, login again, and rerun that command to confirm nothing is - still using the deleted libraries. - diff --git a/chapter08/pkgmgt.xml b/chapter08/pkgmgt.xml index 6c628c3d6..809421c3f 100644 --- a/chapter08/pkgmgt.xml +++ b/chapter08/pkgmgt.xml @@ -41,7 +41,7 @@ the Hints Project and see if one of them fits your need. - + Upgrade Issues A Package Manager makes it easy to upgrade to newer versions when they @@ -91,6 +91,25 @@ you have to downgrade a package, or the package changes the versioning scheme of library files suddenly. + If a package containing a shared library is updated, + and the name of library doesn't change, but a severe issue + (especially, a security vulnerability) is fixed, all running programs + linked to the shared library should be restarted. The following + command, run as root after + updating, will list what is using the old versions of those libraries + (replace libfoo with the name of the + library): + +grep -l -e 'libfoo.*deleted' /proc/*/maps | + tr -cd 0-9\\n | xargs -r ps u + + + If OpenSSH is being used for accessing + the system and it is linked to the updated library, you need to + restart sshd service, then logout, login again, + and rerun that command to confirm nothing is still using the + deleted libraries. +