Slashdot Mirror


OpenBSD Gets Even More Secure

Telent writes "As seen in this post by Theo de Raadt, OpenBSD is getting even more secure, working on smashing script kiddies running buffer overflow exploits dead. Tightening PROT_* according to the POSIX standards and creating a non-executable stack on most architectures are just two of the recent enhancements, most of which are in -current now."

73 of 362 comments (clear)

  1. linux should have non-exec stack by defualt by stonebeat.org · · Score: 4, Interesting

    I like the way, BSD makes non-exec stack default. I think in the latest linux kernel, you can make it non-exec at compile but it is not default.

    1. Re:linux should have non-exec stack by defualt by fifirebel · · Score: 5, Informative

      There are several reasons why Linux does not have non-executable stacks yet...

      One of them is that gcc and the kernel use trampolines. From the gcc docs:

      A "trampoline" is a small piece of code that is created at run time when the address of a nested function is taken. It normally resides on the stack, in the stack frame of the containing function.

      AFAIK, linux uses trampolines at least in these places:

      • Gcc uses them for nested functions (not very common though, but glibc has quite a few of those).
      • The linux kernel uses (used?) trampolines for signal delivery.

      Both problems can be addressed (the openwall patches take care of the kernel trampolines), but it's not as easy as turning off the PROT_EXEC bits in the stack.

      Also, a non-exec stack is not a silver bullet: it only makes exploiting buffer overflows somewhat harder. Check out this article from Solar Designer (the OpenWall patch author).

      On top of the above:

      • Multithreaded programs have more than one stack, and they're not necessarily contiguous.
      • As Theo's mail says, the i386 arch (which is still the most common linux arch, despite its suckiness) has a very limited way of implementing PROT_READ && ! PROT_EXEC pages:
        The i386 is not capable of doing per-page execute permission. At most it is only capable of drawing a line through the address space, by limiting the code segment length (using the code segment register). So we can say, "from 0 to this point is executable" and "from that point on to the end of userland is not executable".

      You may now understand why Linus has so far judged that a non-executable stack was more trouble than it was worth.

    2. Re:linux should have non-exec stack by defualt by andrewski · · Score: 2, Insightful

      Easy! Just change your viewing prefs to not show signatures. That way you won't have to bitch to the world about it EVER again!

    3. Re:linux should have non-exec stack by defualt by Anonymous Coward · · Score: 5, Insightful

      This is plain stupid. The kernel stack has nothing in common with user stack, so trampolines are a special issue there.

      Then, trampolines are not the only way to implement nested functions. Just a neat one.

      And finally, gcc has all the hooks to turn the memory protection back on for the little chunk that wants stack execution.

      Guess what ? gnu-ada uses trampolines, and it works on OpenBSD current...

    4. Re:linux should have non-exec stack by defualt by defile · · Score: 2, Insightful

      Also, you don't need an executable heap/stack for these overflows to cause damage (overwrite access tokens, change flag states, etc.)

      Sure every little bit helps, but it's still kind of a losing battle.

      IMO, it would be better to spend more time educating people and making it socially unacceptable to use C/C++ when they could just as easily use a high level language with bounds checking. You know, like LISP people have been saying for 30 years.. ;)

      But alas this is a touchy subject.

    5. Re:linux should have non-exec stack by defualt by johnnyb · · Score: 3, Funny

      Don't insult McDonald's Certified Food Specialists in that way.

  2. concrete galoshes by Forgotten · · Score: 3, Funny

    One day, Theo is going to decide that allowing people access to the HTTP port of the dist machine is just too big a risk, and OpenBSD really will be the most secure OS there is.

    1. Re:concrete galoshes by coene · · Score: 5, Insightful

      OpenBSD does not secure by limiting or removing functinality. Instead, it secures through proper programming, working as a team, and tackling issues in sequence.

      I understand your joking, but point the next one towards the right area :)

    2. Re:concrete galoshes by haroldhunt · · Score: 2, Funny

      >OpenBSD does not secure by limiting or removing functinality.

      Yeah, OpenBSD secures by removing vowels. :)

      Harold

  3. Re:BSD is dead by stonebeat.org · · Score: 2, Insightful

    I think BSD will always have its place. It is secure for one thing. And nobody wants a GUI on their servers. Running XWindows can create security holes as well.

  4. smp blah. by sithe · · Score: 2, Flamebait

    Yah, now If only I could run Open BSD on a system with more than _one_ processor. =/

    -sithEnder

    1. Re:smp blah. by MalleusEBHC · · Score: 4, Informative

      You may get your SMP in OpenBSD soon. From what that article says, they are supposed to have a kernel up by now (although that was their estimate, so you can never be sure).

  5. in case of slashdotting by joe_bruin · · Score: 5, Funny

    google cache, in case of server is slashdotted

  6. Most Secure OS by OverlordQ · · Score: 5, Informative

    A few other people would agree that OpenBSD is the most secure OS. Although I'm a Debian user, kudos to the OpenBSD team on their work.

    --
    Your hair look like poop, Bob! - Wanker.
    1. Re:Most Secure OS by modulo · · Score: 4, Interesting

      Theoretically, a capabilities-based OS like EROS would be even more secure than OpenBSD, if the implementation was as careful. Of course, the same tradeoffs that OpenBSD makes would be even more extreme (application support definitely, performance probably I would think)

      --

      ...but the language is MUMPS, which I will not utter here

  7. open source security by calib0r · · Score: 3, Interesting

    I think its good that organizations such as OpenBSD are taking the initiative to combat DoS/DDoS attacks. I see a lot of companies such as ISS and SecureWorks blowing smoke about "preventing hacker intrusion" when the real threat these days is worms such as Slammer. I really don't know a whole heck of a lot about DDoS attacks, but I've seen a lot of systems crumble under them, even if the os installed on the systems is unaffected. Wonder when Cisco will start doing things like this with IOS? (Unless they already are?) Discussion encouraged.

    --
    -===- "Those who would sacrifice freedom for security deserver neither" -===-
    1. Re:open source security by Anonymous Coward · · Score: 2, Funny

      Cisco already seems to have put in measures to combat the spread of worms. Whenever someone starts putting a high load on the router, it crashes. Problem solved.

  8. Interresting...(might be OT) by Mathness · · Score: 3, Interesting

    This, and other recent, articles about BSD have made me consider giving BSD a test run on one of my computer. It appears to have some interresting posibilities. And it should be worth getting to know better, it could be the right tool (OS) for some types of "jobs".

    The problem is always where to start, I assume there is no BSD flavor as easy to install as Mandrake (just to pick one), but then I am a happy user of Debian (2.2) floppy installer. A few hints to start out on, for instance a install/easy of use comparison of the various BSD's would probably be helpful to more than a few readers.

    --
    Carbon based humanoid in training.
    1. Re:Interresting...(might be OT) by nuintari · · Score: 5, Interesting

      I'm gonna have to disagree with you on several points here.

      1. I have found Open is actually easier to install than Free. Granted, this could be due to my love of purely simple methods, which the Open installer is. net is, in my mind, the hardest of the three, with free being very much in the middle.

      2. I fail to see how Open is slwoer and more limited. It is true that Free has the most amazing tcp stack in production today, but Open's is pretty tight, and is plenty efficient in disk I/O and CPU usage. Its also not limited in any way. The stock install has a lot less "stuff" in it than most other OS's, but I consider that a definate bonus. "Ports" in a few extras, and you have an awesome, httpd, ftp, mail, dns, whatever server. In my company, we have dual purpose dns/mx backup OpenBSD machines.

      3. While it is true that OpenBSD makes a dandy firewall, and quite frankly, I would use nothing else but OpenBSD for said purpose, that's not all its good for, and this "typecasting" has to stop. Does just fine in any other role too, hell, I have an OpenBSD DESKTOP. DESKTOP!

      4. As for an Open box getting owned, not surprising. The final step in a secure OS, is knowing how to maintain it, and miantaining Open is no picnic, once free is up and running it is far easier to lean to patch it. Both are fairly simple once ya get the hang of it, but the free learning curve is much faster. And quite frankly, a lot of businesses deploy tons of freebsd machines, lots of admins know it. Open is a newer project, with a smaller real world footprint.

      Just my unspellchecked thoughts. Its almost my birthday, I no longer feel compelled to check my typos out.

      --

      --Nuintari

      slashdot : where an opinion can be wrong.

    2. Re:Interresting...(might be OT) by shamilton · · Score: 3, Interesting

      1. I can't really comment, I've only watched it be installed. I would agree that NetBSD is the hardest, the installer doesn't really seem to flow. Personally I would prefer to just receive a shell when I put the CD in. I can fsck, disklabel, fstab, and untar all by msyelf, thank you very much.

      2. OpenBSD and NetBSD are definitely a lot slower than FreeBSD. NetBSD feels a lot less responsive than FreeBSD. Both take much longer to boot. I believe the reason is simply that speed hacks are hard to port and are potentially insecure.

      3. My original post was going to address OpenBSD desktops, but I decided not to. Using OpenBSD as a desktop is sort of like using a weed whacker to mow your lawn, then saying "Weed whackers do just fine in any other role!" Maybe so, but there are better solutions available.

      4. This wasn't a maintainence thing. As I recall, it was the sshd thing. It got hit right away (as the sshd vulnerability was being announced) by a script which hit all our boxes. The irony is that the FreeBSD boxes were not vulnerable, because of patches to OpenSSH made by the FreeBSD developers. This is actually something of a recurring theme with FreeBSD: major application is vulnerable except for the one shipped with FreeBSD, due to local patches. Personally I trust the network security of FreeBSD better than I do OpenBSD, but I believe it would be easier for a user to break root on a FreeBSD box than an OpenBSD one.

      I enjoyed your sig.

      sh

      --
      "[A] high IQ is like a Jeep; you will still get stuck, just farther from help!" --Just d' FAQs, c.g.a
  9. Because for many, many years... by leonbrooks · · Score: 5, Interesting

    ...Microsoft's goal has been to add more saleable features and more handcuffs for their users. Bill has a moneymaking mania. Then they expect a month of bugfixing to make up for over 100 months of bugmaking.

    OpenBSD, on the other hand, probably has 100 months of bugfixing up its collective sleeve. I wonder if they expect that a month of portting applications will make them more popular? (-:

    IRL, a month of porting applications would simply mean an order of magnitude more security holes to fix.

    Making OpenBSD completely thread-safe in preparation for multi-CPU stuff is probably a steep hill to climb, too. However, the kind of stuff that OpenBSD does well probably means that very few single-CPU OpenBSD machines will be CPU-starved until long after they're disk-I/O or net-bandwidth-saturated. Which means that it makes more sense to cluster than to proliferate CPUs in an already-saturated environment.

    --
    Got time? Spend some of it coding or testing
  10. For the lamens among us... by zaffir · · Score: 2

    Anyone mind explaining, or posting some links to pages explaining, what stack smashing is, and why an executable stack stops it?

    We're not all l33t haxx0rs here...

    --
    "Upon attaching the waterblock to my penis, I began to notice that I know nothing about computers." -- JRockway
    1. Re:For the lamens among us... by da_spoon · · Score: 2, Informative

      I do not have any links, but stack smashing is when you pass a large parameter to a program. If the programmer did not check the size of the input and assumes that it is smaller than the actuall size of the parameter. This then overwrites the stack(variable stoarge) and can get into the return section of the program. If it is able to get into the return section, OS's with EXEC Stacks may execute code that was passed with the overflowing parameters

    2. Re:For the lamens among us... by djschaap · · Score: 5, Informative

      Put simply, "Smashing the stack" is a method of overwriting variables within a program (which are located on "the stack") with malicious CPU instructions. When done properly, the vulnerable application will jump to those malicious instructions and do Bad Things(tm).

      Preventing the CPU from executing code located on the stack will in many/most cases prevent these malicious instructions from ever running (because they're located on the stack).

      For a detailed explanation, see Smashing the Stack For Fun and Profit by Aleph One.

    3. Re:For the lamens among us... by Jeremi · · Score: 5, Informative
      Roughly: A program's stack is where it keeps its temporary information, a sort of "scratch pad" if you will. Stack smashing is when the program has a bug that causes it to "scribble outside the lines", such that it overwrites info in its scratch pad in an unexpected way.


      A common bug in programs is that when they are receiving input (from the disk, from the keyboard, but most relevantly, from the Internet), they forget to make sure that they have enough room to "write down" the input they are receiving, and so they end up writing right past the end of their scratch area and over other stuff. Typically, this will cause the program to malfunction and/or crash soon afterwards.... BUT:


      Years ago, crafty nasty little hax0rs realized they could use this type of bug to gain control of a computer remotely via the Internet. What they do is they find a computer running a program that has this sort of bug, and then send it input that is too big for the program's buffer, and contains a little program. The buggy program duly writes the input onto its stack, munging some of its other data -- and the hacker has formed the input "just so", so that the data it overwrites is the data governing what the computer will do next. So instead of just crashing, the program then executes the hacker's program. The program then usually "unlocks the front door" of the computer to the hacker, allowing the hacker to control the computer by remote.


      Making the stack non-executable means the the computer doesn't allow itself to execute any code that is located in the stack. This means that the hacker can upload his evil program, but he can't trick the computer into running it.


      Why this feature hasn't been standard in all OS's since the invention of the MMU, I cannot fathom.

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
    4. Re:For the lamens among us... by mbessey · · Score: 3, Informative

      Well, most C compilers allocate temporary variables on the stack, which is the same place that they use to keep track of where the currently-executing function was called from, so they can return to the previous function.

      If your program overflows the end of a temporary string or array (due to a bug in the error-checking, most likely), it can overwrite other things on the stack, including the return address of the current function call.

      So, the attacker sends in an enormous string, which "just happens" to contain some executable code that does something nasty, followed by the address of that same code.

      The new return address overwrites the one on the stack, so that when the function returns, it actually jumps into the previously-loaded data on the stack, which then does something nasty.

      Making the stack non-executable causes the program to crash when you try to exploit it this way.

      You can still overwrite data on the stack, which might still allow you to get a program to misbehave, but at least you're limited to running code that's already in the application.

      Some of the other changes mentioned in the paper try to make it harder to exploit overwriting data on the stack, too.

      Hope this was helpful,

      -Mark

    5. Re:For the lamens among us... by An+Ominous+Cow+Erred · · Score: 2, Informative

      Quick explanation -- (really you should google for this info but oh well)

      The stack is a LIFO (Last in First out) data structure. OS's and programs use it to store all sorts of data, but one thing it's commonly used for is storing return addresses for subroutines and such.

      By "stack smashing" what people mean is the typical goal of a buffer overflow attack. A program that doesn't do bounds checking on an array of data can be fed a huge amount of data that exceeds the length of the buffer that it has allocated to hold that memory. It then starts walking over other parts of memory and runs into the stack (which exists in memory just like everything else).

      If you overwrite a return address in the stack with a pointer that points to some code that you've written to memory with the buffer overflow you just did, you can execute arbitrary code and thusly take control of a system (with whatever privileges the program you just attacked uses).

      Since a lot of your overflowing data is going into the stack, it's a potential space for a lot of the code you might want to execute. Since the stack should only hold data and pointers, not code, it's safe to make it non-executeable with the MMU. This makes it harder to write a buffer overflow exploit, although it doesn't totally prevent it (since you can stick your malicious code in non-stack space as well).

      (Feel free to flame/mod me down for any mistakes in this explanation. :-) )

    6. Re:For the lamens among us... by Scott+Wood · · Score: 2, Insightful
      You can still overwrite data on the stack, which might still allow you to get a program to misbehave, but at least you're limited to running code that's already in the application.

      Not really. You can still control the program flow by overwriting the return address, and given the stack-only parameter passing scheme on x86, you can also supply arguments to whatever function you choose to return to (with register arguments, you'd be limited to whatever registers are going to be loaded off the stack before you return, and argument registers are typically not preserved by the callee). While the typical exploit that just wants /bin/sh to run would likely just call system() or execve() or something, if one really wants to run code from the stack, the stack could be set up to return to memcpy() with the arguments pointing at the code to be moved to an executable area, and a subsequent return value that points to the destination. Null bytes would present a problem with (at least) the length argument, assuming the overflow is from a C-style string, but a sufficiently clever attacker could utilize other library functions to patch in the needed null bytes.

      Thus, it may make certain attacks marginally harder, but it doesn't stop foreign code from being executable. It's most visible effect would be the problems it causes to legitimate programs that may want to execute dynamically generated code on the stack.

      While there is no silver bullet to these sorts of attacks, making the stack grow upward (or strings grow downward) would eliminate a lot more holes than a non-exec stack. Unfortunately, people are too bound by tradition, and still introduce new ABIs that use downward-growing stacks, even when there's no hardware bias against upward-growing stacks, such as on most RISC chips.

  11. What I use BSD for by harikiri · · Score: 5, Informative

    I prefer to use BSD (Free* or Open*) as servers, as opposed to Linux.

    Why?

    If you've ever installed a Linux distribution, you will immediately note the number of third-party libraries and applications installed on a 'base' system. This is frustrating for me, because for the most part I may not want all those extra applications installed, because it clutters up the system, and there may be various vulnerabilities present that I'll be open to.

    Instead I prefer to use BSD in these situations, because when you install the operating system, everything with a few choice exceptions (ie, gcc, apache, less) everything is part of the BSD operating system, no third party apps are installed unless you choose to at install time.

    So when I install a BSD server, its clean from the get go. If I want bash, I have to install the package. This way I get control over what is on my system, and spend far less time adding what I want, instead of removing what I don't want (in the case of a Linux distro).

    I use MacOS X laptop, which is the vision for what I always wanted my linux desktop systems to be. I can play DVD's, get sound working, simple updates, bash, gcc, ircII, web browsers which don't have problems on most sites, beautiful MP3 application, mail, etc.

    For me, I don't even bother with Linux except for testing program portability, or for wireless lan-related applications (airsnort).

    --
    Man watching 6 MSCE's around a sun box, looks alot like the opening scene's of 2001:space odyssey...
    1. Re:What I use BSD for by Kashif+Shaikh · · Score: 4, Informative

      If you've ever installed a Linux distribution, you will immediately note the number of third-party libraries and applications installed on a 'base' system.

      I found this true with redhat and suse, BUT you can use another meta distro: Gentoo.

      You only merge(Gentoo-speak for fetch/compile/install packages) on what u need and satisfies your dependencies. Bootstrapping a gentoo system takes a couple of phases, however after the 3rd phase you have a base system close to 400mb(extra megabytes are due to having a development system needed to compile everything).

      Plus, you can customize specific packages such as compiling in gtk/kde support, etc with USE variables. And if that don't work, you can edit the ebuild script file right then and there and customize you're own version right there(i.e. adding --msdfs configure flag to samba to compile in Microsoft DFS support)

      I won't bore you with more details, but you can check out www.gentoo.org.

    2. Re:What I use BSD for by tamnir · · Score: 3, Informative

      If you've ever installed a Linux distribution, you will immediately note the number of third-party libraries and applications installed on a 'base' system. This is frustrating for me, because for the most part I may not want all those extra applications installed, because it clutters up the system, and there may be various vulnerabilities present that I'll be open to.


      You should give Linux From Scratch a try. You will build your own Linux system, installing each component manually. No clutter, just what you need, and compiled the way you want it. It is a very good learning experience too.
      --
      I code, therefore I am.
    3. Re:What I use BSD for by nitehorse · · Score: 2, Interesting

      Just had to comment on this line:

      FreeBSD clings too much to traditional Unix.

      Heh.

      And what did you expect it to cling to? Traditional VMS? Don't forget that FreeBSD IS UNIX. FreeBSD is a direct descendent of the code from the original 4.4BSD. THIS IS UNIX. Love it or leave it.

      (Personally, I love FreeBSD and 5.0 kicks major ass. Linux is cool, but I use Gentoo, which is arguably more BSD-like than any of the other distros except for maybe Slackware.)

  12. Deeply cool. by JimmytheGeek · · Score: 2, Funny

    I want it now, but I'd whine if it weren't fully tested. Man, to think I'm doing the "gotta go pee" dance over something like this. I need a life.

    We have a lot of single-purpose OBSD boxen here. I like them a lot. Go, team, go!

  13. Thank goodness - it's about damnned time! by mbessey · · Score: 2, Interesting

    I never did understand why this particular set of problems was allowed to exist on most x86 UNIX-like operating systems.

    It's too bad that they weren't able to completely seperate executable and readable memory, but it's good to see somebody finally taking these problems seriously.

    And as a bonus to making the system more secure, these changes will make it easier to debug stack-smashing bugs.

    -Mark

  14. Re:Why not Windows by PetWolverine · · Score: 3, Interesting

    Because they're making their OS for profit, and they find they can sell a shitty OS. It costs extra to make it not be shitty, and it's not worth it to them.

    Notice that it's apparently worth it to Apple--hence the move to a Unix base. This is OpenBSD; Darwin is based on FreeBSD, right? But maybe somebody will find a way to incorporate these changes into Darwin, or maybe Apple will do it themselves. I would certainly appreciate it if they did.

    --
    I found the meaning of life the other day, but I had write-only access.
  15. But What About...? by ewhac · · Score: 4, Interesting

    Theo de Raadt writes:

    W^X is a short form for "PROT_WRITE XOR PROT_EXEC". The basic idea here is that most buffer overflow "eggs" rely on a particular feature: That there is memory which they can write to, and then jump to.

    What if there was no such memory? Does a normal Unix process have memory that is both writeable and executable? Turns out they do: [ ... ]

    But do they need it? [ ... ]

    If you're running a JIT compiler/interpreter or other dynamic code assembly, you sure as hell do.

    I can see how you might be able to write dynamically generated code to a page, then turn off PROT_WRITE and turn on PROT_EXEC before jumping to it. However, this is almost certainly two trips into the kernel, each involving tons of permission checking. So performance will likely suffer, which negates the whole point of doing JIT in the first place.

    I like his survey of MMU architectures, though.

    Schwab

    1. Re:But What About...? by epine · · Score: 2, Interesting


      There are too many presumptions in this comment about JIT. The protections Theo is using are imposed by the VM system, which means the protections are relative to a *view* of memory. It's not obvious to me that the JIT compiler needs to share the same view of memory as the process for which it compiles. I can't bring myself to believe that for a typical invocation of the JIT compiler, one process transition is a dominant cost.

    2. Re:But What About...? by IcePic · · Score: 2, Insightful

      Example: A hacker sends a packet that exploits a buffer overflow bug to insert some malicious code into memory. The computer won't execute it because it's writeable, and it doesn't execute writeable pages. But that's okay! The worm cleverly inserted the data into a location it knew was writeable, but would eventually become readable. Sure enough, later on another function makes that location executable and then executes it.

      The thing is that stuff written to memory by usual
      apps are written into PROT_WRITE areas. These in
      turn usually never gets mprotect()ed to another
      status by the apps. A common exploit would normally
      send malicious data to the app making the app copy
      that data into an area that had both PROT_WRITE
      and PROT_EXEC. Then, it would make the app jump into
      this area.
      So, you can always use bugs to have the code jump
      from one place to another, but if the app doesn't
      have any mprotect() code (mine never does =) then
      it would be pretty hard for the exploiter to rewrite
      the rules of his particurlar page using code that isn't
      his own at all to make it possible for him to jump
      into his own code.
      Until you have found a way to execute your own code,
      finding a call to mprotect() with *EXACTLY* the correct
      args to make page 0x056df800 go from PROT_WRITE to
      PROT_EXEC will be hard++.
      So you end up with a chicken-egg-problem. The
      malicious code could of course make its own page
      PROT_EXEC. if it could execute mprotect(), and since it can't
      execute anything without PROT_EXEC, it cannot run mprotect() at all.

      --
      -- I'm as unique as everyone else.
  16. What about other BSDs? by PetWolverine · · Score: 3, Interesting

    Anyone know how portable these modifications are to other BSDs, notably Darwin?

    --
    I found the meaning of life the other day, but I had write-only access.
  17. Re:Why not Windows by the_mad_poster · · Score: 3, Insightful

    It's the difference between love of money and love of your job I suppose. People who are more interested in creating a product that THEY want (BSD developers) are more likely to create a product other people will want. People who are creating a product OTHER people want (as in MS developers making products for their managers' current whims) just won't have the heart for it. Of course... an outright disgust and ditrust of your customers helps create a faulty product as well :\

    --
    Alito: A vote for Alito is a punch in the eye to put that bitch back in her place!
  18. Oh joy... over bufferflow by Woodrose · · Score: 5, Interesting

    Ancient and venerable 24-bit CDC 3150 machine in 1970 solved buffer overflow problems by pre-writing return jump to execover (pass control to data area and bang, you're dumped) instruction throughout user space. When you got the dump, the ASCII interpretation was "ojoy". So you got about thirty pages of blue-bar printout saying "ojoyojoyojoyojoy...".

    --

    Thou hast damnable iteration, and art indeed able to corrupt a saint - Henry IV, Act I scene II

  19. Re:Why not Windows by Penguinoflight · · Score: 2, Interesting

    Oh, they certainly can, even though a closed source model is much harder to be secure, given the smaller test, and development base. The problem is, it's simply not a high ENOUGH priority at most businesses. And why should it be, when people buy for marketing schemes, pretty graphics, and "but I just want my $10 modem to work" stuff.

    Security isn't just a unix/windows war though, Solaris has had big trouble with security in the past, and so has IRIX. I haven't heard much about AIX, or HP-UX, but likely those machines wont be used for external servers anyway, so it's not QUITE as big a issue.

    --
    "And we have seen and do testify that the Father sent the Son to be the Savior of the World"
    1 John 4:14
  20. Nonexecutable stacks by Sayjack · · Score: 4, Insightful

    A nonexecutable stack is no guarantee of safety. Solaris 2.6 demonstrated this here.

    --

    -- Good judgement comes with experience. -- Experience comes with bad judgement.

    1. Re:Nonexecutable stacks by Anonymous Coward · · Score: 3, Insightful

      A nonexecutable stack is no guarantee of safety.

      Nobody said it was. To quote TdR, "We feel that these 4 technologies together will be a a royal pain in the ass for the typical buffer overflow attacker."

      If you think "royal pain in the ass" constitutes proof, go back to math 101.

  21. Really hard workers by Amsterdam+Vallon · · Score: 4, Informative

    The OpenBSD team is a really great group of hard-working coders that don't stop with writing just average code.

    This latest security measure goes to show why they're still #1 when it comes to really closing up a machine's holes to prevent abuse and unwanted infiltration into a system.

    Unfortunately, they still can't get UltraSparcIII documentation that they need for their project.

    I urge you all to contact SUN Microsystems and demand that they hand over the details of the US III series computers.

    *nix.org -- Latest article > "Taming OS X"

    --

    Reply or e-mail; don't vaguely moderate. Ex-O'Reilly/MIT employee, now a full-time Google employee.
  22. Re:We are much more secure by Ryan+Amos · · Score: 3, Interesting

    I don't think anyone claims OpenBSD is not an innovator. But it really isn't that hard to secure a *nix box from most security breaches. The biggest part is keeping current on patches and staying away from software such as BIND and sendmail. I can still exploit root on an OpenBSD machine with a crappy CGI. If you need to hack the data on a machine, there are low level exploits (though if you have data someone would want to hack, you should be encrypting your filesystems.)

    I do admire OpenBSD's approach to software development; it can be called responsible if nothing else. It's just that for volunteers who basically code other *nix OSes, code auditing is not nearly as much fun as porting your OS to a Nintendo. :)

  23. VMS by ArchieBunker · · Score: 5, Insightful

    VMS is probably a close second in terms of security. Its C-2 secure right out of the box. Plus most script kiddies would be left scratching their head trying to use it.

    --
    Only the State obtains its revenue by coercion. - Murray Rothbard
    1. Re:VMS by Bastian · · Score: 4, Funny

      Plus most script kiddies would be left scratching their head trying to use it.

      All my servers run CP/M for the same reason.

    2. Re:VMS by Foresto · · Score: 2, Informative
      "VMS is probably a close second in terms of security. Its C-2 secure right out of the box."
      Perhaps, but last time I checked, several Microsoft products had passed C2 as well. How secure do you think that makes them? Do you actually know what C2 certification means?
  24. Re:Why not Windows by MoThugz · · Score: 2, Informative

    It's has got more to do with priorities rather than budget. Windows was meant to be more of a "user-friendly consumer OS"... Although the security of Windows is at you say not as good as openbsd, I doubt that patching openbsd is at easy as opening the default browser, clicking on the Tools toolbar and click Windows Update.

    Not trolling here, just showing another perspective to the issue.

  25. You can do JIT by ^BR · · Score: 5, Interesting

    You just have to explicitly mprotect(2) the memory where it happen with PROT_EXEC|PROT_WRITE. The fact that on some OSes it can work without doing that is actually a bug in these OSes.

    What the change is doing is the right thing, using a minimum privilege way to achieve more security. If some static code actually contain data that look like machine code it could be executed this wont be possible anymore.

    Non executable stack by itself was far from enough as most program have some way of putting things on the heap or elsewere for an attacker and he could jump there instead of jumping on the stack. Coding an exploit for OpenBSD will get real tough now, even if there's an actual buffer overflow.

  26. Re:Either way is good by mao+che+minh · · Score: 2, Funny
    That myth needs dispelling. What can Linux not do that makes it a bad choice as a desktop OS? The only "hurdle" left is vast commercial support for new games. And that isn't even a factor for the workplace.

    1. Linux is better for developers (even some Microsoft developers like to use it as their developing platform - see the whole Roblimo Linux Fest deal)
    2. There is more and better software available for Linux then Windows or Macintosh
    3. Everything that the casual user needs is available after a 20 minute install process
    4. Linux can be more easily managed regardless of overall network configuration
    5. Again, and this can't be stressed enough since it is the main factor for management and pointy-hairs everywhere: Linux is far, far cheaper.

    If an expensive cost, inflexibility, high risk factor, constant and forced upgrade cycles, and poor memory management makes a good desktop operating system then no, Linux sucks on the desktop.

  27. Why does anyone need this crap. by BoomerSooner · · Score: 2, Informative

    Seriously, without MS would there be a reported "shortage of qualified computer personnel"?

    If all these exploits are beaten before they are even implemented how will one prove their worth to their employers?

    Damn it, I thought that SQL Slammer was a saving grace. We didn't have our servers at sp3 but then again they are behind a dual stage firewall so we had no hicup at all. However, I got the time at work to install patches as a result of the media.

    To summarize: don't eliminate vunerabilities because you'll just be eliminating someones job (both the admins and hackers).

    [end sarcasm, or my attempt at sarcasm since I haven't seen any around these parts since 1995]

  28. You don't understand what is done by ^BR · · Score: 4, Informative

    What is done is protecting memory zones created by the linker, mostly memory zone holding constants and static variables, so no there's no executable code in this area.

    When you write a JIT you allocate your own memory on the heap and then compile your code there. On order for this code to be executable you have to mprotect(2) the memory zone holding your code with the PROT_EXEC flag, or PROT_EXEC | PROT_WRITE if you want to be able to modify it afterward. Anyway you can change the memory protection at anytime so anything you could do before you still can do.

  29. Who are you? by Theo+de+Raadt+-+OBSD · · Score: 4, Funny
    OK, first of all, because you registered that username here, Slashdot wouldn't let me register "Theo de Raadt", so I had to settle for this.

    Secondly, who the hell are you? Stop impersonating me on Slashdot.

    --

    --
    Theo de Raadt
    Founder, OpenBSD project
  30. Re:We are much more secure by whiteranger99x · · Score: 2, Funny

    I guess you could say, we are working on things more significant and important than making sure OpenBSD works on crusty old PDP-8s and Nintendos

    Well don't lose sleep over it, I pretty sure NetBSD tied up those loose ends LOOOOONG ago. :P

    --
    Join the TWIT army now!
  31. Nice, but doesn't address the bigger problem. by matman · · Score: 3, Insightful

    The bigger problem is that the principle of least privilege is not adhered to in world of Unix. Programmers will always write bugs and applications will always have vulnerabilities that can be manipulated. Manipulation of services should only effect the service being manipulated, not the whole system. For example, services should have NO access to anything by default. When you install a service you should set up the specific permissions that it requires (this can be made easy - the app, upon install, can recommend the permissions and you can just say, "okay"). If the app tries to do something that it doesn't normally need to do (like access /home/me/mysecretfile), the system should log an access denied message; the Linux kernel right now can't even audit denied access to files! CHUID permissions to deliver mail to people? A much cleaner mechanism is for the mail server to create the files under its own name and give permission to the user to take ownership of the files.

    Linux, and Unix in general, tends to have pretty limited access controls. Even with ACL support, the distros still need to ship with restrictive settings and manage them. A lot can be done to provide a framework under which compromises can be limited and can be audited. Right now we don't have that. Without detection and reaction, how do you know that your prevention is effective?

    1. Re:Nice, but doesn't address the bigger problem. by Flower · · Score: 3, Informative
      systrace anyone?

      I'll leave that as a start.

      --
      I don't want knowledge. I want certainty. - Law, David Bowie
    2. Re:Nice, but doesn't address the bigger problem. by dmiller · · Score: 4, Interesting

      The bigger problem is that the principle of least privilege is not adhered to in world of Unix. Programmers will always write bugs and applications will always have vulnerabilities that can be manipulated. Manipulation of services should only effect the service being manipulated, not the whole system. For example, services should have NO access to anything by default.

      That is very much the approach that OpenBSD is taking - e.g. with privilege separated OpenSSH. If you exploit OpenSSH before authentication, you are unprivileged in a chroot that you can't write too. While this is not invulnerable (you may still abuse kernel bugs to escalate your privilege), it is a good deal better than before. OpenBSD also provides you tools with which you may further protect yourself: systrace - a system call policy checker.

    3. Re:Nice, but doesn't address the bigger problem. by ctr2sprt · · Score: 3, Interesting
      The problem is simple: the controls we have right now are far too coarse for the things we want to do with them. Running daemons as root is like putting out a match with a lake. They never need all the privileges of root. We need a way for root to drop its privileges selectively - or, better yet, a way to confer specific privileges to regular users. "The user apache can bind to port 80 without being root." "The user ftpd can chroot without being root." And so on.

      It would also be lovely to see the tool which manages all this unify all the ACL-like aspects of the system into a single interface. Firewalls, filesystem ACLs, and privilege delegation are all remarkably similar, it'd be great to be able to define them selectively in groups (I think SELinux calls them "contexts") and confer them to various processes. Daemons can bind to ports, but not regular users? Easy: set the firewall ACL policy to deny, then grant the "daemon" context an exemption. Then tie in other useful privileges, like the ability to write to /var/run and send messages to syslogd. All these things are obviously related conceptually, but currently you'd need 3 tools to do it all (I don't think it's possible to regulate syslogd access this way, period, but I'm being optimistic and assuming it is).

      Unfortunately, from what I saw of SELinux when I last used it, all this is some time off... especially the part where it's easy to administer and use. But to end on a positive note, there are a bunch of people who recognize this problem and are working hard to correct it.

  32. Re:Why not Windows by m8pple · · Score: 3, Informative
    For Windows 2003 Server (what used to be .NET Server IIRC), they've recompiled everything with the /GS compiler switch, which hopefully will mean that at worst servers crash, rather than allowing overflows. The system talked about in the article sounds very similar, but I was a little unclear on whether this was in gcc, or whether they had explicitly instrumented all the kernel calls in some way.

    For the 64 bit versions all pages have proper rwx permissions applied as specified in VirtualAlloc etc., but I'm not sure if the stack is no-exec by default.

    Still, there are bound to be tons of protocol implementation errors that have nothing to do with fixed length buffers :P

  33. Re:oh ya, right by Loki_1929 · · Score: 3, Interesting

    OpenBSD, and BSD in general is so much more secure than any version of Windows, it's laughable to even compare the two. This isn't about tightening up their own code, this is about tightening their code to prevent poorly-written 3rd-party applications from becoming launching platforms for attacks against OpenBSD machines. Microsoft's main problem with security isn't 3rd part apps, it's the millions of lines of unsecure and buggy code in highly integrated applications such as Internet Explorer and Windows Media Player.

    To compare this to Trusted Computing is like comparing apples and black holes.

    --
    -- "Government is the great fiction through which everybody endeavors to live at the expense of everybody else."
  34. You're sort of right by anonymous+cupboard · · Score: 4, Interesting
    Theo doesn't like to enable functionality on OpenBSD until he is fairly certain that it is secure. The process isn't perfect, for example, he has also seen the OpenSSH problems - but most of the time it works.

    Forget about security through obscurity, this is security through paranoia. Sometimes, it is justified.

  35. Re:Why not Windows by anonymous+cupboard · · Score: 2, Funny
    AIX is quite big as an external server platform, probably because of the high-end IBM Web products. It is considered to be fairly secure (certainly a better rep than Solaris) and some banks run their online banking services from it.

    If you really want security, go and buy OpenVMS!!!!

  36. Re:Why not Windows by geekoid · · Score: 3, Interesting

    "Windows was meant to be more of a "user-friendly consumer OS"."

    that is no reason for it, that is just an excuse.

    Windows is written to meet demand, not to exceded it. It could be secure, but they really don't care.

    There starting to care, unfortunatly they would have to do a real redsign from the ground, by people who where experts, and had never seen any other windows code.

    Do you think Car companies would care about safety if you were forced to sign a waiver and couldn't sue them? Hell, you'ls be lucky if the brakes worked after a month.

    I'd rather hace to do an update once in a while by hand, then an update every couple of months with push button convience.

    --
    The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
  37. Re:Terrific... by smash · · Score: 2, Insightful
    Its called using the correct tool for the job. You don't try hammering nails into stuff with a screwdriver do you?

    Adding SMP will make the kernel more complex, and complexity is bad from a security standpoint.

    OpenBSD is supposed to be used for network edge devices - firewalls, etc, in which SMP is not required.

    If you want a Unix for your desktop - try Linux, or help out testing FreeBSD 5.0.

    Its not about Theo "getting it together" ... no SMP is a design decision that has been made.

    smash.

    --
    I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.
  38. Hardware by octogen · · Score: 5, Informative

    On Intel processors, read- and execute-permission for a memory page is only one flag. For this reason, if you make the stack nonexec on Intel machines, the cpu will have to do a lot of context-switching, because all the protection faults that occur when an application tries to read from a non-exec page need to be handled by the OS kernel.

    On SPARC, Alpha or POWER CPUs there is one flag for the read-permission and another one for the execute-permission.

    To prevent exploitation of buffer overflows, I believe that we simply need much better hardware.

    For example, IBM's AS/400 has Hardware pointer protection. It is absolutely impossible to fake certain types of pointers on the AS/400, because the CPU will recognize when a pointer has been overwritten due to a buffer overflow.

    That's how REAL bufferoverflow-protection works. If you just make dataregions nonexecutable, you can still parameterize some kind of library function (how about execve()?) and make the vulnerable program jump into the codesegment to execute the library function with the parameters specified by the attacker.

    AS/400s simply 'abuse' one bit in the ECC code as a flag for marking valid pointers.

    For every 64 bits in RAM there should be 1 flag bit, which tells the CPU whether the data in memory is a valid pointer or not.

    An instruction like LEA (Load effective address) should then implicitly set the flag, and instructions like MOV (Move Data, actually a copy instruction) should always clear the flag.

    If a RET (return from subroutine) instruction tries to load an unflagged (=invalid) pointer, the CPU should trap to the OS kernel.

    For legacy application, that are too damn stupid to use pointers in a correct way, a privilege could be added to the OS kernel to allow an application to use even invalid pointers.

    Furthermore, read- and execute-permission should be separate flags and all stack- and heap-pages should be nonexec by default.

  39. I use OpenBSD often, but... by burbilog · · Score: 3, Informative

    can't install it on my main production servers. Why? Because it STILL does not have locales. And without locales cyrillic doesn't work in mysql, zope and other applications :( OpenBSD makes a great private net forwarder in remote locations tho.

    1. Re:I use OpenBSD often, but... by RazzleDazzle · · Score: 2, Informative
      --
      ZERO ZERO ONE ZERO ONE ZERO ONE ONE! Just brushing up for my next big invention: Ethernet over Voice (EoV)
  40. More Examples (incl. Linux) by modulo · · Score: 3, Interesting
    Some others that have come up for discussion before (?) are:

    Trusted Solaris

    and

    Pit Bull from Argus Systems

    IIRC, these are more common Un*ces that are patched to provide "capabilities" - that is, instead of the root being the one-size-fits-all user that has enough privileges to get anything done, different kinds of access are broken down so that if a running program getw 0wned, it limits the damage.

    Theo's answer to that probably would be, "code it right in the first place and it won't GET 0wned!!!", which is a valid point, the devil (no pun intended) is in the details.

    BTW, I first came across EROS comes from Alan Cox in an interview with Robert Metcalfe a few years ago (remember the "Open Sores" series of articles? Great trolling, Bob!), in response to a question of what he thought was going to be the next big thing after Linux. He was impressed with the response (having previously accused Linux-y types of monomaniacal zeal), but it didn't overturn his opinion at the time that Linux was doomed. Oh well. (This comes to you courtesy of the similarly fated Internet.)

    --

    ...but the language is MUMPS, which I will not utter here

  41. Re:HTTP? IRC! by grub · · Score: 2, Informative


    And then they ship sendmail and BIND with it.

    The BIND that comes with OpenBSD is an audited V 4.x IIRC. That should suffice for many many users, those that need 8.x or 9.x can find it them the ports tree. The sendmail is locked down as well and doesn't accept connections by default.

    Nice FUD otherwise.

    --
    Trolling is a art,
  42. Different stacks... by wowbagger · · Score: 3, Insightful

    I was thinking about this on my drive into work this morning, and I came to the conclusion that what we need to do is to change the C style stack usage to use two or three stacks.

    Consider: C uses the stack for three types of information: call/return information, parameter passing, and local variable storage. I assert that this is the cause of most of the stack problems in C - you are using the same thing for three different needs.

    Let me discuss each of the three uses in turn. I will use x86 terminology for this discussion because that is the primary architecture used for Linux and because that is what I am most familiar with, but you should be able to generalize my points without much problem.

    First, you have the call/return stack. This needs to the be CPU stack so that normal CALL/RET operations work. The only things that should be stored here are the actual return addresses, as well as possibly register saves (esp. for interrupt routines). However, in a unified stack design it is possible for the bad guys to modify the return address. Thus, even in a non-executable stack environment I can still change the return address to point to a function, say exec().

    Second, you have the parameter passing stack. Ideally the only thing on this stack would be parameters passed down to the function from the caller. However, in a unified stack design, I can modify this stack to contain data - thus I can create a pointer to the string "/bin/bash" on the stack. With this and with the call/return modification above, I can cause the current function to "return" to exec(), with "/bin/bash" as the arg. Boom. Remote shell.

    Third, you have local variable storage. If this space were seperate from the other two stacks, then overflowing a local buffer, while still bad, would not be able to modify the return address nor would it be able to create parameters. Ideally, every subroutine would be given its own sparely mapped local space - thus boundary errors would likely throw a page fault (granted, the cost of setting such a mapping up for each subroutine call would be prohibitive, so it is unlikely to happen without some form of hardware acceleration. Perhaps a low/high limit register could be added to the various index functions, such that an access relative to EBP, ESI, EDI would fault if it went out of range.)

    However, consider just seperating the stack into three areas, widely seperated. ESP would point to the hardware stack. EBP to the local storage area, and ESI to the parameter block (with EDI pointing to "this" for C++). Now, a bad programmer has a buffer in local storage and doesn't range check it. A would-be exploiter still cannot modify the return address nor can he modify the parameter stack. The most he could do would be to hose the local variable storage (granted, that might still allow him to corrupt the local vars for some other function and perhaps get an exploit that way, but it would be even more difficult).

    Granted, to do what I just suggested means throwing out *all* standard libraries, tools, compilers, and so forth - I am not actually suggesting that the x86 family do this! However, for new architectures like Sledgehammer et. al, this might be the time to make such a break.

  43. Re:Terrific... by smash · · Score: 2, Insightful
    SMP makes the kernel less secure? Wow. Gee. Yeppers, we must have seen a MILLION security holes in Linux from the SMP code.... (yeah, right.)

    Simply claiming that it would make it more complex and less secure still doesn't excuse the fact that it's just about the only real, stable, robust operating system left that doesn't support SMP.

    They're called race conditions. Anyway, regardless of whether or not it directly adds to the security risk, it makes the code more complex and difficult to audit, which reduces the amount of developer time available for auditing the rest of it - and there has definately been more security holes in Linux than OpenBSD - maybe featuritis is a contributing factor?

    SMP simply is not a requirement for OpenBSD's niche. Besides, if you want SMP in OpenBSD, there's nothing to stop you forking it and building your own...

    smash.

    --
    I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.