C Systems ProgrammingDevice Driver DevelopmentKernel DevelopmentLegacy System MaintenanceLinux DevelopmentOpen Source DevelopmentCode Review 2 min read

Linux Developer Proposes Removal of BSD-Compress From PPP Networking Code

A proposed patch aims to remove the abandoned BSD-Compress support from the Linux kernel's PPP implementation due to a long-standing 64-bit accumulator bug.

Linux developer Qingfang Deng proposed a patch on October 28 to remove BSD-Compress support from the point-to-point protocol networking code. The option affected is CONFIG_PPP_BSDCOMP, which is controlled by a decoder bug and a lack of a maintainer.

The decoder bug occurs because the accumulator, accm, is declared as unsigned long while the code assumes it is 32 bits wide. On 64-bit systems, bits already consumed survive the left shift and corrupt the next code, triggering a fatal bad-code error on the first compressed packet during an x86-64 PPP-over-PTY loopback test.

Real-world impact is limited because the pppd daemon prefers Deflate over BSD-Compress. When BSD-Compress is selected and fails, pppd logs "Lost compression sync: disabling compression" and disables the feature, allowing the link to stay up and traffic to continue uncompressed.

The affected code dates back to the introduction of the decompression routine in Linux 1.3.33 in 1995 and the core compression routine in Linux 2.1.67 in 1997. Although later commits modified module integration, kernel APIs, metadata, allocation hardening, and code organization, none fixed the accumulator width, and a related 2024 report only resulted in review suggestions rather than a fix. Furthermore, the PPP protocol drivers and compressors are currently orphaned without an assigned maintainer, and the removal patch remains pending review on the netdev mailing list.