Where the running kernel lives
/boot into RAM. The first is the kernel image, vmlinuz-<version>. The second is the initial ramdisk, which is initramfs-<version>.img on the RHEL family and initrd.img-<version> on Debian and Ubuntu. GRUB then jumps into the kernel code. From that point on, the kernel is code sitting in memory. Nothing reads vmlinuz again while the system is up.
This is the main difference from a userspace service. When you patch Nginx or OpenSSL, you can restart the affected processes and they load the new binary or library. The kernel is not a process you can restart. Every process runs on top of it, and the vulnerable functions stay in RAM, called by the TCP stack, the filesystem layer, or whatever subsystem the CVE affects, until the machine reboots.
The uname -r command reports the running kernel for the same reason. It calls the uname() system call, and the kernel answers from its own in-memory identity, which was compiled into that build. The answer has nothing to do with what is in /boot or what the package database says. /proc/version reads from the same place. If uname -r shows the old version, the old code is what is running.
What a kernel package install changes
vmlinuz and a new module tree under /lib/modules/<new-version>/. It builds a new initramfs. It updates the bootloader configuration so the next boot selects the new entry. Package managers install kernels side by side instead of replacing them, so the previous kernel stays available as a fallback. On dnf-based systems, the number of kernels kept is controlled by installonly_limit.
None of those steps touch the kernel that is already in memory. The new kernel is staged and waits for a reboot.
This staging has a side effect that is easy to miss. If the old kernel package is later removed, for example by an autoremove run, its /lib/modules/<old-version>/ directory disappears while that kernel is still running. Modules that were already loaded keep working. Any module that has not been loaded yet will fail to load, because modprobe looks under /lib/modules/$(uname -r). Such modules include a filesystem driver, a netfilter module, or a storage driver. When a server suddenly cannot mount something or load a firewall module after an update, it is usually telling you the reboot is overdue.
This also explains why two tools can disagree about the same server. Some audit tools check which kernel packages are installed. Others compare the running kernel version against the fixed version in the advisory. That second approach is what the answers in this Unix Stack Exchange thread on confirming RHEL CVE mitigation recommend. A package-based check can report the CVE fixed while a running-kernel check reports it vulnerable. For actual exposure, the running kernel is the one that matters.
There is a second source of confusion. LTS distributions often backport security fixes into an older-looking version number, so a version that looks old can still contain the fix. That topic is covered separately in Thinking uname -r Proves You're Patched Against a Kernel LPE? Check the Changelog. This article assumes you already know which package version carries the fix.
Comparing the running kernel with installed packages
BASH
# Running kernel, reported from memory
uname -r
# Debian / Ubuntu: installed kernel image packages
dpkg -l 'linux-image-*' | grep '^ii'
# RHEL 8+ / AlmaLinux / Rocky: installed kernels, newest install first
# (on CentOS 7 and older, query 'kernel' instead of 'kernel-core')
rpm -q --last kernel-coreuname -r shows something older, the patch is staged but not active. As this guide on checking Ubuntu servers for CVEs puts it, the fixed version needs to be both installed and actively running.
In support work, this comparison is usually the first thing to check when a customer says they already updated and the scanner report comes back unchanged. The update usually worked. The reboot simply never happened.
Confirming a reboot is pending and that it will boot the right kernel
BASH
# Debian / Ubuntu: flag files written by package hooks, if present
cat /var/run/reboot-required /var/run/reboot-required.pkgs 2>/dev/null
# RHEL family: exit code 1 means a reboot is needed
# (older releases: 'needs-restarting -r' from yum-utils)
dnf needs-restarting -r; echo "exit code: $?"
# RHEL family: kernel the bootloader will start on next boot
grubby --default-kerneluname -r comparison from the previous section is the more reliable test.
The default boot entry matters more than people expect. If GRUB_DEFAULT has been pinned to a specific entry, or set to remember the last choice, a reboot can bring the old kernel straight back. On RHEL-family systems, grubby --default-kernel shows the path directly. On Debian and Ubuntu, the setting is in /etc/default/grub, and the resulting menu order is in the generated GRUB config. How those interact depends on the setup. After any reboot, run uname -r again. The version it prints is the only real confirmation.
The kernel you installed may also not be the one the machine runs. Containers such as LXC (including LXC on Proxmox) and OpenVZ share the host's kernel. Inside a container, uname -r reports the host kernel, and installing a kernel package in the container changes nothing. Some VPS platforms also boot the guest with a kernel supplied by the host instead of the one in the guest's /boot. In both cases, the kernel CVE has to be fixed by whoever runs the host. If uname -r never moves no matter what you install, check which of these cases applies before you reboot again.
When live patching is in play
uname -r does not change, so a scanner that compares only the version string will keep flagging a CVE that the livepatch has actually closed. Second, the reverse also happens: an active livepatch does not mean every CVE is covered. Livepatches replace function code, and fixes that change data structure layouts or code that only runs at boot are often not suitable for live patching. Vendors also tend to offer livepatches for a given kernel only for a limited time. Each vendor publishes which CVEs each patch covers, and that list is what you need to check.
BASH
# Upstream livepatch interface: one directory per loaded patch
ls /sys/kernel/livepatch/
cat /sys/kernel/livepatch/*/enabled
# RHEL kpatch: loaded and installed patch modules
kpatch list
# Ubuntu Canonical Livepatch: patch state and fixes applied
canonical-livepatch status --verboseWhat to check before closing the ticket
uname -r against the newest installed kernel and the fixed version in the advisory. If they differ, check whether the server is a container or a VPS booting a host-supplied kernel, then confirm which kernel the bootloader will pick, schedule the reboot, and run uname -r again afterwards. If a reboot is not possible yet, check whether a livepatch is loaded and whether the vendor lists that exact CVE as covered. In both cases, close the ticket only after you have confirmed which kernel is actually running.