If you still look after an old CentOS or RHEL 6/7 box, this one’s for you.

At a glance

  • CVE: CVE-2017-1000253. Qualys, who found it, called it “Linux PIE/stack corruption”.
  • Severity: 7.8 (High) on NVD, and Red Hat rates it Important. That score assumes the attacker already has a local account, though. Nobody can fire this at your server over the internet.
  • Affected: any kernel that never picked up a fix from April 2015. Upstream, that’s 2.6.25 up to (but not including) 3.10.77, 3.12.43, 3.14.41, 3.16.35, 3.18.14, 3.19.7 and 4.0.2, plus the old 3.2 and 3.4 branches. In practice, Qualys says the big ones were every version of CentOS 6 and RHEL 6, CentOS 7 before 1708, and RHEL 7 before 7.4. Ubuntu 16.04 and newer were never affected.
  • Known exploited: Yes. CISA added it to its Known Exploited Vulnerabilities (KEV) catalog on 2024-09-09, and says it’s known to be used in ransomware campaigns.

What’s going on

When Linux starts a program, the kernel lays its pieces out in memory and leaves a gap between the program and its stack. For position-independent executables (PIEs), it didn’t reserve enough room for the whole binary. A program with a big enough data segment could end up partly mapped on top of its own stack, so the two would overwrite each other.

On its own, that’s just a strange crash. The danger comes with privileged programs. If an attacker can run a SUID-root (or otherwise privileged) PIE binary and set things up just right, they can turn that corruption into running their own code with that program’s privileges. Qualys showed it on CentOS 7 using ping, which has extra network capabilities there.

In web-server terms, this is a local privilege escalation. It won’t let anyone in from outside. But if an attacker already has a foothold, say a shell as www-data or apache through a vulnerable plugin or upload form, this bug is a way to climb from that account to root and own the whole box.

The odd bit of history: the kernel fix landed in April 2015 and went into Linux 3.10.77 that May, but nobody flagged it as a security problem at the time. So long-term distro kernels like CentOS’s and RHEL’s didn’t pick it up until Qualys published in September 2017.

Timeline

  • Fixed upstream: 2015-04-14 (commit a87938b2e246, backported to Linux 3.10.77 in May 2015)
  • RHEL 7.4 ships with the fix: 2017-08-01 (kernel 3.10.0-693)
  • Disclosed: 2017-09-26 (Qualys advisory, with Red Hat updates for RHEL 5, 6 and older 7.x releases the same day)
  • Published to NVD: 2017-10-05
  • Added to CISA KEV: 2024-09-09, about seven years after disclosure

== UPDATE ==

Patches have been out for years, so this is mostly about finding the stragglers.

  • Patch available: Yep. Upstream since 2015, and for the enterprise distros since September 2017.
  • Fixed in: upstream 3.10.77, 3.12.43, 3.14.41, 3.16.35, 3.18.14, 3.19.7, 4.0.2 and anything newer. On the distro side: RHEL/CentOS 7 kernel 3.10.0-693 (7.4) or later, RHEL 6 kernel 2.6.32-696.10.3.el6 or later (RHSA-2017:2795), Ubuntu 14.04 kernel 3.13.0-57.95, Debian 7 “wheezy” 3.2.71-1 and Debian 8 “jessie” 3.16.7-ckt11-1. Your distro’s tracker (linked below) has the exact package for your release.
  • How to apply: install your distro’s latest kernel and reboot into it. On CentOS/RHEL 6 or 7 that’s sudo yum update kernel; on Debian or Ubuntu it’s sudo apt update && sudo apt upgrade. After the reboot, run uname -r to make sure you’re really on the new kernel. And if a box is still on a kernel this old, it’s worth planning a move to a currently supported release too.
  • If you can’t patch yet: Red Hat’s workaround is to switch to the legacy memory layout, which keeps program mappings well away from the stack. Add vm.legacy_va_layout = 1 to /etc/sysctl.conf and run sudo sysctl -p. Red Hat warns that some apps that need a large address space (certain databases, for example) may not cope with it, so test before you roll it out.

References