OpenBSD Journal

[c2k8]: Hackathon Summary Part 6

Contributed by mtu on from the i-love-baklava dept.

c2k8 General Hackathon (Part 6) - June 7-15, 2008, Edmonton, Alberta, Canada

When you have a developer like this on the team, even if you don't know anything about OpenBSD, you know that there must be something special about it to attract the likes of him.

Can Erkin Acar

Read on to learn why this developer is so unique:

canacar

Can Erkin Acar (canacar@) has a really beautiful name. His cvs account name is just as nice. It's normal for everyone in the developer community to call or reference each other by their cvs account name. I've heard some refer to one developer as "unpronounceable"; referring to his really difficult to pronounce cvs account name. Anyhow, I was curious how to pronounce Can's real name. It turns out that "Can" is pronounced somewhat like "John" as "C" in Turkish is more like "J" in English. I'm sure that developers will still call him "canacar" with a hard "C", but at least now, they know how to pronounce his first name properly :-).

Can

Can has been around for a long time and besides his unique name, so far he and Okan Demirmen (okan@) are the only two Turkish developers in OpenBSD. I often wonder why we don't have more developers from other countries. I'm not referring to smaller countries but the larger ones such as China and India with large populations. Obviously, it helps to be able to communicate in English. I'm not sure about China, but I know that most educated people in India learn English. They even have a thriving IT sector. Granted, the OpenBSD developer and user community may not be the most maternal of communities but there must be other reasons.

The OpenBSD developer community have the following mantra: "shut up and hack(code)". Can articulated this nicely here when he said, "...OpenBSD does not run on requests, or polls or democracy." It is a meritocracy of sorts. People who use or follow OpenBSD know this quite well. However, it may be somewhat difficult for people new to the Project, and especially so if they are not very comfortable communicating in English. It gets even more complex when one considers cultural differences. The n2k8 hackathon was the first mini-hackathon in Asia and a great example of what an Asian cultural exchange can be like. I look forward to more of them; cultural exchanges and more code :-).

Of the most notable things that Can brought to OpenBSD was pftop and a lot of work on kernel pppoe(4), acpi(4) and tcpdump(8). As you will read below, Can is all over the place improving OpenBSD. Here is what Can had to say about his time at the c2k8 hackathon:

jordan, mark and marco

When I am not slacking, I work on bits and pieces all around the kernel and userland. This hackathon was no different, and I had great time meeting with old and new friends, and doing some fun and enjoyable work. Below are the main things I worked on during the hackathon.

== ACPI ==

I started working on the ACPI code three years ago. At that time my main motivation was to get the wireless button on my MSI laptop working. It was one of the earlier versions of the ACPI code and Jordan Hargrave (jordan@) and Marco Peereboom (marco@) rewrote the parser two more times since then.

The final version of the parser was committed just before the hackathon and it worked much better then the previous versions. The first thing I did at the hackathon was to hunt for some memory leaks. I managed to track down and fix some of it, and when Jordan arrived, a couple of days later, he already had a fix for the remaining leaks.

gklok

With the memory leaks out of the way, Jordan worked on and committed some interpreter optimizations that prevent nested conditionals to use a lot of scopes. Gordon Willem Klok (gwk@) worked on improving CPU frequency settings through ACPI. I started tracking down some brightness control issues, Marco fixed some other remaining bugs, and on the last day it was decided that the parser was stable enough. Work has now started on suspend/resume support. As Bob loves to say, "suspend is easy, resume is the problem".

todd
Since I worked on kernel BPF packet capture interface and the tcpdump program, I usually end up being the point of contact for tcpdump related issues. Todd Fries (todd@) reported a problem where tcpdump was reporting "truncated-ip6 - 48 bytes missing" when listening to IPv6 traffic on the enc0 interface (which is used for IPSec).

I could not find any problems on the bpf->libpcap->tcpdump path. Once Todd set up an ipv4-in-ipv6 IPSec tunnel for testing, it was relatively easy to trace the issue to the following fragment of code in the kernel IPSec code in netinet/ipsec_input.c

