Skip to main content
RunBook Academy

LinuxX · Kernel ManagementKernel logs

Kernel logs, taint flags, and oops decoding

Intermediate⏱ ~10 minbashdmesgjournalctl

What you'll learn

  • Read dmesg output and understand its severity prefixes
  • Identify kernel taint flags and what they mean
  • Recognise a kernel oops and extract the relevant information
  • Decide when a kernel oops requires escalation

Prerequisites

Verified against Ubuntu 24.04 LTS · Debian 12 (Bookworm) · RHEL 9.x · Rocky Linux 9.x · AlmaLinux 9.x · Linux kernel 6.1 LTS / 6.6 LTS · systemd 255+ · OpenSSH 8.7p1 (RHEL 9) / 9.6p1 (Ubuntu 24.04) · nftables 1.0.x · chrony 4.x · Pacemaker 2.1.x · Corosync 3.1.x · 2026-08-09

Not yet marked complete on this device.

The kernel logs to a ring buffer exposed as /dev/kmsg. Reading that buffer is how you investigate hardware, driver, and filesystem issues that originate below userspace.

Reading dmesg output

Read-only / Safedecode taint
$ cat /proc/sys/kernel/tainted; echo see-table-below-for-decoding
12289
K,B,G

Illustrative output

Kernel oops

A kernel oops is the kernel’s “something went wrong, but I am trying to continue” message. Unlike a panic (which halts), an oops may kill the offending process and continue — but the kernel is now tainted.

Read-only / Safekernel oops
$ dmesg | grep -A 5 -i 'oops'
[12345.678] BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
[12345.678] PGD 0 P4D 0
[12345.678] Oops: 0002 [#1] SMP PTIT
[12345.678] CPU: 2 PID: 1234 Comm: myapp Tainted: G        W        6.6.31-linuxkit
[12345.678] RIP: 0010:[<ffffffffc0deadbeef>]
...

Illustrative output

The discipline for oops:

1; capture the full oops output (photo or serial capture). 2. Check the taint flags — was the kernel already in a problematic state? 3. Check mcelog (or rasdaemon) for hardware-level errors if the oops is a machine check. 4. Look up the oops code in the kernel source (kernel.org git). 5; test on a clone host before applying any fix.

When to escalate

A kernel oops is always worth investigating. The escalation threshold depends on the symptoms:

SymptomEscalation
One oops, no service impactFile an internal bug; investigate on the next maintenance window
Repeated oops, same code pathOpen a vendor / kernel bug immediately; the issue is real
Oops + service crashesTreat as an incident; engage the on-call
Oops + filesystem corruptionStop writes; engage storage team; prepare for restore
Oops + machine check exceptionHardware fault suspected; engage hardware vendor

Knowledge check

Knowledge check · 3 questions

  1. Q1. What does `journalctl -p err -k` show?

  2. Q2. A tainted kernel is unusable for production.

  3. Q3. Which of the following are correct kernel-log practices? Select all that apply.

Passing score: 75%. Answers are checked in this browser.