ULP(1)
๐ ULP โ the Userspace Livepatching Tool, bestie edition ๐
okay so. you know ulp? no? then sit down, grab a strawberry ๐, because this is the tool for userspace livepatching and honestly it's giving main character energy. this is the ULP(1) manual page, from the Libpulp Tools collection, and by the end of it you're gonna be obsessed. periodt. ๐
โจ NAME โจ
ulp โ the Userspace Livepatching Tool. that's it, that's the name, no notes. ๐
๐ธ SYNOPSIS ๐ธ
ulp command [SWITCHES]... [ARGUMENTS] file
like, you pick a command, you sprinkle on some [SWITCHES]..., you toss in your [ARGUMENTS], and there's a file at the end. slay. ๐ฆ
๐ INTRODUCTION ๐
so ulp isn't just one thing, bestie โ it's a whole set of tools used in the userspace livepatching process. the squad handles:
- querying patch status
- libpulp messages
- applying and removing patches
- checking for livepatch capabilities within a process
so basically it does everything. no cap. ๐
the commands ulp currently supports are:
patchesโ list running programs that have livepatching capabilities loaded, as well the libraries that are livepatchable and the list of loaded patches.checkโ check if a certain livepatch (.so) is applied to a running process.dumpโ print the content of a livepatch (.so) in human-readable form.packerโ compile the livepatch descriptor (.dscfile) into a livepatch (.ulpfile). The later can be used to apply a livepatch to a running process usingtrigger.triggerโ apply or remove a list of livepatches to a list of running processes.postโ apply any post-processing needed to livepatch containers (.sofiles).messagesโ querry the libpulp internal message queue in a running process. This can be used to diagnose livepaching errors that occured internally in the target process.
Detailed descriptions about how these commands work are provided in the next sections. ๐
yes, the manpage really does spell it "querry" and "livepaching" and "The later". we keep the lore intact. it's part of the charm. ๐
๐ฆ PATCHES ๐ฆ
NAME
ulp patches โ Show active live patches and libraries. ๐
SYNOPSIS
ulp patches -pwildcard
DESCRIPTION
ulp patches shows which libraries are livepatchable and which livepatches are loaded in process that matches either wildcard as name or with pid = wildcard. it's the vibe check for your running processes. ๐
OPTIONS
-pwildcard โ Show processes which name matches the wildcard, or with pid = wildcard.
EXIT STATUS
ulp patches exits 0 on success, anything else on error. simple as that. โจ
๐ CHECK ๐
NAME
ulp check โ Apply a live patch.
SYNOPSIS
ulp check [OPTION]... -ppid file
DESCRIPTION
ulp check attaches to the target process specified by pid and checks whether the live patch described by the metadata file that it takes as argument has already been applied or not. like a detective but for patches. ๐
Only relevant processes can be inspected with ulpcheck. More specifically, the following conditions must be met:
Attaching to the Target Process
Libpulp uses ptrace to attach to target processes, thus only the owner of a process (or root) can apply a live patch to it. Moreover, on systems that have Linux Security Modules (LSM) enabled, some extra convincing might be required (see Ptrace access mode checking in ptrace(2)). When ulp check is unable to attach to the target process, it exits in error. ๐ญ
Runtime support
Applying a live patch requires functions from libpulp.so, which must have been loaded into the address space of the target process. Typically, this is accomplished with LD_PRELOAD (see libpulp(7)). ๐ซ
FATAL ERRORS
If a problem happens during the execution of functions from libpulp.so, the target process might end up in an inconsistent state. When that happens ulp check exits with error code -1, and the user is advised to kill the process.
๐ no fr, kill the process. it's not okay in there. this is the "do not perceive me" moment of processes.
OPTIONS
-q,--quietโ Do not produce any output.-v,--verboseโ Produce verbose output.-?,--helpโ Display a lengthy usage message.-usageโ Display a brief usage message.-V,--versionโ Print program version and exit.
BUGS
ulp check also returns -1 on non-fatal errors. ๐ iconic of it, honestly.
EXIT STATUS
ulp check exits 0 on success, 1 on error, and -1 on fatal errors. A fatal error is an indication that the target process should be killed, because it was probably left in an inconsistent state. ๐จ
๐ DUMP ๐
NAME
ulp dump โ Prints metadata information in human-readable format. ๐
SYNOPSIS
ulp dump file
DESCRIPTION
ulp dump parses the metadata file that it takes as argument, which is in binary format, then prints its content to the standard output in human-readable format. binary in, human out. it's giving translator. ๐ธ
EXIT STATUS
ulp dump exits 0 on success and 1 on error. ๐
๐ PACKER ๐
NAME
ulp packer โ Create live patch metadata. ๐
SYNOPSIS
ulp packer [OPTION]... file_wildcard
DESCRIPTION
ulp packer creates a live patch metadata file based on the live patch description file that it takes as argument. After parsing the description file, ulp packer validates that the target library and live patch objects referred to exist, then produces the metadata file required by live patching tools, such as ulp trigger(1) and ulp check(1). it's the glow-up station for your patches. โจ
The syntax of the description file is described in libpulp(7).
By default, the output is written to stdout, but it can be optionally redirected to a specified file. See OPTIONS below. ๐
OPTIONS
-o,--output=FILENAMEโ Instead of printing the results to the standard output, write them toFILENAME.-p,--process=WILDCARDโ Patch any process which name matches theWILDCARD. A single PID is also supported by passingWILDCARD=PIDof the target process.-l,--livepatch=FILENAMEโ Instead of getting the path to the live patch object from the description file, useFILENAME.-t,--target=FILENAMEโ Instead of getting the path to the target library from the description file, useFILENAME.-q,--quietโ Do not produce any output.-v,--verboseโ Produce verbose output.-?,--helpโ Display a lengthy usage message.-usageโ Display a brief usage message.-V,--versionโ Print program version and exit.-R,--root=PREFIXโ AppendPREFIXto the path to the livepatch.sofile when it is send to the target process. This is useful ifulpis running inside achroot. ๐ง
EXIT STATUS
ulp packer exits 0 on success and 1 on error. ๐ซถ
๐ and that's part 1, bestie โ there's more coming, don't go anywhere, the group chat isn't done yet ๐
๐ง DESCRIPTION
ulp trigger attaches to the target process โ either a whole set of processes matched by process_wildcard, or a single process whose pid equals process_wildcard โ and applies the set of livepatches described by the metadata file file_wildcard that you hand it as an argument. ๐ซถ
Once it's done parsing that metadata file, it runs a bunch of checks to make sure your target process can actually receive the live patch you're asking for:
๐ Target Library
A live patch replaces functions that belong to a shared library, so ulp trigger goes hunting through the memory space of the target process to see if that library is even there. If the library isn't present, ulp trigger exits in error. Bye. ๐
๐ Replacement functions
The metadata file holds a list of replacement functions, and those functions must be present in the live patch object (DSO). If every single one is there, the live patching operation can proceed. If not? ulp trigger exits in error. No exceptions, bestie.
๐ Attaching to the Target Process
Libpulp uses ptrace to attach to target processes, which means only the owner of a process (or root) can apply a live patch to it. And on systems that have Linux Security Modules (LSM) enabled, some extra convincing might be required (see Ptrace access mode checking in ptrace(2)). When ulp trigger can't attach to the target process, it exits in error.
๐งฉ Runtime support
Applying a live patch needs functions from libpulp.so, and those must already have been loaded into the address space of the target process. Typically this is accomplished with LD_PRELOAD (see libpulp(7)).
โฉ Forward progress
After attaching to the target process with ptrace, Libpulp calls functions from libpulp.so. The execution of these functions happens from the context of a signal handler, so AS-Unsafe functions are not allowed (see attributes(7)). However, Libpulp requires the use of malloc(3), dlopen(3) and dlsym(3) โ and all three of those are AS-Unsafe. ๐ญ So, to avoid deadlocks, libpulp.so checks that these functions are not in execution anywhere in the target process before it starts the live patching operation. Iconic safety-first behavior fr fr.
๐ FATAL ERRORS
If a problem happens after Libpulp started replacing functions from the target process, the process might end up in an inconsistent state. When that happensulp triggerexits with error code-1, and the user is advised to kill the process. Not a drill, bestie โ go get thekill. ๐ฅ
โ๏ธ OPTIONS
-r,--retries=Nโ To guarantee Forward Progress, Libpulp first checks whether trying to apply a live patch would cause a deadlock in the target process, or if it would be safe to do so. By default,ulp triggerperforms this check a single time and exits in error if the check fails. But the state of the relevant locks usually changes very quickly, so there's a high chance that trying again after a brief moment would let the live patching operation succeed without risk of deadlock. This option tellsulp triggerto try again N times. ๐-c,--check-stackโ Before applying the live patch to the target process, unwind the stacks of all threads and make sure that none of them have library calls in execution. If any thread is within the target library,ulp triggeraborts the live patching operation; on the other hand, if no threads are within the target library, the live patch can be applied with additional consistency guarantees. ๐งต--revert-all=LIBโ Before applying the live patch to the target process, revert all livepatches applied to the libraryLIB. IfLIB=target, then all patches to the target library of the livepatch will be removed. ๐ซง--disable-summarizationโ Disable output summarization. This avoids suppression of output 'irrelevant output' with regard to skipped livepatches.--timeout Nโ WaitNseconds for a reply from libpulp. Default is100s. In cases where the system is busy running multiple tasks it may be worth increasing this number, once ulp will bail out to not hang a system update. โณ--recursiveโ Look for livepatches recursively when a wildcard is passed.-q,--quietโ Do not produce any output. ๐คซ-v,--verboseโ Produce verbose output.-?,--helpโ Display a lengthy usage message.-usageโ Display a brief usage message.-V,--versionโ Print program version and exit.
๐ฆ EXIT STATUS
ulp trigger exits 0 on success, 1 on error, and -1 on fatal errors. And a fatal error is basically a giant flashing sign saying the target process should be killed, because it was probably left in an inconsistent state. ๐
๐ฎ POST
NAME โ ulp post
ulp post โ Post-process live patchable libraries. โจ
SYNOPSIS
ulp post file
DESCRIPTION
ulp post opens the library file you passed as an argument and replaces one-byte nops with multi-byte nop instructions at patchable function entries (see gcc(1)). Little glow-up, huge payoff. ๐
EXIT STATUS
ulp post exits 0 on success, and 1 on error.
๐ REVERSE
NAME โ ulp reverse
ulp reverse โ Create live patch metadata.
SYNOPSIS
ulp reverse
file
DESCRIPTION
ulp reverse creates a live patch metadata used to revert the effects of the metadata file that it takes as argument. ๐ซถ
Live patch reversal does not require a live patch object file, because it does not add new replacement functions; rather, it causes the reverse-patched process to fallback to the functions that had been previously replaced. Those functions are already present in the memory space of the target process, so no new friends needed. ๐ธ
EXIT STATUS
ulp reverse exits 0 on success and a positive integer on error.
๐ MESSAGES
NAME โ ulp messages
ulp messages โ Querry internal messages from libpulp.
SYNOPSIS
ulp messages
-p pid
DESCRIPTION
ulp messages prints all internal messages from the libpulp message queue in the process running with pid = pid. Those messages are useful to debug any problem that may happens when a livepatch is applied. ๐ต๏ธโโ๏ธ
Messages are output to stdout.
EXIT STATUS
ulp messages exits 0 on success, anything else on error.
๐ฆ EXTRACT
NAME โ ulp extract
ulp extract โ Extract the relevant content from a livepatchable library.
SYNOPSIS
ulp extract
livepatchable_library -o output_file
DESCRIPTION
Extract the relevant content from livepatchable_library โ such as the library name, buildid, and symbols in the library โ and write those informations into a JSON file specified by output_file. ๐ง
EXIT STATUS
ulp extract exits 0 on success, anything else on error.
๐๏ธ SET_PATCHABLE
NAME โ ulp set_patchable
ulp set_patchable โ Enable/disable livepatching on target process.
SYNOPSIS
ulp set_livepatchable -p process
enable/disable
DESCRIPTION
Enable or disable the livepatching capability of the process specified by -p WILDCARD. If WILDCARD is a number, then it is assumed to be the PID of the process. The program will output which processes were modified. ๐ข
EXIT STATUS
Always returns 0. Always. Immovable. Unbothered. Moisturized. In her lane. ๐
and that's a wrap on this whole thing, bestie!! this was the ULP(1) manual page, top to bottom, and yes the footer really is just that โ ULP(1), the classic, the moment, the whole vibe. go forth and livepatch responsibly ๐ฆ๐
๐ฆ where this page comes from
- debian trixie: libpulp-tools 0.2.8-1 ยท LGPL-2.1-or-later
- opensuse-leap 16.0: libpulp-tools 0.3.17-160000.2.1 ยท LGPL-2.1-or-later
- opensuse-leap 16.0: libpulp-tools 0.3.17-160000.2.1 ยท LGPL-2.1-or-later
- Copyright (C) 2021 SUSE Software Solutions GmbH
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms