The Sysctl That Turns Write-Anywhere Into Root: Breaking an Embedded Root of Trust
The clock was sixty minutes wrong because a menu entry lived on a memory card that had been thrown away. Not a setting that was hidden, not a timezone table tha...
The Clock Was Locked Behind a Menu on a Removable Disk
The clock was sixty minutes wrong because a menu entry lived on a memory card that had been thrown away. Not a setting that was hidden, not a timezone table that was stale — the pointer telling the head unit how to open its own Settings applet was read from removable media, and without that media the device had no path to its own configuration.
The unit is a TomTom Carminat LIVE, the navigation hardware fitted to a 2014 Renault Latitude, hardware codename beaumont. It runs NavCore 9.884 on a Samsung S5P6440 SoC under Linux 2.6.28.10 with uClibc and Upstart. When Estonia moved from UTC+3 to UTC+2, the owner went looking for the time setting and found two Settings buttons on the dash: one opened a Bluetooth and phonebook menu, the other answered every press with No maps detected!.
- Firmware: NavCore 9.884, build 1609031, released as
NFA2.8-RC06 - Kernel:
2.6.28.10-tt1574740, toolchain gcc 4.3.3 - Storage: internal eMMC at
/dev/mmcblk0, user SD at/dev/mmcblk1 - Time source: SiRF3 GPS on
/dev/ttySAC2, stored as a local offset in minutes
The coupling is the design decision worth arguing about. Map data is a licensed product: TomTom sells it, so TomTom protects it with a DRM check that validates the SD card's CID — the factory-burned serial in the card's CID register that no tool can rewrite — plus file signatures bound to that specific CID. Copying the files to a blank card produces a card the unit rejects. That part is coherent. What is not coherent is that the menu definition for the Settings applet rides on the same licensed artifact. A licensing control became a functional dependency of the control plane.
Trade-off, stated plainly: the DRM protected a revenue stream and cost the device its own settings surface. A replacement card shipped to Estonia would have run roughly 60 EUR, which is the price the owner declined to pay for the privilege of changing a clock offset. That refusal is where the security architecture starts to matter.
Four Enforcement Points, Each Gating Exactly One Syscall
The update path is the first wall. Firmware arrives as a ttsystem file that is an ext3 image of the root filesystem, and the device flashes vanilla images happily. A modified image never installs, and the reason is visible in the file layout: high-entropy data appended after the filesystem, then a run of zero blocks, then 40 high-entropy bytes. Forty bytes is two 20-byte integers — the shape of a DSA signature over SHA-1. The verifying binary does not live in the image; it lives in the recovery partition, which the researcher did not have. You cannot attack a check you cannot read.
The runtime posture is stronger than the 2011 vintage suggests. Every writable mount carries noexec, most carry nosuid,nodev as well, and the root filesystem is an ext2 loop mount pinned read-only:
/dev/loop0 on / type ext2 (ro,noatime,nodiratime,errors=continue)
/dev/mmcblk0p3 on /mnt/flash type ext3 (rw,sync,nosuid,nodev,noexec,data=ordered)
/dev/mmcblk1p1 on /media/sdcard type vfat (rw,sync,nosuid,nodev,noexec,fmask=0022)
/dev/loop1 on /media/loopback type ext3 (rw,nosuid,nodev,noexec,commit=3600,data=journal)
none on /mnt/movi type unionfs (rw,nosuid,nodev,noexec,dirs=/media/loopback=rw:/media/sdcard=ro)
The unionfs line is the interesting one. The base FAT32 card mounts read-only at /media/sdcard and an ext3 filesystem stored as a file on that same card mounts read-write at /media/loopback, then unionfs stacks them at /mnt/movi with the writable layer on top. The likely motive is data=journal on the upper layer, which survives power loss far better than data=ordered — a reasonable choice for a device that gets its power pulled at the ignition switch. The consequence is that the card is simultaneously a read-only media volume and a read-write filesystem, and every path through it is still noexec.
Then there is master.script, a boot-time automation script in a custom language, parsed by a binary called ttn that runs as root. It is loaded from the external SD card on every boot. Reverse engineering it surfaced two primitives that individually look useless:
SHEXpasses an arbitrary argument tolaunchserver, whichexecves it — but accepts a single whitespace-delimited token, so you choose which binary runs, never its arguments.LOGtruncates a file named by aLOGFILEdefine and writes one line to it, as root, with no canonicalization of the path — but the payload is restricted to bytes0x20–0x7E, so no binary.
Four controls, four syscalls. Signature verification gates the flash write. Read-only rootfs gates persistence. noexec gates direct execution. The single-token parser gates argument injection. Each is a correct implementation of the thing it checks. None of them checks the composition.
noexec Gates execve, Not Interpretation
The natural next move is to point SHEX at a shell script on the card. That fails, and the failure is instructive. execve on a path whose mount carries MNT_NOEXEC returns EACCES before the #! line is ever read; the kernel's path_noexec() check runs against the mount the file was opened through, not against the path string you typed. On the same kernels, a noexec mount also refuses mmap with PROT_EXEC, which is why invoking ld-linux.so directly against a binary on that mount fails with failed to map segment from shared object: Operation not permitted instead of executing.
Now point SHEX at /bin/sh — a binary that lives on the read-only rootfs, where no such restriction applies — and let sh open the script as data. execve is called on /bin/sh, which is permitted. The script is a file sh reads. Reading is not executing, and noexec was never in the read path. The token limit still bites, because SHEX takes one token and /bin/sh /media/sdcard/payload.sh is two.
That is the point where the mount table stops looking like a wall. The same gap shows up in every environment that over-trusts the flag: a noexec scratch directory blocks ./payload and permits python3 payload.py, node index.js, and sh payload, because the interpreter is the executable and the script is input. The mount option raises the cost of one technique; it does not remove the ability to run code.
What the researcher had at this point was a write primitive and an exec primitive that could not be combined through the file system. LOG with LOGFILE ../../proc/sys/kernel/core_pattern writes arbitrary printable ASCII to any path on the device as root — a classic path traversal in a log writer, load-bearing only because the writer runs as root and nothing canonicalizes the target. SHEX /bin/dbus-monitor runs one binary with no arguments. Neither is code execution. Together they are, but not by any mechanism either control was designed to consider.
The reason to keep reading the mount table after the bypass is that it tells you where the author's attention went. Read-only rootfs and noexec everywhere is the work of someone thinking about persistence and about dropped binaries. Nobody was thinking about the kernel as an execution engine, which is exactly the class of primitive a 2.6 kernel hands out for free.
core_pattern Is a Root-Spawn Primitive Wearing a Filename's Clothes
/proc/sys/kernel/core_pattern reads like a naming template. It is a template, until the first character is |, at which point the rest of the line is a command the kernel runs when a process dumps core, with the dump piped to its standard input. Arguments after the program name are supported since Linux 2.6.24 and are whitespace-delimited; this kernel is 2.6.28, one minor release of margin. The handler is started through call_usermodehelper, so it runs as root, in the initial namespaces, as a child of the kernel's helper thread — not as the crashing process, and not with its privileges. RLIMIT_CORE is explicitly not enforced for the pipe path, so a zero core limit on the crashing process changes nothing.
None of that is a vulnerability. It is a documented interface, and on a desktop it is how systemd-coredump receives dumps. The vulnerability is that the sysctl is writable from userland by any process with permission on the file, that it is global rather than namespaced, and that on this device a root-running script parser accepted a path-traversal write.
The composition is four lines of the device's own automation language:
#define LOGFILE ../../proc/sys/kernel/core_pattern
LOG |/bin/sh /media/sdcard/payload.sh
SHEX /bin/dbus-monitor
LOG writes the pipe line. SHEX starts dbus-monitor, which aborts with SIGABRT on this unit because there is no system bus to connect to. The kernel handles the coredump, spawns /bin/sh — permitted, because /bin/sh is on the rootfs, not on the noexec card — and runs payload.sh as root. The trigger took work to find: crashing the script parser or the UI would reboot the whole unit and kill the payload, so the researcher ran every binary on the system under QEMU until one died quietly. A device that reboots on any crash converts every denial of service into a dead end and still leaves one process that fails without taking the session with it.
From there the work is ordinary. dd the internal eMMC for a full image, find /mnt/flash/settings.dat, reverse the custom binary format, discover the unit has no timezone concept at all — it takes UTC from GPS and stores a local offset in minutes — and change 180 to 120.
This is not a 2011 artifact. core_pattern is still host-global and still not namespaced in 2026, and it is still the shortest path from a writable procfs to host root. The November 2025 runc advisories — CVE-2025-31133, CVE-2025-52565, CVE-2025-52881 — let an otherwise unprivileged container bind-mount attacker-controlled paths over masked procfs entries, exposing a writable /proc/sys/kernel/core_pattern; detection content shipped for it in 2026 because default rule sets did not cover the file. A car head unit from 2011 and a container runtime from 2025 fail on the same syscall for the same reason: the primitive is old, documented, and nobody gates it.
What the Unit Should Have Gated Instead
The first rule is that a configuration surface must not depend on a licensed artifact. Menu definitions are control-plane data; map data is a product. Fusing them means the DRM's availability model becomes the device's availability model, and a customer who declines to buy a card loses the ability to set a clock. The enforcement point that decides whether you own your own settings menu should be the firmware, which is already signed.
The second rule is to gate the primitive rather than the call site. noexec gates execve; the control that was missing is a gate on "the kernel spawns a root helper". On a modern Linux system that gate exists and is one line of unit configuration:
[Service]
ExecStart=/usr/bin/ttn /media/sdcard/master.script
NoNewPrivileges=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ReadOnlyPaths=/proc/sys
SystemCallFilter=@system-service
SystemCallErrorNumber=EPERM
ProtectKernelTunables plus ReadOnlyPaths=/proc/sys makes the sysctl write fail with EROFS before any permission check runs, and the write is the entire attack. On a 2.6.28 unit with Upstart there is no systemd to declare it, so the same property has to be built by hand: remount /proc/sys read-only in the init script, and run ttn as an unprivileged uid with the log directory as its only writable path. The real defect was never the missing mount option — it was an interpreter of removable-media content running as root with no LSM, no seccomp, and no privilege boundary to cross.
The third rule is that a writable path must be an allowlist entry compared after canonicalization, not a relative path joined onto a prefix. LOGFILE ../../proc/sys/kernel/core_pattern is a traversal bug only because the writer was root; it becomes a privilege escalation because the destination was a kernel interface. Any log writer that runs with privileges needs realpath() on the resolved target and a prefix comparison against its own directory, and a refusal path that fails closed.
The fourth rule is the one the device got accidentally right and most designs get wrong: the verifier lived in a partition the attacker could not read, which is why a signed image held. Applying the same reasoning that makes a peripheral's protocol boundary its real security boundary, the verifier should also be the only component permitted to write kernel execution interfaces — one component, one capability, no path from parsed input to that capability. Where a vendor shortcut contradicts the documented contract, as in the register-preservation contract on Apple's M4, assume the implementation wins and place the gate where the hardware cannot route around it.
Sixty minutes of clock drift was the visible symptom. The root cause was a signed root filesystem with noexec on every writable mount and a global sysctl that converts a printable-ASCII write into root execution — four correct controls that were never evaluated as a set.