|
Server IP : 80.80.81.74 / Your IP : 80.80.80.28 Web Server : Apache/2.4.37 (Oracle Linux Server) System : Linux ust-wp4-prod 5.15.0-310.184.5.2.el8uek.x86_64 #2 SMP Wed Jul 9 16:08:33 PDT 2025 x86_64 User : apache ( 48) PHP Version : 8.4.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0555) : /sbin/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
#!/bin/bash
# Copyright (C) 2009-2010 Oracle and/or its affiliates. All rights reserved.
# Author: Tim Abbott
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
#
# Not a Contribution for purposes of the Fedora Project Individual Contributor
# License Agreement
#
# Ksplice modprobe wrapper script to use depmod information for the
# running kernel, including Ksplice updates that have been
# cold-applied.
UPTRACK_IN_USE=/var/run/uptrack
# We want to make sure that there are no races between applying an update
# and loading a kernel module as we could end up in a situation where a
# module is loaded by the admin at the exact same time an update patching
# the same target module is loaded, which could lead the Ksplice core
# module to assume the target module is not loaded (and hence does not
# require any live patching), but the target module gets loaded BEFORE we
# had a chance to install the cold patched module on disk, leaving the
# system in a bad state and with unremovable Ksplice updates.
#
# /var/run being accessible to the uptrack client is a built-in assumption
# already in uptrack.
LOCK_PATH=/var/run/.modprobe.ksplice.lock
# If we can create/access this file, we should lock it. Otherwise,
# ignore the file. This does mean that somebody who has
# CAP_SYS_MODULE will be able to load modules without taking the
# lock.
# Create with 600 permissions
umask 077
if touch ${LOCK_PATH} 2>/dev/null; then
exec 9> ${LOCK_PATH}
flock --shared 9
fi
# Restore regular umask
umask 022
# Don't bother with the uptrack modprobe if uptrack isn't is use.
if ! [ -f "$UPTRACK_IN_USE" ] || ! /bin/grep -sq ^ksplice_ /proc/modules; then
exec -a modprobe "/sbin/modprobe.ksplice-orig" "$@"
fi
# Args based on module-init-tools 3.6.
get_set_version_arg ()
{
OPTS=$(PATH=/usr/bin:/bin getopt -q -o 'vVC:o:rknqQsclt:aifbwd:' --long "verbose,version,config:,name:,remove,wait,showconfig,autoclean,quiet,show,dry-run,syslog,type:,list,all,ignore-install,ignore-remove,force,force-vermagic,force-modversion,set-version:,dirname,first-time,dump-modversions,use-blacklist" -- "$@") || return 1
eval set -- "$OPTS"
while true; do
case "$1" in
--) shift; break;;
--set-version) shift; echo "$1"; shift;;
*) shift;;
esac
done
}
if [ -n "$(get_set_version_arg $@)" ]; then
# The user passed --set-version; since presumably they explicitly
# want to use some version other than that of their running
# kernel, run modprobe with the user's options
# TODO?: Check if the version is the same as the running kernel's
# and if so, s/--set-version `uname -r`/--set-version ksplice-`uname -r`/.
exec -a modprobe "/sbin/modprobe.ksplice-orig" "$@"
fi
VERARGS=
FAKEVERSION=$(/bin/uname -r).ksplice-updates
FAKEMODDIR="/lib/modules/$FAKEVERSION"
if [ -e "$FAKEMODDIR/valid" ]; then
# If any Ksplice updates are cold-applied, use them
VERARGS="--set-version $FAKEVERSION"
fi
exec -a modprobe "/sbin/modprobe.ksplice-orig" $VERARGS "$@"