Linux Kernel & OS

Linux kernel patch proposes removing BSD-Compress from PPP networking code

Key Takeaway

A proposed kernel patch would remove BSD-Compress from Linux PPP due to a 64-bit accumulator width bug causing fatal decompression errors in code unchanged since 1997.

Summary

Linux developer Qingfang Deng has submitted a patch to remove BSD-Compress support from the kernel's Point-to-Point Protocol (PPP) networking subsystem. The compression method, enabled via CONFIG_PPP_BSDCOMP, contains a fundamental decoder flaw where the accumulator variable is declared as unsigned long rather than the assumed 32-bit width, causing leftover code bits to corrupt subsequent decompression on 64-bit architectures. An x86-64 PPP-over-PTY loopback test reliably triggers a fatal bad-code error on the first compressed packet.

The BSD-Compress compression routine has not changed since Linux 2.1.67 in 1997, and the decompression routine dates to Linux 1.3.33 in 1995. The PPP protocol drivers and compressors are currently orphaned in the kernel with no active maintainer. When the bug triggers, pppd falls back to uncompressed operation after logging a compression sync loss, so links remain functional but without compression. The removal patch is now under review on the netdev mailing list.

The BSD-Compress decoder bug and removal rationale

  • 64-bit accumulator width mismatch: The decoder declares accm as unsigned long (64-bit on x86_64/ARM64) but assumes 32-bit behavior, causing consumed code bits to survive left-shift operations and corrupt the next decompression code.
  • Fallback behavior: When BSD-Compress fails, pppd logs "Lost compression sync: disabling compression" and continues the link uncompressed, avoiding total connection loss.
  • Historical code stagnation: The core compression routine is unchanged since 1997 and decompression since 1995, with only peripheral maintenance (module integration, API updates, allocation hardening) applied since.
  • Orphaned subsystem: The entire Linux PPP protocol and compressor stack lacks active maintainers, and a 2024 review suggestion to use unsigned int was never implemented.

Why it matters

Removal of BSD-Compress would eliminate a rarely-used legacy compression method that modern pppd already prefers Deflate over during negotiation. For Linux distributions and embedded systems still relying on PPP for dial-up, cellular, or VPN tunnels, this change reduces attack surface and removes a latent source of silent data corruption on 64-bit systems. The orphaned state of Linux PPP raises broader questions about maintenance of legacy networking subsystems in the kernel.

Original reference: www.phoronix.com →