Kernel & Driver Differences
Mobile vs Desktop Comparison · Mobile Internals track
5 min read
In this module
A Smaller World
Desktop operating systems have to cope with a sprawling hardware zoo: thousands of graphics cards, network adapters, storage controllers, USB peripherals, sound cards. Every device demands a driver running in kernel space, parsing data from hardware that may or may not be trustworthy. Mobile devices ship with a fixed, known set of components. That single architectural fact reshapes everything about kernel security.
Kernel Driver Model
Linux (Desktop)
Supports thousands of loadable kernel modules (LKMs). Any driver can be loaded at runtime with insmod/modprobe, expanding the kernel attack surface dynamically.
Kernel Architecture Comparison
Both iOS and Android build on established kernel foundations, but they make very different design choices compared to desktop operating systems.
iOS: XNU (Hybrid Kernel)
iOS runs the XNU hybrid kernel, mashing Mach, BSD, and IOKit into a single address space. The iOS variant is clamped down far more aggressively than its macOS sibling. Apple never allowed user-loadable kernel extensions there: its own drivers ship inside the signed kernel collection, and the only third-party driver route is DriverKit, which runs drivers in user space and on Apple's mobile devices is available on iPadOS (from iPadOS 16, for M-series iPads), not the iPhone. Third-party kernel code simply doesn't exist on iOS.
Android: Modified Linux
Android rides a mainline Linux kernel with custom extensions bolted on (Binder, wakelocks). Since Android 12, devices run Google's Generic Kernel Image (GKI): one Google-built kernel per kernel version, with the device's hardware drivers shipped as signed vendor modules that init loads early in boot. After that, SELinux policy stops anything else loading modules, so unlike on a desktop distro there's no insmod for an attacker who gets root later. The driver set is still fixed for the device; it's just packaged as modules rather than compiled in.
Desktop: Full Linux or Windows NT
Desktop Linux happily loads arbitrary kernel modules via insmod/modprobe, and the kernel ships support for tens of thousands of device drivers. Windows NT has a similarly sprawling driver ecosystem, complicated further by third-party driver signing policies that attackers have routinely managed to sidestep.
Driver Attack Surface
The driver ecosystem is where the mobile and desktop kernel attack surfaces diverge most dramatically.
A typical desktop Linux system ships with modules for thousands of devices. Most aren't loaded at any given moment, but the loading machinery itself is sitting right there. A local attacker who can load a kernel module has, by definition, achieved kernel code execution. Windows lives in a similar world and has long suffered from vulnerable third-party drivers (BYOVD attacks) that adversaries abuse for kernel access.
On mobile devices, the driver set is small and fixed:
- iOS: All drivers are Apple-developed and integrated into the kernel. IOKit user clients remain a kernel attack surface, but the total number of drivers is a fraction of a desktop system. No mechanism exists for loading third-party kernel code.
- Android: Drivers are provided by the SoC vendor (Qualcomm, MediaTek, Samsung) and the OEM. While there are more drivers than iOS (due to hardware diversity), SELinux policies restrict which processes can interact with which drivers.
The kernel attack surface is the set of code paths reachable from unprivileged user-space processes. Mobile kernels have a smaller attack surface than desktop kernels due to fewer drivers, no arbitrary module loading, and tighter restrictions on system call availability. Each additional driver in kernel space is a potential entry point for privilege escalation.
System Call Filtering
Mobile operating systems restrict which system calls applications can invoke, further reducing the kernel attack surface:
- iOS: The App Sandbox prevents sandboxed apps from making most system calls directly. Only a curated set of operations is permitted through the sandbox profile.
- Android: Seccomp-BPF (Secure Computing with Berkeley Packet Filter) filters system calls at the kernel level. Apps are restricted to a whitelist of permitted syscalls, and any attempt to call a blocked syscall results in immediate process termination.
Desktop applications usually get unrestricted access to every system call their privilege level allows. A desktop application can fire off any of the hundreds of Linux syscalls or thousands of Windows NT system services without anyone batting an eye.
# Android seccomp filter example (conceptual)# Only these syscalls are allowed for untrusted appsALLOW: read, write, open, close, mmap, mprotect, brk, ioctl(BINDER), sigaction, clone, futex, ...# Everything else: KILL process immediatelyRead-Only System Partitions
A critical difference between mobile and desktop is how the system partition is protected:
- iOS: The system partition is mounted read-only. No process, regardless of privilege, can modify system files during normal operation. Remounting requires a kernel exploit.
- Android: The system partition is protected by dm-verity, which provides block-level cryptographic verification. Any modification is detected at read time.
- Desktop: System files are writable by the root/Administrator user. While modern desktops have integrity features (Windows Resource Protection, macOS System Integrity Protection), they are generally less restrictive than mobile equivalents.
This is why persistence is so much harder on mobile. Desktop malware can edit startup scripts, install services, swap out system binaries. On mobile, the system partition is either immutable or cryptographically verified, so any persistent modification demands a kernel-level compromise.
The viewer at the top of the lesson compared driver models. This one lines up the other three defences from this lesson, plus how a kernel fix actually reaches each device. Turn on side-by-side mode and read across the rows: the desktop columns are the only ones where an ordinary app gets the full syscall table and root can rewrite system files.
Syscall filtering, system integrity and patching
Desktop Linux
Filtering and integrity checking exist, but they're opt-in. A typical distro leaves both off for ordinary programs.
The Convergence Trend
Mobile and desktop security models are quietly converging. macOS has lifted plenty from iOS: System Integrity Protection, signed system volumes, DriverKit. Windows has introduced driver signing requirements and Virtualization Based Security. Desktop is drifting towards the more restrictive mobile model, on the realisation that a smaller, verified kernel surface is just easier to defend.