@@ -427,8 +427,7 @@
  		}

   		ip6 = mtod(m, struct ip6_hdr *);
-		ip6->ip6_plen = htons(m->m_pkthdr.len -
-		    sizeof(struct ip6_hdr));
+		ip6->ip6_plen = htons(m->m_pkthdr.len - skip);

  		/* Save protocol */
  		m_copydata(m, protoff, 1, (unsigned char *) &prot);

However, this did not fix the problem. No change at all. After many more attempts, I managed to spot this fragment a few lines earlier in the code:

@@ -412,7 +412,7 @@

  #ifdef INET6
  	/* Fix IPv6 header */
-	if (af == INET6)
+	if (af == AF_INET6)
  	{
  		if (m->m_len < sizeof(struct ip6_hdr) &&
  		    (m = m_pullup(m, sizeof(struct ip6_hdr))) == NULL) {


the rules
We basically looked at this fragment hundreds of times without realizing that the check was not using the correct #define. We traced this error back to the first version of the file, committed about 8.5 years ago:

   1.1  (angelos  09-Dec-99):  if (af == INET6)

The incorrect condition skipped some extra checks on the IPv6 headers and was only really visible in tcpdump. The inner packet made it into the stack just fine, minus a few sanity checks. A quick search on the whole kernel for similar INET and INET6 misuse did not find any other issues.

== Systat ==

more crypto anyone?
A long time ago, I have written a utility called 'pftop' for realtime visualizing the 'pf' packet filter in OpenBSD. I continue to maintain and add features to it. It has a quite flexible text-based display code that can be used to present information in tables interactively.

More recently, I did some work to modify the systat(1) utility to use the display engine of pftop. The result was a systat implementation that can also display 'pf' states, and contains more 'modern' features such as the ability to scroll lists.

At this hackathon, I got an OK from Theo to commit my systat changes. It is now a part of the base system. It took about 2 minutes before I got my first bug report. It is still under development, and not really 100% compatible with the previous systat commands. I will be working on it to add the missing functionality, and new features.

== APS sensor ==

a table like any other
IBM/Lenovo Thinkpad computers which are quite popular among OpenBSD developers feature an Active Protection System (APS) that shuts down the hard drive when the notebook is shaken or dropped. This is done by accelerometers inside the laptop. The interface to the accelerometers was reverse engineered some years back by some engineers at IBM (I have no idea why they had to reverse engineer their own product).

From these specifications, a driver for the accelerometer was written for Linux, and later for BSDs.

Can
The OpenBSD driver did not work on my T61, and I was meaning to look at it for some time. I found the opportunity on the last day, and using some documentation referenced from the Linux driver, I updated our driver to correctly use the underlying embedded controller interface, and also fixed the detection of the newer Thinkpad models.

This work is not yet committed, mainly because I need to test its interaction with the ACPI which also accesses the same embedded controller to do its work.

Can

I would like to thank Can for bringing us pftop. He continues to fix bugs besides adding features in the kernel and in userland. Maybe one day, we may be able to enjoy a mini-hackathon in Turkey ;-).

(c2k8 hackathon summary to be continued)

(Comments are closed)


Comments
  1. By Anonymous Coward (89.77.162.243) on

    Yet again, thanks for all these nice little pieces, they make the developers look almost human :)

  2. By Shane J Pearson (203.20.79.132) on

    Thank you canacar@! I use pftop lots, especially to watch if my altq changes are working!



    BTW, an opened Linksys router at an OpenBSD hackathon? That looks interesting!

    I'd love to be able to give family and friends a decent firewall on the cheap that I would not have to fight with.

    Would it be a leap of faith to think that OpenBSD might soon run on these cheap devices?

    Comments
    1. By Anonymous Coward (203.106.61.120) on

      Are they replacing linksys firmware with OpenBSD?

    2. By Anonymous Coward (79.114.19.210) on

      >
      > BTW, an opened Linksys router at an OpenBSD hackathon? That looks interesting!
      >
      > I'd love to be able to give family and friends a decent firewall on the cheap that I would not have to fight with.
      >
      > Would it be a leap of faith to think that OpenBSD might soon run on these cheap devices?
      >

      A friend more experienced with nmap told me he run it agains a Trendnet router and the report was OpenBSD 2.0 (http://www.trendnet.com/ - the simplest model from the list, 1 year ago, version E i think).

  3. By Anonymous Coward (129.174.114.180) on

    I wonder what the story was behind the added rule that kjell will smash things that beep for more than 5 minutes.

    Comments
    1. By Laurent Fanis (laurent@) on http://lfx.amsterdamage.nl

      > I wonder what the story was behind the added rule that kjell will smash things that beep for more than 5 minutes.

      Also in a room full of equipment it take some tiem to detect the beeper!
      You had to be there to feel the hate!!

  4. By Laurent Fanis (laurent@) on http://lfx.amsterdamage.nl

    Thank you mtu@ for another great story.
    When are we going to have the story about Bob the NFS hacker?
    In case i get axe murdered for my comment :
    I never wanted to do this job in the first place!
    I... I wanted to be... A LUMBERJACK! Leaping from tree to tree!....

  5. By Anonymous Coward (91.21.102.100) on

    "I think the OpenBSD crowd is a bunch of masturbating monkeys, in that they make such a big deal about concentrating on security to the point where they pretty much admit that nothing else matters to them."

    Linus Torvalds

    http://article.gmane.org/gmane.linux.kernel/706950

    Comments
    1. By Anonymous Coward (89.77.162.243) on


      > http://article.gmane.org/gmane.linux.kernel/706950

      notwithstanding the off-topic nature here, the thread is actually quite hilarious with Linus and Greg KH jumping through RMS-sized hoops. cheers for the link :)

    2. By Anonymous Coward (83.226.152.62) on

      > "I think the OpenBSD crowd is a bunch of masturbating monkeys, in that they make such a big deal about concentrating on security to the point where they pretty much admit that nothing else matters to them."
      >
      > Linus Torvalds
      >
      > http://article.gmane.org/gmane.linux.kernel/706950

      This quote deserves to be put on a t-shirt. \o/

      Comments
      1. By Anonymous Coward (85.222.21.198) on

        > > "I think the OpenBSD crowd is a bunch of masturbating monkeys

        http://www.youtube.com/watch?v=ciLllSAcF-8&feature=related

      2. By Anonymous Coward (128.171.90.200) on

        > This quote deserves to be put on a t-shirt. \o/

        Someone must have heard you ...
        http://masturbatingmonkeys.com/

    3. By Anonymous Coward (128.171.90.200) on

      "It makes "heroes" out of security people, as if the people who don't just fix normal bugs aren't as important.

      In fact, all the boring normal bugs are _way_ more important, just because there's a lot more of them."

      He obviously does not get the OpenBSD approach to security.

    4. By Anonymous Coward (66.39.160.90) on

      > "I think the OpenBSD crowd is a bunch of masturbating monkeys, in that they make such a big deal about concentrating on security to the point where they pretty much admit that nothing else matters to them."
      >

      Linus is mistaken that OpenBSD concentrates on security to the expense of all else. The idea is just absurd. But it's based on the common misconceptions of OpenBSD over the years. With the head way that is being made lately, I think OpenBSD gets harder and harder to ignore or pass off like this.

      It's pretty ironic that, aside from this comment, Linus' stated ideas about security are basically the same as Theo's. e.g. they are just like any other bug, and should be dealt with without special treatment. and things like "the fix is the disclosure..."

      It's also pretty funny how the rest of you idiots on here just further Linus' bombast with your own against him. The fact that Linus Torvalds is more important to the world at large than J. Random Idiot who posts bombast on undeadly.org means that your bombast is less important. In fact, nobody wants to hear it. Nobody cares. Please shut the fuck up.

      Comments
      1. By Anonymous Coward (89.77.162.243) on

        "In fact, nobody wants to hear it. Nobody cares. Please shut the fuck up."

        That goes pretty much for your rant as well, doesn't it? I fail to notice any bombast here except yours. Perhaps you meant wombat?

      2. By Ed Ahlsen-Girard (164.111.78.96) girarde@alum.rpi.edu on

        > It's pretty ironic that, aside from this comment, Linus' stated ideas about security are basically the same as Theo's. e.g. they are just like any other bug, and should be dealt with without special treatment. and things like "the fix is the disclosure..."
        >
        > It's also pretty funny how the rest of you idiots on here just further Linus' bombast with your own against him. The fact that Linus Torvalds is more important to the world at large than J. Random Idiot who posts bombast on undeadly.org means that your bombast is less important. In fact, nobody wants to hear it. Nobody cares. Please shut the fuck up.

        Linus says later, "To me, security is important. But it's no less important than everything
        *else* that is also important!"

        Of course, if everything is important, nothing is.

      3. By Paul 'WEiRD' de Weerd (weerd) weerd@weirdnet.nl on http://www.weirdnet.nl/

        > > "I think the OpenBSD crowd is a bunch of masturbating monkeys, in that they make such a big deal about concentrating on security to the point where they pretty much admit that nothing else matters to them."
        > >
        >
        > Linus is mistaken that OpenBSD concentrates on security to the expense of all else. The idea is just absurd. But it's based on the common misconceptions of OpenBSD over the years. With the head way that is being made lately, I think OpenBSD gets harder and harder to ignore or pass off like this.

        It's true, OpenBSD security is a (very cool and useful) by-product of a focus on correctness. Focussing on correctness (using interfaces the way they are meant to be used, fixing interfaces that are flawed etc.) fixes bugs allsorts, including security bugs.

        > It's pretty ironic that, aside from this comment, Linus' stated ideas about security are basically the same as Theo's. e.g. they are just like any other bug, and should be dealt with without special treatment. and things like "the fix is the disclosure..."

        I don't believe this to be true. Yes, all bugs get the attention they deserve and they all end up being fixed. But a typo in a manpage (hey, it is a bug) is different than an off by one somewhere in your kernel that allows malicious IP packets to crash your machine ("just a crash") and that again is different than some misused buffer in your authenticating daemon that ends up being a root hole.

        This is why some things are backported to 'maintained' releases (-stable trees) and some things are listed on errataXX.html, but most things are not. Not all bugs are created equal, even though they should all be fixed.

        > It's also pretty funny how the rest of you idiots on here just further Linus' bombast with your own against him. The fact that Linus Torvalds is more important to the world at large than J. Random Idiot who posts bombast on undeadly.org means that your bombast is less important. In fact, nobody wants to hear it. Nobody cares. Please shut the fuck up.

        I think it's pretty funny how you manage to start an intelligent post and end with this. Too bad.

        Comments
        1. By Anonymous Coward (198.175.14.193) on

          > > It's pretty ironic that, aside from this comment, Linus' stated ideas about security are basically the same as Theo's. e.g. they are just like any other bug, and should be dealt with without special treatment. and things like "the fix is the disclosure..."
          >
          > I don't believe this to be true.
          >

          Whatever. You don't even get the point. OpenBSD fixes security bugs often without knowing whether or not they have a security impact. OpenBSD fixes major / obvious security problems and announces a security fix. Linus basically says he does the same thing. Who has a better track record is left to the reader. It's subjective, it depends on your viewpoint. (Personally I run OpenBSD and not Linux.)

          OpenBSD doesn't go out of its way to announce minor / potential security fixes with unknown impact, and neither does Linux. Please don't bother to dispute this, you will expose your ignorance even more if you do. Keep running up-to-date snapshots if you are worried about this.

          Ironically there is a Slashdot article this morning about Linus' behavior. But it's the same as everyone else. Nobody who creates an operating system cares to sit around publishing full exploits in their commit message, even if that's the "full disclosure" method. I would say that Linus and Theo are bigger on disclosure than a lot of other folks. But their propensity to disclose is about the same if you go by what they've said. NOBODY who creates systems like this is truly part of the "full disclosure" camp, for obvious reasons. And if they aren't obvious, use your mind, i'm sure you can be very creative.

          Full disclosure isn't even the biggest issue here. The biggest hurdle is even understanding what / where a security problem could be. And it's basically a lot easier to do this with OpenBSD than Linux. This is partly because OpenBSD's kernel+userland is all developed under one "roof". That means major changes can happen all at once when a security issue is exposed, otherwise you are like the rest of the Linux fanboys and you have to depend on some packaging idiot at Redhat to understand the complexity of the problem and address it throughout dozens of components in the system (no thanks.) And partly because the actual track record for kernel security bugs (ones that we know about, anyways) seems to be much better with the OpenBSD kernel than the Linux kernel.

          The very heavy expertise in programming (with an eye towards security) and cryptography systems that various OpenBSD developers display, as they get control over the entire tree (and not just the kernel) makes a HUGE difference for OpenBSD and I think that's what most Linux users (and obviously Linus himself) fail to understand.

    5. By Anonymous Coward (79.129.154.75) on

      > "I think the OpenBSD crowd is a bunch of masturbating monkeys, in that they make such a big deal about concentrating on security to the point where they pretty much admit that nothing else matters to them."
      >
      > Linus Torvalds
      >
      > http://article.gmane.org/gmane.linux.kernel/706950

      So lame.It seems like he doesn't even know the basics about openbsd.
      I didn't expect that.
      But then again, if he knew anything, he would have switched to openbsd.
      btw, what's with the "masturbating monkeys"?

      Comments
      1. By Anonymous Coward (87.144.95.198) on

        > btw, what's with the "masturbating monkeys"?
        I'm not a monkey!

        Comments
        1. By Anonymous Coward (76.250.126.209) on

          we all are, you are not special, get over it.

          Comments
          1. By Chris (24.76.123.149) on

            > we all are, you are not special, get over it.

            No we're not. The taxonomic tree exists for a reason.

        2. By Anonymous Coward (88.192.76.90) on

          > > btw, what's with the "masturbating monkeys"?
          > I'm not a monkey!
          >

          You just masturbate?

    6. By Chris (24.76.123.149) on

      > "I think the OpenBSD crowd is a bunch of masturbating monkeys, in that they make such a big deal about concentrating on security to the point where they pretty much admit that nothing else matters to them."
      >
      > Linus Torvalds
      >
      > http://article.gmane.org/gmane.linux.kernel/706950

      No need to spread news of Torvalds's ignorance across the Internet.

    7. By Anonymous Coward (79.114.19.210) on

      > "I think the OpenBSD crowd is a bunch of masturbating monkeys, in that they make such a big deal about concentrating on security to the point where they pretty much admit that nothing else matters to them."
      >
      > Linus Torvalds
      >
      > http://article.gmane.org/gmane.linux.kernel/706950

      The man is ok for his age: a lot of struggling to promote linux, many coding nights with frustrations, the pressure from the community and the effort to be always on top, the suits pressure, a lot of conferences where you really need to take care what you say, etc. No to mention the poor guy must live and see how his beloved OS changed over the years and became more and more like the hated one - you know what i mean. So I understand him and I think it is time for him to reconsider the whole linux epopeea. I think it is fair to take it more easy and restart again.

      For me this is a clear sign that OpenBSD got speed and many of the well known OSes are looking it in the back. Keep it on!

      Comments
      1. By Anonymous Coward (128.171.90.200) on

        > The man is ok for his age

        He's 38

  6. By Anonymous Coward (2001:1bc8:102:40c3:211:d8ff:fed9:b883) on

    Ops!

    #ifdef INET6
    /* Fix IPv6 header */
    - if (af == INET6)
    + if (af == AF_INET6)

    Really innocent but nasty typo. Indeed: these are usually the hardest ones to spot.

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]