25-year-old BSD bug found and fixed

A Unix developer has discovered and fixed a filesystem bug in Berkeley Software Distribution, a widely used, open-source, Unix-like operating system, discovering in the process that the bug was at least 25 years old.

BSD's variants include OpenBSD, FreeBSD and NetBSD, and it forms the basis of Apple's Mac OS X operating system. All BSD derivatives were found to contain the bug, according to Marc Balmer, a Swiss developer closely involved with OpenBSD.

"Much to my surprise, I not only found this problem in all other BSDs or BSD-derived systems, like Mac OS X, but also in very old BSD versions," Balmer wrote in a Web site post on the issue. "The bug has been around for roughly 25 years or more."

The discovery of the bug sheds light on the process of maintaining and developing open-source software, which is handled by distributed developers rather than centralised teams, as is usual in the case of proprietary software.

Balmer said he was alerted to the problem by an OpenBSD user who found that Samba, an open source networking protocol, would crash when serving files from a filesystem using Microsoft Disk Operating System (MS-DOS) formatting.

He found that the problem was not with Samba but with OpenBSD itself, and that the bug was known to Samba developers. "Samba... uses a workaround, or replacement code, to access directories on the BSDs, since the directory reading code in all BSDs was flawed," Balmer wrote.

The problem was with the *dir() group of commands, such as telldir() and seekdir(), used to handle, open, read and interpret directories, according to Balmer.

After lengthy experimentation, he found that, if directory entries are deleted at a certain stage, the telldir() command returns errors and can crash programs. "This code will not work as expected when seeking to the second entry of a block where the first has been deleted," Balmer wrote.

He cited an e-mail from Kirk McKusick, the author of the original *dir() library, indicating that the bug may have been in the library from its initial version.

The long delay in fixing the problem is probably due to the fact that it does not surface often and that other programs, such as Samba, have created workarounds, according to Balmer.

After the long discovery time, the fix itself was "surprisingly simple", Balmer wrote, and will now be incorporated into OpenBSD and other operating systems using the same code.

"Sorry that it took us almost 25 years to fix it," Balmer wrote.

The OpenBSD project released version 4.3 earlier this month, featuring a large number of new drivers, software packages and bug fixes.

Advertisement

Talkback 1 comments

  1. Bugs - the root cause and what we don't see M@TT -- 14/05/08

    gee... I wonder how many other "unreported" bugs there are - with software makers creating work arounds in preference to reporting the issue and having the root cause fixed.


ZDNet's CIO Vision Series

Customs | Murray Harrison, CIO

Australian Customs CIO Murray Harrison dislikes SLAs and runs away if a vendor talks to him about innovation. In this interview, he also explains why getting excited about gadgets can be dangerous and talks about how Customs' outsourcing strategy has evolved.

Sponsored content

Power Centre - Content from our premier sponsors

Blogs

  • Munir Kotadia iPhone suckers test our patience
    So how many of you have bought a 3G iPhone? Do you feel like a sucker? If you don't, maybe you will once your first bill arrives.
  • Array Westpac bank: AVG's toughest competitor
    The next time you're buying antivirus software, don't go direct to Symantec or McAfee. Don't download free antivirus. And definitely don't see Harvey Norman. Ask your bank — they're quite literally giving the stuff away.
  • Array Will you manage in the exabyte era?
    Mammoth growth in storage volumes is a fact of life, but even so it's helpful to pause occasionally and try and work out whether our information strategies have fallen hopelessly out of step with the pace of technological growth and changes in costs.
  • More blogs »

Tags

Back to top

Featured