Slashdot Mirror


Exec Shield for the Linux Kernel

DarkOx writes "There is a new patch from Ingo Molnar which can prevent overflow attacks. The scoop from KernelTrap is as follows: Ingo Molnar has announced a new kernel-based security feature for Linux/x86 called 'Exec Shield'. He describes the patch, which is against the 2.4.20-rc1 kernel, as: 'The exec-shield feature provides protection against stack, buffer or function pointer overflows, and against other types of exploits that rely on overwriting data structures and/or putting code into those structures. The patch also makes it harder to pass in and execute the so-called 'shell-code' of exploits. The patch works transparently, ie. no application recompilation is necessary.'"

264 comments

  1. Great! by Anonymous Coward · · Score: 0, Troll

    Now we can get java slowness in all applications in one easy step! In addition, we can now write sloppy code and just tell people to install this patch first! Finally, open source programming has gotten easy.

    1. Re:Great! by groomed · · Score: 4, Informative
      Nah. From the announce:

      the patch was designed to be as efficient as possible. There's a very minimal (couple of cycles) tracking overhead for every PROT_MMAP system-call, plus there's the 2-3 cycles cost per context-switch.

    2. Re:Great! by kinema · · Score: 2, Interesting
      In addition, we can now write sloppy code and just tell people to install this patch first!

      Protected/virtual address spaces help avoid a plethra of security/stability issues. Does this mean in your opinion that such virtual addressing encourages sloppy programming?

      --adam

  2. grsec ? by destiney · · Score: 5, Interesting


    Sounds like much of the same security that's been available from grsecurity.net for quite a while now.

    1. Re:grsec ? by theArtificial · · Score: 0

      mmmmm :O~

      --
      Man blir trött av att gå och göra ingenting.
    2. Re:grsec ? by groomed · · Score: 3, Informative

      I'm not familiar with grsec, but from a brief glance at the grsec site I don't see how they are alike. grsec appears to be an ACL based security model, whereas exec-shield just makes it a lot harder for the CPU to execute code that was never meant to be executed (from the owner of the machine's point of view...).

    3. Re:grsec ? by destiney · · Score: 2, Informative


      All I can say is try it. There's a lot more to it than just an ACL. In fact I don't even use the ACL, I use all the _other_ security enhancements it offers.

    4. Re:grsec ? by intermodal · · Score: 0, Flamebait

      this was posted by Michael. What do you expect, research?

      --
      In SOVIET RUSSIA... erm...NSA AMERICA, the Internet logs onto YOU!
    5. Re:grsec ? by cras · · Score: 4, Informative

      Yes, grsecurity includes equilevant protection to this. It uses PAX kernel patch for this. It has existed for years, and Ingo really should have mentioned that in his announcement, assuming he even knew about it?

      Difference is that PAX uses some weird x86 kludges to do this and it causes slight speed difference (max. 10% IIRC), but I think that's a very small penalty for very good protection against buffer overflows. It also reduces the maximum memory available to process by .. was it 1-2GB, but there's not many processes that really need that much. And Ingo's patch seems to limit at least number of executable pages even more so.

    6. Re:grsec ? by caouchouc · · Score: 1

      Your glance was a far too brief, then. The grsec kernel patches contain code to prevent buffer overflows and stack smashing by enforcing non-executable code pages and randomizing stacks. It also includes security features like ID/port randomization, restricting system call access in a chroot jail and of course, The ACL functionality.

    7. Re:grsec ? by Anonymous Coward · · Score: 1, Interesting
      grsecurity has been around for ages - it predates the work done on OpenBSD by several years and appears in a much more highly evolved state by comparison.

      grsecurity actually allows you to choose from two seperate means of protecting memory - one based on paging which introduces a small overhead on x86 but is 'free' on other architectures. The other is based on segmentation which is 'free' on x86, but limits applications to 1.5Gb address space. This of course is on top of address space randomisation, stack base randomisation, memory map base randomisation, protection against page permission changes and text relocations, random PIDs, random ISNs, random source ports, /proc restrictions, to name but a few. Let's not forget ACLs, either.

      Really Exec Shield is small stuff - it has much coarser grain control, only protects against a relatively small number of code injection attack methods compared to grsecurity, and covers none of the other areas.

    8. Re:grsec ? by Anonymous Coward · · Score: 0

      The segmentation part of grsecurity still allows an exploit to return to a shared library addresses, while the Exec Shield does not. The Exec Shield also tries to limit the size of the code segment much more than the segmentation-based solution in grsecurity - resulting in a much smaller area of attack.

      The paging based variant of PaX is used by almost no-one, and the 10% performance impact is claimed by the developers. How much performance impact PAX's 'artificial' pagefaults have on a busy server is up in the air, but it's probably quite significant.

      Exec Shield does not get as precise coverage of executable areas as the PaX paging-based solution, it probably gets more than the segmentation based PaX method. It also introduces scheduling overhead.

      So it's three solutions with different limitations and tradeoffs.

    9. Re:grsec ? by Anonymous Coward · · Score: 3, Informative

      > The segmentation part of grsecurity still allows an exploit to return to a shared library addresses

      Wrong, address randomization prevents that (in a probabilistic sense). Nor does Exec Shield prevent it (hint: i386 is little endian).

      > The Exec Shield also tries to limit the size of
      > the code segment much more than the
      > segmentation-based solution in grsecurity
      > - resulting in a much smaller area of attack.

      You don't have many clues what you're talking about, do you? ;-) SEGMEXEC in PaX/grsec *completely* separates code from data, absolutely not true for Exec Shield. Studying the docs at http://pageexec.virtualave.net/docs/ or at least taking a look at /proc//maps would be useful...

      As for the paging based solution: it's not the default, so no wonder not many people are using it ;-). And they don't need to since SEGMEXEC does all and without the performance impact.

      > [Exec Shield] probably gets more [coverage]
      > than the segmentation based PaX method

      Completely false, see above.

    10. Re:grsec ? by hjhornbeck · · Score: 2, Informative

      The stack/executable bits are there, it's just not that obvious in the feature list. Here's a sample from the news page:

      grsecurity 1.9.9f has been released. Changes include RANDEXEC for alpha, sparc, sparc64, and parisc. It also includes KERNEXEC for i386, which implements non-executable and read-only KERNEL pages. To use the feature, you must build a monolithic kernel (that is, CONFIG_MODULES = n). KERNEXEC also makes the IDT, GDT, and syscall table read-only. In addition, stack/mmap randomization has been added for PowerPC, multiple administrators are allowed in the ACL system, and a fix for the ptrace patch discussed on LKML has been included.
      HJ Hornbeck
  3. Yes, but does it... by Anonymous Coward · · Score: 3, Funny

    prevent people from logging into X as root and screwing up their system.

    A cure for stupidity is a many-splendored thing - Publius Julius Caesar on the day before the ides of March ## B.C.

    1. Re:Yes, but does it... by Anonymous Coward · · Score: 0

      darn... you mean its more functionial than ascii art???

      oh well... just us windows users

  4. WOW! by benna · · Score: 4, Interesting

    Two stories today with reasons to switch to linux. First IE dies with simple HTML (But really is it any surprise that this is possible) and now a sweet knewe patch for linux. Could it be any better?

    --
    "It is not how things are in the world that is mystical, but that it exists." -Ludwig Wittgenstein
    1. Re:WOW! by Anonymous Coward · · Score: 0

      Stop making stupid posts, then go and fuck yourself.

    2. Re:WOW! by Anonymous Coward · · Score: 0

      No, but i want to keep my karma so i get moderator points to moderate idiots like you down.

    3. Re:WOW! by Anonymous Coward · · Score: 0

      Don't worry benna he is probobly just afraid of your sig.

    4. Re:WOW! by Anonymous Coward · · Score: 0

      Fanboy AND coward!

    5. Re:WOW! by Anonymous Coward · · Score: 0

      Hah now you will prolly end up on some black list!

    6. Re:WOW! by crazysim · · Score: 0

      Is this your first time reading this blog?

    7. Re:WOW! by geddes · · Score: 4, Funny
      Two stories today with reasons to switch to linux
      You don't browse here often do you?
    8. Re:WOW! by Anonymous Coward · · Score: 0

      Except for the fact that Windows kernel already has this.

    9. Re:WOW! by caouchouc · · Score: 1

      It may be a new patch, but I'm not sure why Ingo bothered when grsecurity already does what exec-shield does, and far more.

    10. Re:WOW! by alonsoac · · Score: 1

      Two stories today with reasons to switch to linux. First IE dies with simple HTML (But really is it any surprise that this is possible) and now a sweet knewe patch for linux. Could it be any better?

      "Ha ha look IE dies on that stupid little HTML code! Oh! And look someone just submitted some patch to the kernel. That's it, I'm making the switch. No more windows for me sir!"

      yeah right

    11. Re:WOW! by Anonymous Coward · · Score: 0

      I wonder how often the linux's nifty open-source ideas/solutions find their way into other OSs....

  5. Ingo's announcement by steveha · · Score: 3, Informative

    http://people.redhat.com/mingo/exec-shield/ANNOUNC E-exec-shield
    _____________________________________________

    [Announcement] "Exec Shield", new Linux security feature

    We are pleased to announce the first publically available source code
    release of a new kernel-based security feature called the "Exec Shield",
    for Linux/x86. The kernel patch (against 2.4.21-rc1, released under the
    GPL/OSL) can be downloaded from:

    http://redhat.com/~mingo/exec-shield/

    The exec-shield feature provides protection against stack, buffer or
    function pointer overflows, and against other types of exploits that rely
    on overwriting data structures and/or putting code into those structures.
    The patch also makes it harder to pass in and execute the so-called
    'shell-code' of exploits. The patch works transparently, ie. no
    application recompilation is necessary.

    Background:
    -----------

    It is commonly known that x86 pagetables do not support the so-called
    executable bit in the pagetable entries - PROT_EXEC and PROT_READ are
    merged into a single 'read or execute' flag. This means that even if an
    application marks a certain memory area non-executable (by not providing
    the PROT_EXEC flag upon mapping it) under x86, that area is still
    executable, if the area is PROT_READ.

    Furthermore, the x86 ELF ABI marks the process stack executable, which
    requires that the stack is marked executable even on CPUs that support an
    executable bit in the pagetables.

    This problem has been addressed in the past by various kernel patches,
    such as Solar Designer's excellent "non-exec stack patch". These patches
    mostly operate by using the x86 segmentation feature to set the code
    segment 'limit' value to a certain fixed value that points right below the
    stack frame. The exec-shield tries to cover as much virtual memory via the
    code segment limit as possible - not just the stack.

    Implementation:
    ---------------

    The exec-shield feature works via the kernel transparently tracking
    executable mappings an application specifies, and maintains a 'maximum
    executable address' value. This is called the 'exec-limit'. The scheduler
    uses the exec-limit to update the code segment descriptor upon each
    context-switch. Since each process (or thread) in the system can have a
    different exec-limit, the scheduler sets the user code segment dynamically
    so that always the correct code-segment limit is used.

    the kernel caches the user segment descriptor value, so the overhead in
    the context-switch path is a very cheap, unconditional 6-byte write to the
    GDT, costing 2-3 cycles at most.

    Furthermore, the kernel also remaps all PROT_EXEC mappings to the
    so-called ASCII-armor area, which on x86 is the addresses 0-16MB. These
    addresses are special because they cannot be jumped to via ASCII-based
    overflows. E.g. if a buggy application can be overflown via a long URL:

    http://somehost/buggy.app?realyloooooooooooooooooo oong.123489719875

    then only ASCII (ie. value 1-255) characters can be used by attackers. If
    all executable addresses are in the ASCII-armor, then no attack URL can be
    used to jump into the executable code - ie. the attack cannot be
    successful. (because no URL string can contain the \0 character.) E.g. the
    recent sendmail remote root attack was an ASCII-based overflow as well.

    With the exec-shield activated, and the 'cat' binary relinked into the the
    ASCII-armor, the following layout is created:

    $ ./cat-lowaddr /proc/self/maps
    00101000-00116000 r-xp 00000000 03:01 319365 /lib/ld-2.3.2.so
    00116000-00117000 rw-p 00014000 03:01 319365 /lib/ld-2.3.2.so
    00117000-0024a000 r-xp 00000000 03:01 319439 /lib/libc-2.3.2.so
    0024a000-00

    --
    lf(1): it's like ls(1) but sorts filenames by extension, tersely
  6. RedHat keeps the evolution going. Excellent work. by Anonymous Coward · · Score: 1

    This is quite nice -- more protection against kernel stack smashers.

    I really hope this makes the next RedHat dist.

    Its funny, everyone makes fun of RedHat and security, but they really do try, and with some good disabling of services that don't need to be run, RedHat is pretty secure.

    Excellent work.

    Watch SCO claim this came from them...

  7. FP by Anonymous Coward · · Score: 1, Funny

    FP!!!!! (well, hopefully so... but my browser is taking forever to do anything with this new patch...)

  8. Re:Great! [Scott] by wass · · Score: 5, Insightful
    In addition, we can now write sloppy code and just tell people to install this patch first!

    Well, yes and no. Think about the analogy of this to driving. Cars today have a number of safety features, including seat belts, air-bags, anti-lock breaks, etc. Do we drive less safely because of them? More importantly, should we not include these devices in cars to increase driving safety?

    I believe it was Chris Rock joking about this in one of his sketches. He claimed that airbags are NOT going to make someone drive safely. He said something like "What you need is a giant spike coming out of the steering wheel. That'll make someone drive safe!".

    --

    make world, not war

  9. LIDS? by LinuxHam · · Score: 1

    How is this different from the buffer overflow protection offered by LIDS? Just asking...

    --
    Intelligent Life on Earth
    1. Re:LIDS? by dusanv · · Score: 1

      LIDS doesn't offer stack overflow protection whereas this patch does. LIDS addresses different security areas as far as I know.

  10. This is good. by dracocat · · Score: 5, Interesting

    While of course all of our software should be correct, using the Operating System to make software more robust is almost always a good thing.

    Assuming their claims of extremely low over-head are true, why would we not want this?

    In fact, a lot of security issues could be stopped before they ever happen if we look more closely at the Operating System instead of all the software! Think how much easier it would be to work on isolating software and protecting the system from itself than trying to make every single app ever written secure. Yes, focusing attention to the Operating System for vulerabilites is a good step--even though we can't ignore our applications.

    1. Re:This is good. by dWhisper · · Score: 1, Interesting

      In fact, a lot of security issues could be stopped before they ever happen if we look more closely at the Operating System instead of all the software!

      Very true. It's one of the odd curiosities I've always seen between security issues for Linux and Windows. Linux has the exploits published against applications, and Windows has them published against the OS when an application is exploited.

      I have to wonder if this will move the Linux kernal closer to the level of the Windows Kernal [READ, EASE OF USE - NOT SECURITY] for overall marketability to individuals. I'd like to see Linux settle into that niche that Windows dominates for ease of use. Linux may be powerful, but there isn't anyone who can argue it's easy to use.

    2. Re:This is good. by spencerogden · · Score: 1

      What in the world does this patch have to do with ease of use? And further, what does the kernel have to do with eaase of use for the average user?

    3. Re:This is good. by I_redwolf · · Score: 1

      How did this get modded up? As interesting? It should be +1 Funny.

    4. Re:This is good. by dWhisper · · Score: 1

      Sorry. It should have been a little clearer, and I shouldn't post while drinking.

    5. Re:This is good. by Anonymous Coward · · Score: 0

      onnt eh contraryy its t eh bestt ttime to postt toslashdott wheenn u drirnkkk keepp up teh dgood workk!! 8hiC**8

    6. Re:This is good. by RealUlli · · Score: 4, Insightful
      Very true. It's one of the odd curiosities I've always seen between security issues for Linux and Windows. Linux has the exploits published against applications, and Windows has them published against the OS when an application is exploited.

      Well, as long as MS keeps claiming IE, IIS etc. are part of the operating system and can not be separated, exploits against those parts should be filed against the OS. In Linux, when an application gets exploited, well you don't have to run that application, you don't even have to install it, it *is* separable from the OS! Especially as there are alternatives to (almost) everything...

      Regards, Ulli

      --
      Simple things should be simple, complex things should be possible.
    7. Re:This is good. by 0x0d0a · · Score: 1

      Very true. It's one of the odd curiosities I've always seen between security issues for Linux and Windows. Linux has the exploits published against applications, and Windows has them published against the OS when an application is exploited

      I don't get it -- I've never seen this. Can you give an example? The only thing I can think of that you might be thinking of is that IE updates get classified under OS updates, as it's bundled with the OS.

    8. Re:This is good. by Anonymous Coward · · Score: 0

      Linux is easier to use than Windows. That might not be true for everyone tho :P

    9. Re:This is good. by karlm · · Score: 4, Insightful
      I have to wonder if this will move the Linux kernal closer to the level of the Windows Kernal [READ, EASE OF USE - NOT SECURITY] for overall marketability to individuals.

      Umm... do you have some vague notion of what the kernel is? First of all, it isn't spelled with an "a". Secondly, ease of use of a kernel is a very messed up concept and I'm not even sure what it means. The kernel isn't easy or hard to use any more than winsock.dll is easy or hard to use. Very few programmers interact with the kernel except through libraries, so "easy of use" (whatever you mean by that) is much more important in the low-level libraris than the kernel. How does this affect marketability to individuals? Both POSIX and Win32 APIs are available on both systems. Are you referring to clean kernel interfaces, clean kernel implementation, availablility of the source for better understanding, or some other metric?

      Kernel: That word... you keep using it. I do not think it means what you think it means.

      I think you're thinking about UI. The GUI, the shell, the command line, the layout of the directories, etc. are all very very far removed from the kernel. In theory you could run explorer (the Win32 shell, not IE) on top of WINE, along with all of the Win32 programs and the user would have identical ease of use as Windows. 99.99% of users couldn't tell it wasn't the NT kernel and couldn't show evidence of it being Linux even if told (without watching the boot sequence). Asking about "ease of use" of a kernel is like asking about the top speed of your house. Neither question makes much sense unless you further define your strange thinking. You could guess that the person is asking how fast a house would be going when it hit the ground if dropped from 60,000 feet up (terminal velociy) just like you could assume a person is talking about how clean a kernel's APIs are. However, the usual sense of ease of use as realated to marketing to individuals is ease of use of the UI. I can only make educated guesses as to what strange thoughts are going through your head. For all I know, you filled hard drive platters up with both kernels and are attempting to use the platters to cut 440 stainless bar stock and are referring to the different metal cutting characteristics of kernel-filled HD platters. Please clarify exactly how you think the ease of use of the NT and Linux kerenls differ.

      --
      Copyright Violation:"theft, piracy"::Anti-Trust Violation:"thermonuclear price terrorism"<-Overly dramatic language.
    10. Re:This is good. by cyb97 · · Score: 1

      Or even better, you can simply fix the problem in the source (download a patch or do it yourself) and compile the software all over again...
      How many IIS-users has swatted their bugs that fast?

  11. Uh Oh... by Cylix · · Score: 5, Funny

    You do realise this kind of advancement would not be possible with out assistance from highly successful companies like SC...

    Hrm...

    "Shit, spaceballs, there goes the planet" --apes

    --
    "You should always go to other people's funerals; otherwise, they won't come to yours." -- Yogi Berra
  12. We should thank SCO for this innovation by Anonymous Coward · · Score: 0

    Thank you SCO!
    It's great to see that you're at the cutting edge of Linux development!

    1. Re:We should thank SCO for this innovation by Anonymous Coward · · Score: 0

      I think we got it the first 2 times people said it.

  13. Yeah... by dWhisper · · Score: 0, Flamebait

    Linux could play games other than Q3/UT, have the ability to easily install programs. Don't get me wrong, I'd switch to Linux if I could do the same things in it that I can in Windows.

    But I can't.

    1. Re:Yeah... by damiam · · Score: 4, Funny

      You're forgetting XBill.

      --
      It's hard to be religious when certain people are never incinerated by bolts of lightning.
    2. Re:Yeah... by DataPath · · Score: 2, Interesting

      Its surprising what you can find out there if you look. Just last month, I was pointed to an installer+binary for running Serious Sam: The First Encounter under Linux. Plays like a dream.

      --
      Inconceivable!
    3. Re:Yeah... by oaf357 · · Score: 2, Funny

      I hate to boast but I have a "Moving to Linux" project in the works to create the functionality of Windows in Linux. It doesn't mean that Linux will be as easy as Windows but I'm just trying to "create functionality" and document it.

    4. Re:Yeah... by aardvarkjoe · · Score: 1

      Nah, we've already got it.

      --

      How can we continue to believe in a just universe and freedom to eat crackers if we have no ale?
    5. Re:Yeah... by Grexor · · Score: 1

      Checkout winex, opens up a ton of new Linux gaming opportunities, or so it claims.

    6. Re:Yeah... by dWhisper · · Score: 2, Interesting

      I have looked at WineX, the problem with it is that it takes individual upgrades for specific games. It's just me, but I'd rather see native support for the individual titles than getting emulated support for the titles, which adds an unnecesary proccessing layer to the system. I know I'm getting flamed for up above, but I support Linux.

      I want Linux to succeed more than anything, because I love some of the things that it does. KDE and Gnome both blow away Windows from the level of usefullness and power, and the control and security of Linux are awesome. But the programs I use the most, Bryce 5, Photoshop, and MS Office, are Windows only, and the competing applications are just not up to where they are.

      Blender has a learning curve steeper than everest, and I'd have to program my own lab plugins to do the work I do now. Gimp is a good program, but 6 years of work with Photoshop have made me dependant. And Office is still the best of Microsofts programming.

      I may do the switch soon though, because I'm taking up PHP coding for web application deployment and programming. So we'll see.

    7. Re:Yeah... by unapersson · · Score: 1

      "But the programs I use the most, Bryce 5, Photoshop, and MS Office, are Windows only, and the competing applications are just not up to where they are."

      Well both MS Office and Photoshop (all versions) will now run under Codeweavers CrossOver Office (http://www.codeweavers.com/home/).

      ian.

    8. Re:Yeah... by hetta · · Score: 2, Insightful

      You're forgetting XBill.
      XBill is actually very pro-M$.
      Because no matter what you do, sooner or later you end up with winbows on every machine on the screen.

      It should be changed so that you can actually win the game. No more Bills to swat at level 10, or at 1000 points, or whatever.

    9. Re:Yeah... by 0x0d0a · · Score: 1

      Bryce 5

      I doubt there's going to be anything like it for Linux. The computer graphics world lost a brilliant man when Kai Krause retired.

      Photoshop

      If you do output for print, the Gimp is nowhere near Photoshop, and won't be for a while. If you do output for digital media, the Gimp can quite handily go toe-to-toe with Photoshop.

      MS Office

      Yup. Open Office is good enough for folks that occasionally have to interact with Office docs and are fed up with having to deal with Windows, but if .doc files are bread-and-potatoes for you, Microsoft pretty much has you locked in.

    10. Re:Yeah... by platypus · · Score: 1

      The computer graphics world lost a brilliant man when Kai Krause retired.

      He didn't really retire. In case you're interested, you can find the website of his project at http://www.byteburg.de/

      Go to the german version, there is also english content.

    11. Re:Yeah... by Anonymous Coward · · Score: 0

      Who cares? I use it because it's free AND I can play a few games. You should stay with Windows.

    12. Re:Yeah... by Anonymous Coward · · Score: 0

      You sound like you want to use Linux because it's cheap, but you don't appreciate it because it's free.

      Honestly, you should stick with Windows and asp.

    13. Re:Yeah... by Nucleon500 · · Score: 1
      You're clearly not l337.

      Write a kernel input driver for a mouse which randomly moves and clicks at a very very high speed.

    14. Re:Yeah... by dWhisper · · Score: 1

      Actually, I could care less about the price. I feel that Linux cannot gain success by staying free, and Windows cannot keep success by staying expensive.

      Microsoft has purchased my last 3 copies of Windows for me. I have purchased copies of Mandrake, Red Hat, SuSE and Debian. It's not a matter of not appreceating it, it's a matter of not being able to do what I want with it. If I could, I would switch in a heartbeat.

  14. binutils patch? why? by Anonymous Coward · · Score: 1, Interesting
    Note that the kernel will relocate every shared-library to the ASCII-armor, but the binary address is determined at link-time. To ease the relinking of applications to the ASCII-armor, Arjan Van de Ven has written a binutils patch...

    To change the starting virtual address of a binary, just change the linker script (or use a command-line option to the linker). Why did they have to patch binutils?

    They could also link with "--emit-relocs" to leave the relocations in the binary. Then it could run in low memory or at the usual address (0x8048000).

    1. Re:binutils patch? why? by Loki_1929 · · Score: 1

      "They could also link with "--emit-relocs" to leave the relocations in the binary. Then it could run in low memory or at the usual address (0x8048000)."

      But what about the quantum flux capacitor?!

      --
      -- "Government is the great fiction through which everybody endeavors to live at the expense of everybody else."
  15. "read or execute" flag? by steveha · · Score: 4, Insightful

    I'm trying to understand this fully, but I don't have all the background to do so.

    From the announcement:

    It is commonly known that x86 pagetables do not support the so-called executable bit in the pagetable entries - PROT_EXEC and PROT_READ are merged into a single 'read or execute' flag. This means that even if an application marks a certain memory area non-executable (by not providing the PROT_EXEC flag upon mapping it) under x86, that area is still executable, if the area is PROT_READ.

    Is this limitation in the x86 processor MMU, or in the Linux kernel?

    Is anyone working to fix this limitation? (E.g. AMD fixing it in 64-bit mode on the Opteron, or someone reworking the Linux kernel)

    Furthermore, the x86 ELF ABI marks the process stack executable, which requires that the stack is marked executable even on CPUs that support an executable bit in the pagetables.

    Does this statement imply that some x86 processors do the right thing with PROT_EXEC?

    If Linus is willing to create a new ELF standard, could this problem be fixed? Would it be worth the pain of a new incompatible ELF standard? Are there any other problems that can only be fixed with a new version of ELF, so we can fix them together?

    It would be sort of cool to get a new ELF standard, so that Linus can call the new kernel "3.0"! :-)

    steveha

    --
    lf(1): it's like ls(1) but sorts filenames by extension, tersely
    1. Re:"read or execute" flag? by Anonymous Coward · · Score: 5, Informative

      The limitation is with most x86 processors. The new AMD x86-64 architecture does not suffer from this problem, and I believe linux on it defaults to nonexecutable stack (at least that's what was said on the LKML).

    2. Re:"read or execute" flag? by Anonymous Coward · · Score: 2, Informative

      The problem exists in all x86-32 processors, and always has. AMD's Opteron x86-64 does have the ability to mark such code as non-executable while readable, but only in x86-64 mode. 32-bit applications will still suffer.

      While I applaud the effort made for this product, I still believe that the only way to completely shield ourselves from such attacks is to enforce it in hardware.

    3. Re:"read or execute" flag? by mark-t · · Score: 4, Informative
      Is this a limitation of the x86? No, not really.

      The problem is the way that people use x86's paging mechanism. Each page can, in fact, be distinctly assigned to being either code or data, but because each page requires a distinct entry in the page table, if each process had to have separate code and data pages, then it would stand to double the number of page table entries.

      So why did they do it this way, if it was so simple to avoid? Back in the early 90's, when Linux was first written, it was highly desirable (with protected mode code in general) to minimize distinct page table entries in the x86 because page tables could take up so much space. So protected mode programs (and operating systems) were typically designed so that the code and data segment descriptors could end up mapping to the same pages in the x86's paging mechanism to reduce overall page count.

      Indeed, if the x86 had not allowed a page to be both writeable and executable, then this would never have been an issue. Although it would have had the memory overhead in the page table entries that I described earlier, since we wouldn't have even had a choice in the matter, we would have just had to settle for what we got (although back then the design would have likely been criticized as being wasteful of memory).

    4. Re:"read or execute" flag? by HidingMyName · · Score: 4, Insightful

      Read or execute may only be a problem because when we want to allow stack access with read/write permissions, we wind up granting execute/write permissions. I think OpenBSD is working on getting rid of having both write and execute permissions on the same memory region. However, Linux may not be able to follow suit due to the use of trampoline functions (as described here). How OpenBSD plans to get around this, I'm not sure, it is possible that I have a faulty memory regarding OpenBSD's avoidance of write/execute in the kernel.

    5. Re:"read or execute" flag? by IkeTo · · Score: 5, Informative

      This means that even if an application marks a certain memory area non-executable (by not providing the PROT_EXEC flag upon mapping it) under x86, that area is still executable, if the area is PROT_READ.

      Does this statement imply that some x86 processors do the right thing with PROT_EXEC?

      No. The x86 page table has 12 bits per page table entry for storing page information. It contains a bit for R/W (read/write) which you can force a page read-only; and it contains a bit U/S (user/supervisor) which you can force a page usable only by the kernel. There is nothing which says "this page must not be executed as code". So Linux kernel actually has an interface that only some hardware provides. I don't think now it still has spare bit to give for executable bit.

      Furthermore, the x86 ELF ABI marks the process stack executable, which requires that the stack is marked executable even on CPUs that support an executable bit in the pagetables.

      Does this statement imply that some x86 processors do the right thing with PROT_EXEC?

      It is not about "do the right thing". The processor simply has no such bit, so there is no new "right thing" for it to do---it is already doing the right thing. The processor assumes that segmentation is used to enforce execute permission, so that each library code should be allocated a segment and inter-segment jumps and calls should be used to access them. In such way only read-only code segments are executable. Linux simply decided at the very beginning not to employ this facility.

      If Linus is willing to create a new ELF standard, could this problem be fixed?
      ELF is not designed by Linus. And even if ELF is changed so that stack is not assumed executable by default (which probably break some programs that rely on executable stack), all computers from 386 to P4 will not benefit from it.
  16. Saturday night /. Session by Anonymous Coward · · Score: 5, Funny


    Another saturday night spent on /. When I look back, this is what I'll remember.

  17. easier on x86-64 by ceswiedler · · Score: 5, Informative

    Someone on lkml asked:

    Slightly off-topic, but does anybody know whether IA64 or x86-64 allow you to make the stack non-executable in the same way you can on SPARC?

    and hpa replied to this:

    x86-64 definitely does, and it's the default on Linux/x86-64.

    Up to now, x86 chips have not been able to separate Read from Execute privileges for memory segments, which makes it hard to make stacks non-executable. This is excellent news for anyone looking forward to AMD's x86-64 chips...it keeps looking like they've done the Right Things.

    1. Re:easier on x86-64 by DeathB · · Score: 1

      IA-64 Allows for it as well. It also has region support, so that executable and stack regions of memory can be completely separate.

      adam

      --
      Would you do it for some scoobie crack?
    2. Re:easier on x86-64 by master_p · · Score: 1

      Up to now, x86 chips have not been able to separate Read from Execute privileges for memory segments

      On x86, the stack segment can be a different area of memory than the app's memory space. It is just Linux that implements it that way.

      A long time ago I proposed that the SS register should point to another area of memory which is not executable. People replied by pointing out that the way GCC implements trampolines requires code to be executable from the stack. I strongly disagree with trampolines, as I don't see any reason for the stack to contain any executable code, whatsoever.

      In fact, I proposed a complete separation of code and data: the CS and DS registers to point to completely different memory areas. People said that it would break apps and GCC. I can't see that: function pointers are not exchangeable with data pointers. A function pointer with value 0x00FF0000 would implicitely point to the CS segment, whereas a data pointer with the same value would implicitely point to the DS segment.Maybe the problem lies with treating code as data for the compiler/debugger ?

    3. Re:easier on x86-64 by Cylix · · Score: 1

      *region support*

      Damn, the MPAA has seriously messed with Intel's executive committee. I can just envision a whole slew of region specific software titles and pricing schemes.

      An MPAA exec was quoted earlier, "It isn't like we even have to make sense with these decisions anymore. Humanity has been given a drink with a few mickeys and were about to take them to the bedroom for a night of uninhibited drunken flurry of ass reaming!"

      Intel spokesmen were not available for comment as they still seemed to be woozy from the night before.

      --
      "You should always go to other people's funerals; otherwise, they won't come to yours." -- Yogi Berra
    4. Re:easier on x86-64 by Ben+Hutchings · · Score: 1

      The same shitty code that doesn't check the length of input data probably also makes unportable assumptions about convertability of pointers. I think we could get more progress by using tools for detecting buffer overflow vulnerabilities and other stupidity at the source level. I think the OpenBSD developers have written some tools along these lines. Developers can use them to sanity-check their code, and sysadmins can use them to see which software they should be replacing them before it bites them in the ass.

  18. Is that simiar by Anonymous Coward · · Score: 0

    to what this whitepaper is talking about?

  19. Just one problem with it... by Fefe · · Score: 4, Insightful

    The page says they are mapping all the code in the lower 16 MB of the address space. And they keep the first MB unmapped for NULL pointer protection.

    That leaves us with only 15 MB of space for code!

    Are they really trying to say that they have not hit that limit yet? No program on earth has more than 15 MB code?! I can hardly believe that.

    I was going to cite Emacs on this one, but Emacs is an interpreter, so the actual interpreter code might be small enough. Mhh. What about Mozilla?

    Heck, what about WINE?! ;) They are emulating Windoze, you can't be serious about those 15 MB! That'll hardly contain GDI.DLL!

    1. Re:Just one problem with it... by i_am_nitrogen · · Score: 4, Informative

      It only says the code is mapped to the bottom 15MB. Each program has its own address space. It still exists in any part of physical memory it wants to, but the beginning virtuial address is put in the lower 16MB instead of the current default, which I believe relocates programs to 0x08048000 or something like that.

    2. Re:Just one problem with it... by BZ · · Score: 1

      > What about Mozilla?

      For Mozilla, code + data is on the order of 20MB. I'd be surprised if more than 15MB of that is code -- the encoding conversion tables and the printing tables are huge.

    3. Re:Just one problem with it... by Genyin · · Score: 1

      It only says the code is mapped to the bottom 15MB. Each program has its own address space. It still exists in any part of physical memory it wants to, but the beginning virtuial address is put in the lower 16MB instead of the current default, which I believe relocates programs to 0x08048000 or something like that.

      Sigh... second person in the past 24 hours that I've felt compelled to take the cluebat to. (This is slashdot... why am I surprised?) Parent was asking about the question of what happens if one tries to run a single program with more than 15MB worth of object code+libraries.

      At least it is clear both parent and grandparent understand what parent just said-- parent was answering the wrong question. Certainly it shouldn't be at 5 (at least in reply to grandparent)

      That said, I am quite interested to know how they handle the issue of programs over 15M. (presumably by letting some of the code out of this 'ascii armor'?)

    4. Re:Just one problem with it... by master_p · · Score: 1

      16 MB of machine code is produced by (roughly speaking, from my empirical estimations) about 5 million lines of code. MS Word 2000 is about 8 MB, and that contains a lot of data.

    5. Re:Just one problem with it... by conway · · Score: 1

      But consider all the libraries which are also exectuable code.
      Sure, your program only takes up 1MB of executable code, but it'll use libc, libm, etc. etc. which can add up to a lot of space.
      I think the only thing helping them here is that linux code tends to be written as many separate processes to handle tasks, rather than huge monolithic programs. Therefore, each small process would be protected as it runs.

  20. Possible Problem by Sunlighter · · Score: 5, Interesting

    I've written a few pieces of code which take advantage of the executability of the stack and the heap. For example if you want to write a just-in-time compiler for some language, an easy way to do it is allocate an area on the heap, let the JIT compiler write the appropriate x86 machine code into that area, and then typecast the area pointer to a function pointer and execute it.

    With this patch, that won't work...

    --
    Sunlit World Scheme. Weird and different.
    1. Re:Possible Problem by that_guy · · Score: 1

      It will work with the patch, because you can specifically decline to have the kernel enable this protection for your program. (or you can only enable it for the applications you want)
      While you may not be able to enable this kind of protection for that type of program, its possible for the two to coexist on the same system.

      --

      Driving backwards on the highway of life
    2. Re:Possible Problem by ArmorFiend · · Score: 1

      Couldn't there be some sort of syscall to allow executing your stack, with the default set to "no"?

    3. Re:Possible Problem by Soko · · Score: 4, Informative

      Would a memcopy from the heap into executeable space be a fix?

      Perhaps even better would be to have your own "private" heap in userland. That would protect the OS, and you get to use your trick still.

      I'm not a coder by trade, so I can't really critisize what you're doing. I do understand operating systems and memory allocation therein though, so my admittedly uninformed opinion is that you're employing a somewhat dangerous hack here. The heap was not intended to hold executeable programs - you'd be broken on x86-64 as well. Using what amounts to a design flaw in a program isn't what I would be willing to call "good design". Might be better to come up with a different method - Ingo Molnar seems to think you do at any rate.

      Soko

      --
      "Depression is merely anger without enthusiasm." - Anonymous
    4. Re:Possible Problem by dvdeug · · Score: 2, Insightful

      you're employing a somewhat dangerous hack here.

      Dynamically writing code is not a dangerous hack. The more correct way of solving this problem is for people not to use unchecked arrays that can overflow - C, C++ and a few other really low level languages about the only languages that have unchecked arrays as a standard data type. Most of these problems don't show up in programs written in other languages.

    5. Re:Possible Problem by InodoroPereyra · · Score: 2, Insightful
      Sunlighter says:

      I've written a few pieces of code which take advantage of the executability of the stack and the heap. [...] With this patch, that won't work...

      Fear not my friend :-) . Please read the announcement from Ingo:

      Applications that need to rely on gcc trampolines will have to use the per-binary ELF flag to make the stack executable again.

      [...]

      There is a new boot-time kernel command line option called exec-shield=,
      which has 4 values. Each value represents a different level of security:

      exec-shield=0 - always-disabled
      exec-shield=1 - default disabled, except binaries that enable it
      exec-shield=2 - default enabled, except binaries that disable it
      exec-shield=3 - always-enabled

      the current patch defaults to 'exec-shield=2'

      You will just need to flag your binaries ...

    6. Re:Possible Problem by ottffssent · · Score: 1

      Not entirely accurate. The patch has 4 modes of operation. Always-on and always-off, as well as "on unless the app says so" or "off unless the app says so" modes. The patch can easily be told not to step on any application's toes.

    7. Re:Possible Problem by jakobk · · Score: 1

      How can I do this?

    8. Re:Possible Problem by sgifford · · Score: 2, Interesting

      Instead of allocating from the heap with malloc, just create an anonymous memory map using mmap, setting PROT_EXEC to allow execution. Something like:

      m = mmap(NULL,
      1000000,
      PROT_READ|PROT_WRITE|PROT_EXEC,
      MAP_PRIVATE|MAP_ANON,
      -1,
      0);

      will allocate 1000000 bytes of memory which can contain executable code on Linux and BSD. On some other Unices you have to use /dev/zero, but the technique is pretty much the same.

    9. Re:Possible Problem by Vlad_the_Inhaler · · Score: 1
      What I hate most about the C family of languages, is that the only terminator for a string is a binary zero.
      It is not possible (at least in the implemention available to me) to ask 'how big is that string, physically'?

      The language I use on a day-to-day basis is (shock, horror) Cobol.
      Given a 50-byte field FIELD-50 and a 100-byte field FIELD-100,
      • MOVE FIELD-50 TO FIELD-100
        copies FIELD-50 to the first 50 bytes of FIELD-100 and fills the rest with spaces.
      • MOVE FIELD-100 TO FIELD-50
        copies the first 50 bytes of FIELD-100 to FIELD-50.
      This is part of the language, totally automatic and does not have to be implemented by using totally unintelligent string-copy functions.

      The Fortran implementation I use actually goes one better:
      • FIELD_100 = FIELD_50
      • FIELD_50 = FIELD_100
      work the same as the corresponding examples above, but Fortran has functions which return the physical length of a string, or the length of a string with all trailing spaces removed.

      An unrelated gripe with C is that the statement if (a = b) should never ever assign b to a and conditionally execute what comes next if the result is not zero.
      Given that the language is specified this way, a compiler should at least flag such a line with a message such as 'is this what you really want?'. Building in traps for the unwary is not what a language designer should be doing.
      --
      Mielipiteet omiani - Opinions personal, facts suspect.
    10. Re:Possible Problem by master_p · · Score: 1

      That's the only point that code and data are interchangeable, methinks. On-the-fly production of machine code should be treated by an interface provided by the OS to copy the heap object to the app's exec memory or map the page to the exec memory. Right now, you're in trouble.

    11. Re:Possible Problem by AndyS · · Score: 1

      GCC flags this and tells you to double bracket it in order to avoid the warning.

    12. Re:Possible Problem by that_guy · · Score: 1

      From the announcement:

      There is a new boot-time kernel command line option called exec-shield=,
      which has 4 values. Each value represents a different level of security:

      exec-shield=0 - always-disabled
      exec-shield=1 - default disabled, except binaries that enable it
      exec-shield=2 - default enabled, except binaries that disable it
      exec-shield=3 - always-enabled


      The way to enable/disable specific binaries would be through the chstk program, that he also modified.

      So its completely possible to have one application running without the protection while all the others are.

      --

      Driving backwards on the highway of life
    13. Re:Possible Problem by Vlad_the_Inhaler · · Score: 1

      Well done GCC. When I use C at all, it is an ANSI C compiler on a mainframe and that obvious little feature is missing.

      --
      Mielipiteet omiani - Opinions personal, facts suspect.
    14. Re:Possible Problem by Electrum · · Score: 1

      What I hate most about the C family of languages, is that the only terminator for a string is a binary zero. It is not possible (at least in the implemention available to me) to ask 'how big is that string, physically'?

      That's only if you use C strings. Use stralloc and you won't have that problem.

    15. Re:Possible Problem by sir99 · · Score: 1
      If the string is statically allocated or on the stack (but not dynamically allocated), then it's quite possible to get its size. If you have char foo[12], then you get the size of foo in bytes with sizeof(foo). It would be fairly trivial to write a string-assignment macro that behaves like COBOL, with sizeof and strncpy. But again, it would only work with non-dynamically allocated strings.

      COBOL is able to do all the truncation and padding automatically because all data is statically allocated, so all the sizes are known at compile-time.

      --
      The ocean parts and the meteors come down
      Laid out in amber, baby.
    16. Re:Possible Problem by Daniel+Phillips · · Score: 1

      Couldn't there be some sort of syscall to allow executing your stack, with the default set to "no"?

      Roughly equivalent to locking the door and leaving the key in the lock.

      --
      Have you got your LWN subscription yet?
    17. Re:Possible Problem by ArmorFiend · · Score: 1

      Yes but the key is on the inside of the door, and the bad guys are on the outside. If they can make syscalls already, they hardly have to worry about disabling this mechanism. :)

    18. Re:Possible Problem by Daniel+Phillips · · Score: 1

      Yes but the key is on the inside of the door, and the bad guys are on the outside. If they can make syscalls already, they hardly have to worry about disabling this mechanism.

      You can leave out the "but". Sorry for not specifying which side of the door you would be on when you lock it.

      --
      Have you got your LWN subscription yet?
    19. Re:Possible Problem by sjames · · Score: 1

      and then typecast the area pointer to a function pointer and execute it.

      A safer approach is to mmap some space with the PROT_EXEC | PROT_WRITE flags and write the code into that area. That way, you don't need an executable stack.

  21. Potentially Stupid Question by Farley+Mullet · · Score: 3, Interesting

    (As I'm sure you can tell) I don't claim to know much about any of this at all, but I did read the kerneltrap post, for what it was worth, and as a non-x86 user, I have a few questions. Ingo's patch is only for x86; is equivalent protection for other architectures possible, or even necessary? To what extent are buffer-overflow exploits architecture specific?

    Sorry if I'm missing something simple here.

    1. Re:Potentially Stupid Question by DarkMan · · Score: 4, Interesting

      Yes you could do this for other hardware plaforms.

      However ... most other CPU's have had the ability to use writable but not executable and executable but not writable heaps for a while. x86 does not. This is why you get a whole bundle of problems with it, as buffer overruns write code in the heap, then get it executed. The patch is an atempt to mitigate the adverse effects of that hardware weakness.

      It's not perfect (nor is the better hardware solution). However, it will make many exploits an order of magnitude more complex, making writing and utilising them a much more complex task.

      The part about locating code inside the ASCII armour is, however, zero overhead, and will, I think, get wrapped into mainline on all archtectures (although possbily not till 2.7)

    2. Re:Potentially Stupid Question by bobbozzo · · Score: 1

      IIRC, Sparcs have separate write and exec flags for each page, so they wouldn't need this.

      All x86 chips (exept hammer in x86-64 mode), and most ppc chips do not have these protections in hardware.

      --
      Nothing to see here; Move along.
    3. Re:Potentially Stupid Question by Anonymous Coward · · Score: 0

      for ppc you're wrong, check PaX.

  22. Re:Great! [Scott] by Anonymous Coward · · Score: 0

    wow... you need to get a clue... statistically speaking, those safety devices HAVE increased reckless driving DRAMATICALLY. People assume since they are wearing a seatbelt they can crash at higher speeds and be just as safe.

  23. Will this hinder Java/Mono JITs? by Anonymous Coward · · Score: 0

    anyone know if they will be affected by this change?

  24. openwall patch by wotevah · · Score: 3, Informative
    This feature looks similar to what the openwall patch does since the 2.0 kernels ( http://www.openwall.com/linux/ ).

    Quoting from the README: Non-executable user stack area.

    Most buffer overflow exploits are based on overwriting a function's return address on the stack to point to some arbitrary code, which is also put onto the stack. If the stack area is non-executable, buffer overflow vulnerabilities become harder to exploit.

    Another way to exploit a buffer overflow is to point the return address to a function in libc, usually system(). This patch also changes the default address that shared libraries are mmap()'ed at to make it always contain a zero byte. This makes it impossible to specify any more data (parameters to the function, or more copies of the return address when filling with a pattern), -- in many exploits that have to do with ASCIIZ strings.

    However, note that this patch is by no means a complete solution, it just adds an extra layer of security. Many buffer overflow vulnerabilities will remain exploitable a more complicated way, and some will even remain unaffected by the patch. The reason for using such a patch is to protect against some of the buffer overflow vulnerabilities that are yet unknown.

    1. Re:openwall patch by Anonymous Coward · · Score: 1, Informative

      Openwall's non-exec stack aka. Solaris Designer's non-exec stack is mentioned multiple times in the announcement. It's only partial solution.

  25. Re:Great! [Scott] by Have+Blue · · Score: 1

    Also, most of those features do not actually solve the problem they address: An airbag won't stop you from wrapping the car around a tree, it just lets you walk away afterwards; the car is still totaled. It's the same with this patch.

  26. Transparent? Why Not? by jmt9581 · · Score: 1

    The patch works transparently, ie. no application recompilation is necessary."

    Why would you ever need to recompile an application to take advantage of a kernel patch? I could see the need to recompile libraries or statically compiled applications, but it seems logical to me that a kernel patch should only require you to patch the programs that use the kernel source code: the kernel (maybe some modules too, but I don't think that's the case here).

    Not trolling, just wondering aloud, so feel free to correct me if I'm wrong. :)

    --

    My blog

    1. Re:Transparent? Why Not? by CoolVibe · · Score: 1

      Well, you are a bit offtopic on this one, but you are half right. When a kernel patch changes syscall numbers around, you'd have to recompile libc and make sure your new libc extracts/maps the right syscall to the right function (the libc build stuff paying attention to what's in the kernel headers usually takes care of this), or every app using that syscall will just die with a SIGILL or something else interesting.

    2. Re:Transparent? Why Not? by l2718 · · Score: 2, Interesting

      There are two reasons why this kind of patch would require recompilation.

      One (implied in the linux-kernel post) is that it would be nice to fix the ELF format and remove the assumption that the stack can contains executable code. Also, changing the way the program is laid out in memory affects security (see the "ASCII Armour" bit). A priori you might think that recompilation (producing a new binary) would be required for that.

      The second is self-modifying code. Some application (the post mentions XFree86) want to have parts of the binary decided upon at runtime (mostly for optimization purposes). For that to work you need to know which parts of the memory are accessible both for writing (as data) and execution (as code). If the rules for that change (which is the point of patches like this one), you'll have to do even more than recompile -- such software will have to be fixed!

      Getting X to work without recompilation (in fact, without patching) was a real issue -- read the explanation of the "X-workaround" hack.

      hope this helps,
      Lior

    3. Re:Transparent? Why Not? by 42forty-two42 · · Score: 1

      Actually, if an app uses an invalid syscall number in Linux, it'll just get back -ENOSYS. Now, calling the wrong syscall, OTOH...

  27. Re:Ingo's announcement [Redundant] by dracocat · · Score: 1

    Did I miss something? Were you unable to see the site? It still comes up fine for me.

  28. The name is taken ... by Anonymous Coward · · Score: 0

    IIRC, `Executive Shield' was (is?) the name of a product that Norton used to hawk for Win9x. Anyone back me up here?

    When encryption is outlawed, bayl bhgynjf jvyy unir cevinpl.

    1. Re:The name is taken ... by shaitand · · Score: 2, Informative

      This is exec shield not executive shield, and the exec part most likely (I'm too lazy to look) implies execution rather than executive. Exec shield is a straight forward enough name I'm sure someone has used it for something somewhere before, but it's not a rip of executive shield by norton for christ sake.

  29. Executable stack protection, very nice, but... by CoolVibe · · Score: 2, Insightful
    what about local attacks using the global offset table or return-into-libc function pointer overwriting attacks? With those you can put executable code somewhere else and use another trampoline instead of a return address.

    Sure, this will nullify most remotely exploitable vulnerabilities, but what about local ones that are vulnerable in the manners I just described?

    1. Re:Executable stack protection, very nice, but... by Anonymous Coward · · Score: 1, Interesting

      Use grsecurity with all address space randomizations on and it'll be very difficult to guess correct address. I think that required recompiling the binaries though.

    2. Re:Executable stack protection, very nice, but... by rabidcow · · Score: 2, Insightful

      Well apparently it deals with that as well, by moving system libraries to an "ASCII-armor" area from 0x00000000-0x00ffffff. This is supposed to be safe since ASCIIZ strings can't contain 0s. ...but I think there's a flaw with that, ASCIIz strings will always contain *one* 0, the terminating one. Since x86 stores addresses as little endian, the high byte in the address will be the last byte in memory. If you arrange for the terminating NULL to be at the last byte of the return address, you can jump to that "ASCII armor" area, since the string will overwrite the lower bytes.

      I dunno if I'm understanding their intention correctly tho.

    3. Re:Executable stack protection, very nice, but... by tijsvd · · Score: 1
      It seems you are right. However, since the return address can then only be the last byte(s) of the overwritten part of the stack, it is not possible to give parameters to the function called (these would follow the return address on the stack). The exec* and systems calls all need parameters.

      So unless a function execute_shell(void) exists in the code, the armoring should be quite effective.

    4. Re:Executable stack protection, very nice, but... by rabidcow · · Score: 1

      Ah, good point. You'd have to rely on the parameters you need starting as the second argument of the call with the buffer overflow, which is probably fairly rare.

      Or, if the buggy code and the system call use a stack frame and you can jump past the setup for that, you can move ebp so its parameters come from somewhere else. I imagine there's probably ways of preventing that without modifying the user code.

      It's very clever, makes it much harder to exploit.

    5. Re:Executable stack protection, very nice, but... by ceswiedler · · Score: 1

      Yes, you can jump to the ASCII-armor area, but you can't pass parameters, which would have to come after the zero byte. Which is why the area is slightly larger than 16MB.

    6. Re:Executable stack protection, very nice, but... by rabidcow · · Score: 1

      Read the other reply to my post dude, it makes exactly the same point. (and I guess the ANNOUNCE does too...)

      If the ascii-armored code ever refers to parameters via a register that the user code pops from the stack, you *can* pass parameters. (like if it uses a standard stack frame) It's much more difficult though.

      Which is why the area is slightly larger than 16MB.

      I don't understand this... "slightly larger" as in until the end of the last function or what? and what does this have to do with parameters?

      Maybe it goes through 0x01010100?

  30. Re:Great! [Scott] by corporatemutantninja · · Score: 2, Funny

    I stopped wearing a seatbelt as soon as I got a car with an airbag. And now that I have a car with EIGHT (count 'em) airbags and ABS brakes I drive like Mario Andretti. Only without all the cologne.

    --
    Actually, I was trying to be Insightful, not Funny.
  31. Re:Great! [Scott] by Abcd1234 · · Score: 1

    Proof? I've never heard of such a thing...

  32. Someone has to say it... by Anonymous Coward · · Score: 5, Funny

    My name is Igno Molnar
    You kill -9 my ppid
    prepare to die!

    1. Re:Someone has to say it... by Anonymous Coward · · Score: 0

      My name is Inigo Montoya, you killed my father, prepare to die!

      My name is Luke Skywalker, you are my father, prepare to die!

      My name is Oedipus, I killed my father, I fucked my mother,
      I want to die!

    2. Re:Someone has to say it... by Anonymous Coward · · Score: 0

      Best sig I ever saw was

      My name is Inigo Montoya.
      You spammed my father.
      Prepare to die!
      Inigo@Montoya.net

    3. Re:Someone has to say it... by Anonymous Coward · · Score: 0

      You stole that from here, although a previous version there had 20 entries.

    4. Re:Someone has to say it... by Anonymous Coward · · Score: 0

      Yeah, so is...

      TROGDOR!!!!! Burninating all the peasants!!!! BURNINATING all the THATCH ROOF COTTAGES!!!!!!!!

      (http://www.homestarrunner.com/sbemail58.html)

  33. Typo in post by localghost · · Score: 4, Informative

    It's against the 2.4.21-rc1 kernel, not 2.4.20-rc1.

  34. Re:Great! [Scott] by ddriver · · Score: 1

    Darn you Nader! Darn you to heck!

    BTW mandatory seatbelt laws did increase the percentage of accidents caused by careless driving.

    --
    I found my inner child, then I got caught abusing it...
  35. Let me explain this to you.. by cculianu · · Score: 5, Informative
    Why would you ever need to recompile an application to take advantage of a kernel patch? I could see the need to recompile libraries or statically compiled applications, but it seems logical to me that a kernel patch should only require you to patch the programs that use the kernel source code: the kernel (maybe some modules too, but I don't think that's the case here).

    While it is true that in general even HUGE changes to the kernel rarely need an application recompile, and are transparent, sometimes this is not the case.

    Consider the following:

    • Some applications interact with the kernel's address space and/or filesystem format/implementation, consider programs like e2fsck, modprobe/insmod, mke2fs, mkreiserfs, et al. These programs need to know about any changes to the kernel's implementation of loadable kernel modules, filesystems, etc.
    • Occasionally the kernel adds functionality. Consider the Xfree86 DRM infrastructure. That was new and required application support.
    • Consider that the kernel once didn't support ELF binaries. A.out was the norm. When the kernel started supporting the ELF format, the compiler tools needed to be changed.

    Actually, even this patch is not entirely transparent. In order to best benefit from the ASCII-armor area, you will notice that in the readme text file they actually gave a patch to binutils to make executables try and use a lower address for their program text. Executables (unlike shared libraries) aren't relocatable and thus need to be re-linked in order to use a different (lower) address...

    1. Re:Let me explain this to you.. by Anonymous Coward · · Score: 0

      ET_EXEC ELF files (the 'executables' you talked about) are just as relocatable as any other ELF file provided you put in all the needed reloc info. GNU ld does that with the -q switch for a few years now and ld.so will happily relocate the file should it not have been mapped at its desired base address.

  36. Will work fine ... by DarkMan · · Score: 4, Informative

    ... assuming that the stack memory is marked as executable in the binary - which will have the net effect of turning off the Exec-shield.

    In other words, ELF format has flags to indicate if the stack should be readable and/or executable. If your doing that sort of thing, make sure that the flag is set, and you'll have no problems [0].

    It your doing those sort of tricks, your probably being very careful with what goes where, and buffer lengths and such. The problems come in when people don't realise that there could be a problem, and don't audit the buffer handling code properly.

    So, don't worry, just use the ELF flags.

    [0] Well, you could set the feature to ignore what the binary says, and implement the security anyway. But that's not a good idea, and very much not default.

  37. SCO by floydman · · Score: 1

    Well i guess SCO can use one of those after being "DOSed"..... :) /*Why is the a penguin on my desktop?!*/

    --
    The lunatic is in my head
  38. as a non-programing network admin by Indy1 · · Score: 2, Interesting

    is this a patch i should have installed on my various linux servers? I understand any new code should be tested on a development server before being moved to production, but assuming this patch doesnt cause any problems, is it something thats worth the time and effort to help reduce buffer overflows ?

    --
    Lawyers, MBA's, RIAA? A jedi fears not these things!
    1. Re:as a non-programing network admin by cras · · Score: 1
      is this a patch i should have installed on my various linux servers?

      Yes. Everyone should have installed grsecurity long time ago for their servers, which provides this protection and much more. It includes ACLs which requires some work to get working, but you don't have to use them. Non-exec stack+heap and address space randomizations require nothing but upgrading the kernel and possibly disabling them for a few binaries that don't like them. I'd guess grsec will include Ingo's patch with it as alternative in future.

  39. Now that is funny... by daemonc · · Score: 0, Redundant

    n/t

    --
    All that we see or seem is but a dream within a dream.
  40. Hahaha, that's the way it's supposed to be! by Anonymous Coward · · Score: 0

    We're talking about Linux here, not Windows. Windows doesn't have security, windows has binary compatibility. Linux makes a point of breaking binary compatibility every few months. Notice that Redhat went from 7.3 to 8.0 to 9.0? All of those broke binary compatibility. Linux has a terrible history in regards to kernel changes affecting userland binaries.

    1. Re:Hahaha, that's the way it's supposed to be! by MikeFM · · Score: 1

      Not so. I've got binaries that are several years old and still running just fine on my Linux box. It all depends how you compile the program and what parts of the system that the program uses.

      Also for the most part it doesn't matter in Linux because you have the source code. If you update part of the system you should update everything related too. You aren't stuck with something that is broken.

      --
      At what price learning? At what cost wisdom? The price is a man's peace of mind, and the cost is his life.
    2. Re:Hahaha, that's the way it's supposed to be! by Karn · · Score: 1

      At work we're still using Matlab 5.1, which was written for Redhat 5. I have to install some compat packages (libc5-compat for example) from Redhat 6, but it works fine in Redhat 6, 7, 8, and 9.

      --


      Why do I keep typing pythong?
  41. stupid spammer by Anonymous Coward · · Score: 0

    mailto:sales@destroyads.com

  42. Non-executable stacks are part of the solution by larryjoe · · Score: 5, Interesting
    Reading the announcement for Exec Shield, I can see that the author is aware of the work of Solar Designer, who released the first non-execuable stack solution many years ago. However, I don't see any mention of PaX, which extends the the Openwall solution to other memory regions.

    It should also be pointed out that while most buffer overflow exploits do indeed simultaneously overwrite the return address and inject the shellcode onto the stack, a certain class of buffer overflow exploits called return-into-libc attacks do not require executable stacks and are not too difficult to construct. These attacks overwrite the return address with the starting address for one of the libc exec*() functions. At the same time, the parameters for executing /bin/sh are pushed onto the stack. The execution of the corresponding return instruction then causes the exec*() function to execute /bin/sh. See this paper for a more detailed analysis of some buffer overflow solutions.

    I think that it's interesting that in the past few weeks, several solutions for buffer overflows have been announced (e.g., the OpenBSD announcements). Each of these solutions are good solutions, but they heavily borrow from earlier solutions. Unfortunately, the previous work has often not been properly acknowledged. Since the masses are generally not aware of the current state of the art, these supposedly new solutions are given more credit than due. Still, I suppose it's a good thing if general awareness of the buffer overflow problem is raised, even if the pioneers of the technology do not receive their due credit.

    Tim Tsai

    1. Re:Non-executable stacks are part of the solution by Anonymous Coward · · Score: 0

      Since so many of these exploits seem to involve invoking another program (typically /bin/sh), how about a flag that says "don't let this guy call exec()"? Let anyone set it, and have it latch - once set, that process can't call any of the exec() family of functions. If it tries, something should throw an alert into the syslog.

      I know lots of programs legitimately need to call exec. For those programs, you initially don't use this flag. Later on, perhaps they could be rewritten to split into two halves. One keeps the exec privilege, and the other one (which is exposed to the network) drops it. They remain connected via a pipe(). If the network guy needs something executed, he asks the other one to do it via the pipe.

      You could still exploit that situation, but it would be harder if the pipe reader was written with adequate paranoia regarding which commands may be executed.

      This would not be a complete solution, but it might cover some more cases where programs are doing things that they never should. Random example: should syslogd ever exec() something? No? Then add a line of code to make it give up that privilege. If someone breaks into it, their "exec /bin/sh" exploit will fall on its face.

    2. Re:Non-executable stacks are part of the solution by bobbozzo · · Score: 1

      Your pipe suggestion is interesting, but I don't think that would work for daemons like apache, where children are often created, cgi's are run, ...

      Even sendmail needs to spawn lots of children, and I'm not sure that could be done any other way.

      --
      Nothing to see here; Move along.
    3. Re:Non-executable stacks are part of the solution by Anonymous Coward · · Score: 0

      Apache would be difficult to secure in this manner, so let's ignore that for now. The OpenBSD guys have done some good work with chrooting it and making the parent give up root entirely, so hopefully that will find its way back into the main line for everyone.

      sendmail has to do a couple of things with privileges, but it could probably benefit from some separation too. Assume it needs root to bind to port 25, since I don't want to talk about capabilities or weird local-port-redir tricks at the moment. It also needs to become other users in order to deliver mail to them and/or run things from their .forward files.

      So you bind the socket for port 25 as soon as you start up (as root), open a pipe, and fork. One of the processes chroots into the mail queue, drops root, sets the no-exec() flag and starts listening to the network socket. Meanwhile, the other side of the fork hangs on to the root privs and listens to the pipe.

      When mail comes in, the unprivileged network listener takes the mail and drops it into the queue directory. Then it prods the other process via the pipe and says "hey, I just put something in (file) for you", then goes back to sleep. The privileged process reads the message, checks it for sanity, then fires up the MDA (procmail, etc) and does the usual thing with the mailboxes.

      If someone does break into the network side, they get an unprivileged account. Even if they manage to start a shell, the most they can do is diddle your incoming mail, since it's stuck in a chroot jail.

      To even try for root, you'd have to convince the root process on the other end of the pipe to do something on your behalf. It should be checking the messages from that pipe for sanity, so it should be even harder to get that to happen now.

      BTW: I know that sendmail has dropped some root stuff in favor of smmsp in recent releases. It still has that big scary root process on port 25. Why are privileged processes still talking to the network directly?

    4. Re:Non-executable stacks are part of the solution by Anonymous Coward · · Score: 0
      From the README:
      Another way to exploit a buffer overflow is to point the return address to a function in libc, usually system(). This patch also changes the default address that shared libraries are mmap()'ed at to make it always contain a zero byte. This makes it impossible to specify any more data (parameters to the function, or more copies of the return address when filling with a pattern), -- in many exploits that have to do with ASCIIZ strings.
      So it helps with that exec() case as well.
  43. dont support karma whores by Anonymous Coward · · Score: 0

    actually, go ahead, if you are chump enough to do that, you dont deserve those mod points anyhow

  44. Re:WOW! Linux blows my goat, thanks. by Anonymous Coward · · Score: 0

    This doesn't even deserv a reply but I will give you one anyway (anonymously of course). How much did the rumor in you jain mail buddies email promise you billy would pay ya? I have some unfortunate news. Its not true...Get a life!!!

  45. breaks gdb by Anonymous Coward · · Score: 0

    gdb needs an executable stack or you don't get full breakpoint and watchpoint functionality. Flagging binaries isn't likely to fix this properly, unless you can have the gdb flag override the subordinate executable's.

  46. 3 words by ufpdom · · Score: 0, Offtopic

    They deserve it -100 FLAIMBAIT

    --
    There's no Freedom like UFP-dom
  47. why would it do that? by SHEENmaster · · Score: 1

    Windows has allowed people to login as Administrator for more than a decade with no ill effects. It's "More Secure than a Bank Vault."(tm)</sarcasm>

    --
    You can't judge a book by the way it wears its hair.
  48. Call me stupid, but this makes no sense to me. by Theovon · · Score: 4, Interesting

    Maybe I'm missing something really simple, but here's my understanding:

    1) x86 stack grows from high addresses to lower ones, allowing for a string allocated on the stack to overflow such that it overwrites the return address.

    2) x86 is little-endian which means that the return address (in this case, on the stack) starts with the low byte and stops with the high byte.

    3) In C programs, strings are null-terminated.

    The ASCII shield relies on ASCII not being able to represent certain addresses, namely 0x00000000 to 0x0100ffff.

    Well, here's what I don't get. Assuming all three above, there are five possibilities we can generate for overwriting an address:

    1) All four address bytes are overwritten by ASCII characters generating an address greater than 0x01010101.

    2) The first three bytes are overwritten by ASCII characters, and the last one is overwritten by the null terminator. This results in an address between 0x00010101 and 0x00ffffff. This certainly looks like an address within the 16M "armor"

    3-5) For (3), we only overwrite three of the address bytes, the first two being ASCII, and the last being NUL, resulting in an address something like 0x??00AAAA, where AAAA is greater than 0x0101. This would require that the attacker know what the upper byte of the address is, which is possible. (4) and (5) represent similar situations.

    As far as I can see, this 16M protected region doesn't exist. WHAT AM I MISSING?

    Thank you.

    1. Re:Call me stupid, but this makes no sense to me. by Anonymous Coward · · Score: 1, Informative

      I'm not sure if this answers your question, but it has been pointed out on the linux kernel mailing list that for a successful exploit you need jump into some function (which is in the ASCII armor) *and* you also have to pass parameters to that function.

      So if you stop your exploit string early and use the zero byte at the end then you can jump into the ASCII area, but what you can do is quite limited, because you have no arguments set up for that function. At least this is how I understand it.

    2. Re:Call me stupid, but this makes no sense to me. by gurbe · · Score: 1


      1) STACK grows down :

      y [RET] ; 32 bit return address pushed on call to function
      y-4 [...] ; misc stack contents
      y-n [var] ; ASCII overflowable local variable

      2) Overflow grows up :

      overflow ascii string = len(var) + len(...) + "\1\0\0\0"

      y ["\0"]
      y-1 ["\0"]
      y-2 ["\0"]
      y-3 ["\1"]
      y-4 [len(...)]
      y-n [len(var)]

      3) Contents of bytes [y-3, y] form in little endian : 0x01000000

      4) 0x01000000 equals 16M, this is the lowest address ascii overflow can reach

    3. Re:Call me stupid, but this makes no sense to me. by tijsvd · · Score: 2, Informative
      The exec*() and system() calls need parameters, which need to follow the return address. Since the return address is necessarily the last part of the attack, it is not possible to write these parameters.

      So unless spawn_shell(void) exists, the armoring is quite effective.

    4. Re:Call me stupid, but this makes no sense to me. by Theovon · · Score: 1

      That's not right. If the bytes in the address are \1, \0, \0, and \0, then the address is 0x00000001. It's little-endian.

      But you can't put that in there anyhow, since you can only have one nul character in a string.

  49. Great but... by EinarH · · Score: 1

    Even though this Exec Shield Owerflow Protection is great; where is the Executive owerflow protection that will protect me from my boss when he wants to execute me?

    --

    Melius mori in libertate quam vivere in servitute.

  50. Windows by thalakan · · Score: 5, Informative

    I've been screwing around with mprotect() and friends lately to write a exploit delivery system that can't be read by memory inspection tools on the target machine. While checking to see if similar techniques are possible on Windows, I found that the default addresses for PE/i386 executables' stack and text sections are all below 0x00ffffff. .text begins at 0x00400000, for example, and the stack is located below it.

    So it looks like Microsoft beat Ingo to it :) I was wondering for the longest time why they chose those mappings by default until I saw this article today.

    --
    -- thalakan
  51. Drunkeness by Anonymous Coward · · Score: 0

    I am so drunk right now, but it makes me hate microsoft more, Windows should be free like beer and bitches. Because all you people are cool

  52. "A binutils patch" can be as little as... by yerricde · · Score: 1

    To change the starting virtual address of a binary, just change the linker script (or use a command-line option to the linker). Why did they have to patch binutils?

    Perhaps the patch to GNU Binutils only modified the default linker scripts used by GNU ld on one or more common platforms.

    --
    Will I retire or break 10K?
  53. NOT OFF TOPIC by TeknoDragon · · Score: 0, Offtopic

    but well... ingo isn't such a "douchbag"

    the latest OpenBSD release has the same feature... called W^X (W xor X)

  54. Re:Great! [Scott] by Slowping · · Score: 4, Interesting

    Economically speaking, it's true. Though I will admit I have no hard numbers to give you.

    People have a marginal value for driving dangerously, which is balanced by the marginal cost of that action. Where the two meet (marginal cost -vs- marginal value curve), is how people behave (or drive in this case).

    In comes a safety feature. That safety feature reduces the marginal cost of driving dangerously. Thus, the driver is able to "afford" more dangerous driving. ie the equilibrium point where marginal value and marginal cost meets has shifted higher towards dangerous driving.

    Thus, in economics theory, the driver will drive more dangerously with additional safety features.

    The opposite effect, in the original poster's example, of having a spike come out greatly increases the marginal cost. Thus, the "affordable" point shifts far down towards much safer driving.

    Of course... this is fundamental microeconomics, and I'm no expert in economics.

    --
    (\(\
    (^.^)
    (")")
    *beware the cute-bunny virus
  55. Microsoft by xombo · · Score: 1

    Don't you think after years of bug fixes from Microsoft that they would have "innovated" this sort of thing first with all the money they make...?

    1. Re:Microsoft by The+Bungi · · Score: 4, Insightful
      Actually, Windows 2000 and up already have this kind of thing built in. Instead of showing all the h^xx0rz here how l337 you are for trying to mouth off about how Microsoft should "innovate", you might want to show up at one of Mark Russinovich's conferences one of these days. Perhaps you'll learn something useful. And you'll figure out just who "innovated" this (and no, it's not Microsoft).

      Hope that helps!

    2. Re:Microsoft by Anonymous Coward · · Score: 0

      You say Windows 2000 has non-exec stack and/or heap built in? Funny I don't see anything related to that in google. Well, there's some stack protection thingy for MS SQL server which you can buy..

    3. Re:Microsoft by Anonymous Coward · · Score: 0

      try looking up info on Oracle internals on Google. Not gonna find a lot there, because they want you to buy their books and go to their conferences. Same with Microsoft.

    4. Re:Microsoft by Anonymous Coward · · Score: 0

      Yeah, and I heard the next release will have Internet Explorer and Windows Media Player built in the core to.

    5. Re:Microsoft by Anonymous Coward · · Score: 0

      I have looked a lot of Oracle stuff online. And a lot exists. Maybe not in the most easily understandable form though.

  56. Er... to expand a little bit... by mark-t · · Score: 4, Informative
    I realized after I had clicked submit that I had forgotten to point out how it all comes together.

    If and when different pages are used for code and data, since both already use different segment descriptors, the code and data have their own completely isolated address spaces, so trying to invoke a buffer overflow that would cause a "return" to some point in the user-supplied data would actually simply cause a return to the corresponding point in the code page, which is, of course, not actually modified by the application. At best, a buffer overflow could cause a branch to a particular section of the existing program, but would not permit the execution of arbitrary code since in the ideal case, even the kernel code resides in an address space that is invisible to any running application. The most probable upshot of trying to "return" in this fashion would be a segmentation fault, which should result in no more than the application simply terminating with a core dump.

  57. Re:WOW! Linux blows my goat, thanks. by JW+Troll · · Score: 0

    as much as I'd like to believe that Linux is better than it really is, the truth is preferable to self-delusion. I can see that you, however, are a true Open Sores zealot; as such, it is only to be expected that you cannot spell, and that any spell-checking software you might use is broken. You probably don't bathe, and you don't have any friends of the opposite sex.
    How do I know this, you ask?

    --
    just like the humble blood clot... turboporsche@telus.net
  58. Re:Great! [Scott] by fireman+sam · · Score: 2, Informative

    Excatly true, and in some parts of Australia, there are laws prohibiting the use of full role cages and racing harnesses because they make a vehicle safer at high speed, thus enticing the driver to drive at a higher speed.

    --
    it is only after a long journey that you know the strength of the horse.
  59. Not exactly surprising... by pr0ntab · · Score: 2, Interesting

    If you use linux with BIG_MEM (3GB/1GB split) enabled in the kernel, your .text segment is allocated starting at 0x00010000. I forget why but there was some simplicity to using the 1GB/1GB split otherwise on linux (.text starting at 0x80000000, kernel mem at 0xc0000000). Windows uses a default 2GB/2GB split, so it makes sense it would start at 0x0. I don't think they were thinking about ASCII armor when they made that decision in the NT 3.x days.

    --
    Fuck Beta. Fuck Dice
  60. Hmm.. you might be right! Someone tell INGO! by cculianu · · Score: 2, Interesting

    You know.. you may be right.. consider this little program. It is a series of characters in an array.. the characters are 0x01,0x01,0x01,0x00 (as was your case (2)). When you print this out as an int, you get 65793. This is certainly less than 16 million.

    #include <stdio.h>
    #include <string.h>

    int main(void)
    {
    char arr[sizeof(int)] = { 0x01, 0x01, 0x01, 0x00 };

    printf("%d\n", *((int *)arr));
    return 0;
    }

    So I don't get what Ingo means when he says that this region is somehow ASCII-shielded... because you are right.. on the x86 the high order byte is last, not first (as was the assumption in Ingo Molnar's little readme).

    What GIVES??! Anyone? What am *I* missing?

  61. Re:Great! [Scott] by elphkotm · · Score: 1

    You know an airbag is only designed to work when you wear your seatbelt?

    --

    <Amanda`> I just went out to the parking lot in my bathrobe to exchange warez CDs.
  62. Yegads... by Theatetus · · Score: 1
    Isn't this the idea behind palladium?

    *ducks*

    --
    All's true that is mistrusted
  63. Re:WOW! Linux blows my goat, thanks. by Anonymous Coward · · Score: 0

    Sadly, this is true. 'Tis a pity.
    note to moderators: linux bashing is only wrong when it's lies.

  64. The reason it's all needed is because... by Col+Bat+Guano · · Score: 1

    ...stupid languages like C don't do array bounds checking. Compile all your code with Purify on, or use a language with checking, and you'll be a whole lot safer.

    Who cares if it takes a few cycles more - for almost all applications is just isn't going to matter, and you can sit back and -relax- rather than having to deal with the next patch to fix a newly discovered hole.

    1. Re:The reason it's all needed is because... by Anonymous Coward · · Score: 0

      Compile code with Purify on? You've never written a program in your life have you? And needless to say, you've never use Purify either.

    2. Re:The reason it's all needed is because... by Col+Bat+Guano · · Score: 1

      >Compile code with Purify on? You've never written a >program in your life have you? And needless to say, >you've never use Purify either.

      Ok, semantic error (silly me! I should have written more carefully). Change it to "Use a tool similar to Purify that provides run time bounds checking:.

      Yes i have written code.

      No, i've not used Purify.

    3. Re:The reason it's all needed is because... by voodoo1man · · Score: 1
      The worst part about these patches is that they penalize everything else in favor of broken C programs.
      "so the overhead in the context-switch path is a very cheap, unconditional 6-byte write to the GDT, costing 2-3 cycles at most."
      That's a penalty for all processes, whether they do their own bounds checking or not. In this case, since the penalty is incurred on every context switch, it would be infinitly (well, proportional to the run time of your program) cheaper just to do the damn array bounds checking that you suggest. Even worse is the restrictions this places on trampolines, and JIT and other dynamic compilers, which only further promotes the use of broken C.

      I really hope this doesn't become the default among the free Unices.

      --

      In the great CONS chain of life, you can either be the CAR or be in the CDR.

    4. Re:The reason it's all needed is because... by BenjyD · · Score: 1

      >stupid languages like C don't do array bounds checking ...
      >Who cares if it takes a few cycles more - for almost all applications is just isn't going to matter

      This is exactly the point with C - if you want array bound checking, add it yourself. That way, there is no 'invisible' overhead in code where those extra few cycles *do* matter. It's not 'stupid', it's just simple.

    5. Re:The reason it's all needed is because... by Col+Bat+Guano · · Score: 1

      Languages are made (or should be!) to make it -easier- for people, not harder.

      Why not have the language specify array bounds detection, -and- a mechanism for turning it off when you want to.

      This gives you all of the goodness associated with checking for 0 development cost.
      Also the compiler is able to decide when array bounds checking is not needed (if it can see that you are iterating over a fixed length array) which is robust in the face of code change.

      I'll use your last comment to justify my position....
      "That way, there is no 'invisible' overhead in code where those extra few cycles *do* matter. It's not 'stupid', it's just simple."

      It can't get much simpler than asking the compiler to insert the code itself.

    6. Re:The reason it's all needed is because... by BenjyD · · Score: 1

      Yeah, that option occurred to me about three seconds after clicking submit. Isn't it always the way?

  65. *Linux is dying by Anonymous Coward · · Score: 0

    *Linux is dying

    Yet another crippling bombshell hit the beleaguered *Linux community when last month IDC confirmed that *Linux accounts for less than a fraction of 1 percent of all servers. Coming on the heels of the latest Netcraft survey which plainly states that *Linux has lost more market share, this news serves to reinforce what we've known all along. *Linux is collapsing in complete disarray, as further exemplified by falling dead last in the recent Kreskin test.

    You don't need to be a Kreskin to predict *Linux's future. The hand writing is on the wall: *Linux faces a bleak future. In fact there won't be any future at all for *Linux because *Linux is dying. Things are looking very bad for *Linux. As many of us are already aware, *Linux continues to lose market share. Red ink flows like a river of blood. Debianis the most endangered of them all.

    Let's keep to the facts and look at the numbers.

    Redhat leader Theo states that there are 7000 users of Redhat . How many users of SuSE are there? Let's see. The number of Redhat versus SuSE posts on Usenet is roughly in ratio of 5 to 1. Therefore there are about 7000/5 = 1400 SuSE users. Mandrake posts on Usenet are about half of the volume of SuSE posts. Therefore there are about 700 users of Mandrake. Arecent article put Debian at about 80 percent of the *Linux market. Therefore there are (7000+1400+700)*4 = 36400 Debian users. This is consistent with the number of Debian Usenet posts.

    Due to the troubles of Walnut Creek,abysmal sales and so on,Debian went out of business and was taken over by Gentoo who sell another troubled *Linux. Now Gentoo is also dead, its corpse turned over to another charnel house.

    All major surveys show that *Linux has steadily declined in market share. *Linux is very sick and its long term survival prospects are very dim. If *Linux is survive at all it will be among *Linux hobbyist dabblers. *Linux continues to decay. Nothing short of a miracle could save it at this point in time. For all practical purposes, *Linux is dead.

    *Linux is dying

  66. Re:Great! [Scott] by Anonymous Coward · · Score: 0

    Now which one of your EIGHT air bags will protect you when you roll over? Or when you get t-boned on the passenger side.

    I thought about getting a new RX330 with a shitload of airbags but instead I decided to just give everyone that rides in my car one of those inflatable suits like from the Woody Allen movie Sleeper.

  67. Not slow. by 0x0d0a · · Score: 4, Interesting

    No. The patch lets the exec-shield be toggled off, and adds no more than 2-3 cycles per context switch. On a current x86 box running a vanilla 2.4 kernel, the maximum number of context switches per second is 100. That's a maximum of 300 cycles a second consumed. The oldest machine I've used running Linux was a 486/66 that a friend had. One of these can do at least 66 million cycles a second. On this elderly 486, there will be slowdown of less than a thousandth of a percent. Given that almost all major Linux applications are written in C, the security payoff is probably worth it. I value efficiency a lot, and even so the elimination of the largest security issue in Linux for less than a thousandth of a percent of the CPU time seems like a pretty good trade.

    1. Re:Not slow. by paulbd · · Score: 4, Informative

      sorry, but the number of context switches is not limited by the HZ setting. thats the maximum number that would occur if there were no blocked threads and no interrupts (except the system timer) causing threads to become runnable.

      my system runs audio software that is generally powered by the audio interface interrupt, which occurs at about 1kHz. every single one of those interrupts generally leads to about 4 context switches in the typical case. thats about 4000 context switches per second.

    2. Re:Not slow. by BlowChunx · · Score: 1

      ...and what percentage of the total number of cycles per second is that on your machine?

      If that percentage is low (which I assume it is, even if you are using the aforementioned 486/66!), you won't notice it.

      I would like to know if it logs actions somewhere. If I download NewProjectXYZ and run it, I can toggle exec shield on, and look for problems. Now I just run it, cross my fingers...99% of the time it's fine, this would just give me another way to protect my box.

  68. Re:Great! [Scott] by bobbozzo · · Score: 1

    They solve the problem of the target computer getting owned.

    The target daemon/service will probably crash, but you won't have to rebuild the computer from backups or from scratch. This is a HUGE improvement.

    The car is not totaled, it only went off the road.

    --
    Nothing to see here; Move along.
  69. Re:Great! [Scott] by amorsen · · Score: 1
    Drivers have a skewed view of the cost of driving dangerously. Humans are not very good at intuition about probabilities (if they were, lotteries would be a lot less popular.) Also, if humans perceived all risks the same way, many people would have fear of driving the same way they have fear of heights. The thing to be afraid of (high speed impact with with immobile object) is about the same whether you are in a car or at the top of a cliff.

    Whether an additional safety feature will make people even more confident is hard to say and more of a psychology question than an economics question.

    --
    Finally! A year of moderation! Ready for 2019?
  70. Re:Great! [Scott] by Narcissus · · Score: 2, Insightful

    Except in the US where they are designed to work without seatbelts. Well, kind of. The propulsion used is much stronger in an attempt to help those that don't wear their seatbelts (one of those "we can't force them to wear their seatbelts: they're Americans, they're free, but let's tack on some copyright changes" things).

    The problem is, then, that air bags in the US actually become more dangerous when seatbelts are used, but there is no evidence to suggest that they help those that don't wear them any more...

  71. Stack executability all or nothing on Linux? by BeforeCoffee · · Score: 1

    So on Windoze API there is a nice little convenience method called VirtualProtect() where you can change the access permissions on individual pages of memory.

    Since we're on the subject of pages and access and such, does such an API exist within Linux? Or, are Linux programs stuck with an all or nothing situation?

    1. Re:Stack executability all or nothing on Linux? by Anonymous Coward · · Score: 1, Insightful

      mprotect() but it cannot work properly on x86 hardware due limitations on x86 processors.

    2. Re:Stack executability all or nothing on Linux? by 42forty-two42 · · Score: 1

      On i386 you have to resort to hacks like this to make a readable page of memory non-executable.

  72. Also sounds like the OpenBSD hack? by billstewart · · Score: 1

    OpenBSD recently announced something similar. Are they in fact actually similar? Or are they just different approaches to the same problem?

    --

    Bill Stewart
    New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
    1. Re:Also sounds like the OpenBSD hack? by Anonymous Coward · · Score: 0

      Exec Shield is pretty much the same as the kernel part of W^X in OpenBSD 3.3-current (and future 3.4). Where OpenBSD takes it further is that they modify userland so that ELF files will have their code/data segments separated by 1GB and hence when mapped into memory the data part will fall into the non-executable region (in Exec Shield such areas are still executable, and writable too, so you can introduce new code there).

  73. I bet there are some programs out there that ... by Vintermann · · Score: 1

    .. are dependent on overwriting data structures with code in order to function at all. The ugliness of programs knows no limits, and there are bound to be hackers out there who, obsessed with function pointer arithmetic, see this as a "powerful feature".

    --
    xkcd is not in the sudoers file. This incident will be reported.
  74. Re:Great! [Scott] by shepd · · Score: 1

    >Whether an additional safety feature will make people even more confident is hard to say and more of a psychology question than an economics question.

    The question is, will the additional safety feature be used as intended, or will it have another purpose.

    What I'm thinking here is seatbelts. Slow drivers wear them either because they're forced to, or because they don't want to die. Fast drivers wear them as restraints to keep them from sliding about in the seat and in front of the wheel.

    Same thing with ABS. The slow driver gets it so they can stop without thinking in case of an impending accident. The fast driver gets it in case they're rounding a curve at too high a velocity and need to turn while braking (not that physics of the two mix whatsoever in this case).

    With programmers, an exec shield will be used by cautious programmers as an enchanced security measure, whereas bad programmers will see it as a way out of their programming hell that won't get them fired (easily). All IMHO, of course.

    As long as it isn't mandatory, it isn't a problem. I'm happy to have a car without ABS -- I need the shorter stopping distance conventional brakes provide me in the snow more than the ability to skid and swerve.

    --
    If you could be told what you can see or read, then it follows that you could be told what to say or think - BoC
  75. ptrace-kmod exploit by spaic · · Score: 1

    I guess this takes care of the Linux kernel ptrace/kmod local root exploit. On unpatched <=2.4.20 kernels this will spawn a suid 0 shell.

  76. Re:Great! [Scott] by amorsen · · Score: 1

    I must admit that I don't think "bad programmers afraid to be fired because their code has a security flaw" as a large enough demographic to be worth worrying about. Good programmers make mistakes, and a little extra safety may lengthen the time between discovery (and hopefully disclosure) and exploit. Bad programmers will find a way to screw up either way, but probably not any worse than without the extra safety.

    --
    Finally! A year of moderation! Ready for 2019?
  77. Trampolines by Vlad_the_Inhaler · · Score: 3, Insightful

    My 'day job' is programming on a mainframe. This is how they go about handling this.

    16 'segments' (call them what you will) can be based (pointed to) at any one time, each by one base-register.
    B0 points to code
    B1 points to the stack
    B2-B15 point to data segments.
    If you want to point B0 to another executable segment, you have to execute CALL, GOTO or RTN (return :-). A code segment does not have to be read-only, but normally is. The only other 'trampolining' permitted is by using the EXecute instruction which allows you to execute one instruction in any segment. Executing (for example) a Jump instruction would be of little use to a cracker because the target address would automatically be in the segment referenced by B0.

    Yes, we can have buffer-overflows, but 'all' that happens is that other data is overwritten. This will usually cause the program to abort. It is even possible to organise things so that every routine has it's own discrete data-segments. If a routine then starts accessing data outside of the routine, it gets the equivalent of a Segfault. Obviously parameters/arguments are excepted from this, although there would also be a Segfault if a routine went outside it's caller's data-area.
    Actually, the hardware allows a caller to restrict a subroutine's access to only the n bytes it actually passed over as an argument. The HLL implementations do not enforce this setting in any of the languages I use.

    Segment attributes are from Owner-Read, Owner-Write, Owner-Execute, Other-Read, Other-W and Other-X. Segments also have a Sharing-Level which is: Activity, Program, Application and Exec/System. Exec/System is normally combined with Other-Access: None, Application is normally combined with Read+Execute.

    How much damage is caused each year because the 32-bit I386 architecture cannot supply a reasonable security framework at a reasonable overhead? If the AMD 64-bit processors are capable of fixing this mess, then the GLIBC maintainers could start looking at (optionally?) allowing a safer implementation by separating Code and Data. If this incurs memory-overhead, server farms should be migrating to 64-bit processors anyway by the time such a feature became available. They could also always compile the libraries without that feature.

    --
    Mielipiteet omiani - Opinions personal, facts suspect.
  78. there's always kernel mode linux by Anonymous Coward · · Score: 0

    there's always kernel mode linux if you like to live on the edge!

  79. Re:Great! [Scott] by Openadvocate · · Score: 1

    Damn I would hate that since I drive my car to the track. :(

    --
    my sig
  80. on the subject of paging and protection by master_p · · Score: 1

    Intel did not designed it correctly. They should have put 2 bits for Read, 2 bits for Write and 2 bits for eXecute access. These 2 bits per type of access should be the maximum ring number allowed to touch the page.

    For example, a page could be data only if the Read and Write ring was 3, but the eXecute ring was 0. Then, only the kernel would be able to execute code in that page.

    This scheme is very flexible: there can be read-only pages, write-only pages, exec-only pages, or any combination of the three. Furthermore, some pages could only be written/read/executed by rings other than 3, enhancing protection even further.

    I guess now it's too late for this :-).

    1. Re:on the subject of paging and protection by mark-t · · Score: 1
      The protection you are describing is already handled by the x86's protected mode segment descriptors. If program code had had its own, isolated address space, completely independant from data, trying to execute data would only result in the execution of already-existing instructions in the corresponding location pointed to by the code segment descriptor. In particular, if the memory subsystem of the operating system is designed such that an application's 32-bit pointers to the current task's code and data areas would never overlap, then an application trying to execute data would actually result in an attempt to execute code outside the limit allocated to the current task's code segment descriptor, and would result in an exception being thrown. That no x86 OS does it this way is not a failure of Intel, but a failure of the operating system designers to fully exploit the CPU's characteristics.

      Of course, to exploit this x86 characteristic would introduce some highly non-portable aspects into the operating system, making it more difficult to get working on different architectures.

    2. Re:on the subject of paging and protection by master_p · · Score: 1

      Yes, this feature is implemented on the segment level. What I am saying is that it should have been implemented on the paging level. It would make OS coding much easier.

  81. inclusion into vanilla kernel by heby · · Score: 1

    i hope this gets included into the vanilla kernel - i was quite shocked to learn initially that while e.g. true 64 (formerly known as digital unix formerly known as osf/1) had a non-executable stack and linux didn't (which i now understand was a problem with x86 vs. alpha hardware, not linux in particular).

    and i sure hope that the non-exec flag has been implemented on amd's and intel's 64 bit cpus.

  82. RTFANNOUNCE-exec-shield by 42forty-two42 · · Score: 1

    Overhead:
    ---------

    the patch was designed to be as efficient as possible. There's a very
    minimal (couple of cycles) tracking overhead for every PROT_MMAP
    system-call, plus there's the 2-3 cycles cost per context-switch.

  83. ASCII-Armor area by 42forty-two42 · · Score: 2, Interesting

    What happens if an executable maps in more than 16mb of shared libraries? Will one of these libraries get mapped to NULL? Or will it forgoe security for actually working?

  84. Re:Great! [Scott] by Randseed · · Score: 1
    People have a marginal value for driving dangerously, which is balanced by the marginal cost of that action. Where the two meet (marginal cost-vs-marginal value curve) is how people behave (or drive in this case). ... Thus, the driver is able to "afford" more dangerous driving...

    Yes and no. While in economic theory this is entirely valid, reality is slightly more complicated. The same argument is used against handing out condoms in schools, i.e., that handing out condoms in public schools, free access to birth control, and so on is going to decrease the marginal cost to having sex, thus leading to more sexual promiscuity.

    This is true, but think about it just a little more. In situations such as this, people who are not going to have sex anyway are probably not having it due to restraints imposed by personal values, shyness, inability to get any, or whatever. Giving these people condoms is not going to induce them to have sex. By contrast, people who are going to have more sex because they suddenly have an endless supply of contraceptive devices are already having sex, and because the supply of contraceptives was what induced them to have more sex, they were probably having sex unprotected in the first place. Therefore, we're all better off.

    The situation is similar here. The people who are going to write crappy code are going to write it anyway. Te people who are going to write decent code are going to write it anyway. What the nonexecutable stack patch protects us from is people who either write code that is crappy and don't care (e.g., risk-taking, dangerous drivers without regard for other motorists [or pedestrians when they're driving on the sidewalk]), and from people who write good code and just screw up (e.g., an accident).

  85. Re:*BSD is dying by Anonymous Coward · · Score: 0

    BSD has a faster boot time.


    This idiot pulled this right from that POS OSNews story about some lamer telling what he would do if he had his own Linux distro. Too bad he doesn't mention it's not even going to be a Linux distro.

    Oh, and BSD *IS* dying.

  86. Re:RedHat keeps the evolution going. Excellent wor by Anonymous Coward · · Score: 0

    What's interesting is when Redhat does things like this (funding kernel development and patches that benefit everyone), you don't hear a word from the same people who assosicate the company with Microsoft.

  87. OT: Your Sig by Anonymous Coward · · Score: 0

    In SOVIET RUSSIA, the Internet logs onto You!

    Then SBC/Yahoo! is part of SOVIET RUSSIA! Their ads claim that the Internet logs onto you!

    1. Re:OT: Your Sig by intermodal · · Score: 1

      hmm...that banner is where the link goes, provided they haven't deleted the file for that banner yet.

      --
      In SOVIET RUSSIA... erm...NSA AMERICA, the Internet logs onto YOU!
  88. BSD IS DYING, NEWS AT 11 by Anonymous Coward · · Score: 0
    It is official; Netcraft now confirms: *BSD is dying

    One more crippling
    bombshell hit the already beleaguered *BSD community when IDC confirmed that *BSD
    market share has dropped yet again, now down to less than a fraction of 1 percent of
    all servers. Coming on the heels of a recent Netcraft survey which plainly states
    that *BSD has lost more market share, this news serves to reinforce what we've
    known all along. *BSD is collapsing in complete disarray, as fittingly exemplified by
    failing dead last [samag.com]
    in the recent Sys Admin comprehensive networking test.

    You don't need to
    be a Kreskin [amazingkreskin.com] to predict *BSD's
    future. The hand writing is on the wall: *BSD faces a bleak future. In fact there won't
    be any future at all for *BSD because *BSD is dying. Things are looking very
    bad for *BSD. As many of us are already aware, *BSD continues to lose market share. Red
    ink flows like a river of blood.

    FreeBSD is the most endangered of them all, having
    lost 93% of its core developers. The sudden and unpleasant departures of long time
    FreeBSD developers Jordan Hubbard and Mike Smith only serve to underscore the point
    more clearly. There can no longer be any doubt: FreeBSD is dying.

    Let's
    keep to the facts and look at the numbers.

    OpenBSD leader Theo states that there
    are 7000 users of OpenBSD. How many users of NetBSD are there? Let's see. The number of
    OpenBSD versus NetBSD posts on Usenet is roughly in ratio of 5 to 1. Therefore there are
    about 7000/5 = 1400 NetBSD users. BSD/OS posts on Usenet are about half of the volume
    of NetBSD posts. Therefore there are about 700 users of BSD/OS. A recent article put
    FreeBSD at about 80 percent of the *BSD market. Therefore there are (7000+1400+700)*4 =
    36400 FreeBSD users. This is consistent with the number of FreeBSD Usenet posts.



    Due to the troubles of Walnut Creek, abysmal sales and so on, FreeBSD went out
    of business
    and was taken over by BSDI who sell another troubled OS. Now BSDI
    is also dead
    , its corpse turned over to yet another charnel house.

    All major
    surveys show that *BSD has steadily declined in market share. *BSD is very sick and
    its long term survival prospects are very dim. If *BSD is to survive at all it will
    be among OS dilettante dabblers. *BSD continues to decay. Nothing short of a miracle
    could save it at this point in time. For all practical purposes, *BSD is dead.


    Fact: *BSD is dying

  89. Re:*BSD is dying. BAAAAAAMMM by Anonymous Coward · · Score: 0
    It is official; Netcraft now confirms: *BSD is dying

    One more crippling
    bombshell hit the already beleaguered *BSD community when IDC confirmed that *BSD
    market share has dropped yet again, now down to less than a fraction of 1 percent of
    all servers. Coming on the heels of a recent Netcraft survey which plainly states
    that *BSD has lost more market share, this news serves to reinforce what we've
    known all along. *BSD is collapsing in complete disarray, as fittingly exemplified by
    failing dead last [samag.com]
    in the recent Sys Admin comprehensive networking test.

    You don't need to
    be a Kreskin [amazingkreskin.com] to predict *BSD's
    future. The hand writing is on the wall: *BSD faces a bleak future. In fact there won't
    be any future at all for *BSD because *BSD is dying. Things are looking very
    bad for *BSD. As many of us are already aware, *BSD continues to lose market share. Red
    ink flows like a river of blood.

    FreeBSD is the most endangered of them all, having
    lost 93% of its core developers. The sudden and unpleasant departures of long time
    FreeBSD developers Jordan Hubbard and Mike Smith only serve to underscore the point
    more clearly. There can no longer be any doubt: FreeBSD is dying.

    Let's
    keep to the facts and look at the numbers.

    OpenBSD leader Theo states that there
    are 7000 users of OpenBSD. How many users of NetBSD are there? Let's see. The number of
    OpenBSD versus NetBSD posts on Usenet is roughly in ratio of 5 to 1. Therefore there are
    about 7000/5 = 1400 NetBSD users. BSD/OS posts on Usenet are about half of the volume
    of NetBSD posts. Therefore there are about 700 users of BSD/OS. A recent article put
    FreeBSD at about 80 percent of the *BSD market. Therefore there are (7000+1400+700)*4 =
    36400 FreeBSD users. This is consistent with the number of FreeBSD Usenet posts.



    Due to the troubles of Walnut Creek, abysmal sales and so on, FreeBSD went out
    of business
    and was taken over by BSDI who sell another troubled OS. Now BSDI
    is also dead
    , its corpse turned over to yet another charnel house.

    All major
    surveys show that *BSD has steadily declined in market share. *BSD is very sick and
    its long term survival prospects are very dim. If *BSD is to survive at all it will
    be among OS dilettante dabblers. *BSD continues to decay. Nothing short of a miracle
    could save it at this point in time. For all practical purposes, *BSD is dead.


    Fact: *BSD is dying

  90. Re:Great! [Scott] by Anonymous Coward · · Score: 0

    In Louisiana and Mississippi, some of the most backwards states in the US, seatbelts are required by law.

    What states don't require seatbelts?

  91. It's called "Java" by nate.sammons · · Score: 1

    Uh, forgive me, but there's a technology out there called "Java" that lets you do this right now.

    -nate

    1. Re:It's called "Java" by dracocat · · Score: 1

      there's a technology out there called "Java" that lets you do this right now.

      Do what? Make the kernel more secure?

      Yes, Java is a more secure environment to run applications, but that was not Java's purpose. It was more a side effect of being able to develop a virtual machine from scratch. I would say that if the kernel were to be developed from scratch it would employ many of the same safety mechanisms that Java does. Of course, not all of them because it is not a Virtual Machine. But I bet you would see a lot more isolation and security considerations built into the kernel if it were to be done from scratch. Now don't think for a second that I want that. What we have today has been tested and proven, and more secure or not, I would not give up what we have now.

  92. Re:about fucking time! by Anonymous Coward · · Score: 0
    It is official; Netcraft now confirms: *BSD is dying

    One more crippling
    bombshell hit the already beleaguered *BSD community when IDC confirmed that *BSD
    market share has dropped yet again, now down to less than a fraction of 1 percent of
    all servers. Coming on the heels of a recent Netcraft survey which plainly states
    that *BSD has lost more market share, this news serves to reinforce what we've
    known all along. *BSD is collapsing in complete disarray, as fittingly exemplified by
    failing dead last [samag.com]
    in the recent Sys Admin comprehensive networking test.

    You don't need to
    be a Kreskin [amazingkreskin.com] to predict *BSD's
    future. The hand writing is on the wall: *BSD faces a bleak future. In fact there won't
    be any future at all for *BSD because *BSD is dying. Things are looking very
    bad for *BSD. As many of us are already aware, *BSD continues to lose market share. Red
    ink flows like a river of blood.

    FreeBSD is the most endangered of them all, having
    lost 93% of its core developers. The sudden and unpleasant departures of long time
    FreeBSD developers Jordan Hubbard and Mike Smith only serve to underscore the point
    more clearly. There can no longer be any doubt: FreeBSD is dying.

    Let's
    keep to the facts and look at the numbers.

    OpenBSD leader Theo states that there
    are 7000 users of OpenBSD. How many users of NetBSD are there? Let's see. The number of
    OpenBSD versus NetBSD posts on Usenet is roughly in ratio of 5 to 1. Therefore there are
    about 7000/5 = 1400 NetBSD users. BSD/OS posts on Usenet are about half of the volume
    of NetBSD posts. Therefore there are about 700 users of BSD/OS. A recent article put
    FreeBSD at about 80 percent of the *BSD market. Therefore there are (7000+1400+700)*4 =
    36400 FreeBSD users. This is consistent with the number of FreeBSD Usenet posts.



    Due to the troubles of Walnut Creek, abysmal sales and so on, FreeBSD went out
    of business
    and was taken over by BSDI who sell another troubled OS. Now BSDI
    is also dead
    , its corpse turned over to yet another charnel house.

    All major
    surveys show that *BSD has steadily declined in market share. *BSD is very sick and
    its long term survival prospects are very dim. If *BSD is to survive at all it will
    be among OS dilettante dabblers. *BSD continues to decay. Nothing short of a miracle
    could save it at this point in time. For all practical purposes, *BSD is dead.


    Fact: *BSD is dying

  93. Re:Great! [Scott] by Anonymous Coward · · Score: 0

    From a physics point of view: The marginal value must be that one gets from A to B faster (ignoring any potential adrenaline addiction as a motive). This is a linear equation where d = vt (d = distance, v = velocity, t = time; I don't know what letters are using in English). The cost can be expressed as the kinetic energy, or E = 1/2m(v^2).

    The problem is that the value is a linear equation, while the cost is exponential. So, you get linear value but exponential cost.

    Anyone agree?

  94. Is it possible this is a negative? by MarkSwanson · · Score: 2, Insightful

    It would seem to me that it's clear this patch is much more than just a non-executable stack patch. I think an important point is that while it isn't perfect, if this becomes a standard part of Linux then we can stand on the shoulders of this and tackle the next set of problems. Eventually we may get there.
    If we wait until a perfect patch presents itself we will never get there. F.E. using this patch will bring to light all applications that require gcc trampolines. With time, perhaps all of the trampoline code will be replaced - several articles have been written on how to live without trampolines, perhaps this would be the push needed to change.

    --
    Schedule your world with ScheduleWorld.com http://www.ScheduleWorld.com/ (Java Web Startable)
  95. Why OSL/GPL license? by Anonymous Coward · · Score: 0

    Why was this patch released under OSL/GPL license? I've seen some other bits from RedHat (employees) released under non-GPL license, although I clearly remember their CTO saying a couple of years ago that they will do only GPL software.

  96. Stack executability all or nothing on Linux? by BeforeCoffee · · Score: 1

    I downloaded the Wine sources and it appears that Wine DOES call mprotect() followed by some memset into a page table(?) Apparently mprotect() does work on x86 processors. (or does it?)

  97. Re:WOW! Linux blows my goat, thanks. by Anonymous Coward · · Score: 0

    note to moderators: linux bashing is only wrong when it's lies.

    A point which was apperantly well understood by the person who modded this troll down.

  98. Why should it? by g4dget · · Score: 1

    I don't know what you are referring to. Logging in as root is no different from running a program with "su" or "sudo"--you can screw up your system in the same way. And using X11 as root is also fine--any reasonable X11 installation will default to local-only, UNIX-domain connections, making it as secured as any other root-owned resource on the system.

    Logging in as root is the traditional way to administer UNIX systems, and it's still perfectly fine.

  99. mmap placement without kernel patch by jreiser · · Score: 2, Informative
    Application builders can get some of the protection even on systems that do not use the kernel patch. tub lets you control mmap(0,...) so that you can put ld-linux.so.2, libc.so.6, and other shared libraries into the ASCII Armor area.

    This would be a good time for TASK_UNMAPPED_BASE to become an inherited parameter controlled by setrlimit/getrlimit. It would also be a good time to get a binary structure interface to /proc/self/maps, much like VirtualQuery in Win32.

  100. probably not completely transparent by g4dget · · Score: 2, Insightful
    The exec-shield feature works via the kernel transparently tracking executable mappings an application specifies, and maintains a 'maximum executable address' value. This is called the 'exec-limit'. The scheduler uses the exec-limit to update the code segment descriptor upon each context-switch. Since each process (or thread) in the system can have a different exec-limit, the scheduler sets the user code segment dynamically so that always the correct code-segment limit is used.

    Programs compiled for the x86 architecture may well assume that they don't have to set the executable bit on pages because the hardware doesn't support it anyway. Whether such programs are "correct" or not, this patch may break applications.

    1. Re:probably not completely transparent by jjb · · Score: 2, Insightful

      We'll see if it breaks applications. Even if it doesn't, the fear of it breaking apps will probably stop many people from activating it if it's optional.

      Tons of Solaris sysadmins still don't set the non-executable stack, even though it doesn't seem to break any major applications outside of certain debugger functionality... They're just too afraid that they'll break an app and lose their jobs. And that's rough, because nonexecutable stack defeats a fair number of buffer overflows on that platform...

  101. Re:This is good (pro-ms) (o/t) by ckaminski · · Score: 1

    While of course all of our software should be correct, using the Operating System to make software more robust is almost always a good thing.

    You know, that's the very same thing that Microsoft does every day, and yet your praise Linux for doing it, and condemning Microsoft. That is what I most find interesting about this community...

    -Chris

  102. Re:This is good (pro-ms) (o/t) by dracocat · · Score: 1

    Well, assuming you are serious, and this isn't just a troll.

    1)I really don't ever recall anybody condemning Microsoft for making their Operating System more robust.
    2)While obviously the general attitude on slashdot is anti-microsoft, this isn't the reason, and has nothing to do with why that is.
    3)I would claim that a more robust OS, one that executes applications in greater isolation from one another is becoming more expected of System Administrators. Microsoft has been working on this for a while, and it is good to see Linux doing the same thing.
    4)If you are going to post using HTML select HTML Formatted below your message, and click the preview button.
    5)If you really think I have condemned Microsoft for making their OS more robust I would appreciate a link to the comment. thanx.

  103. Re:Ingo's announcement [Redundant] by steveha · · Score: 1

    Well, since you asked...

    Yes, the site came up fine for me. And I actually wasn't too worried about Red Hat's servers getting Slashdotted; I think Red Hat has pretty good servers.

    And I wasn't even looking for free karma; I already have plenty.

    I know that many, many people just read the Slashdot comments and never click through the links, and I wanted them to see the announcement before asking questions answered in the announcement. I was hoping to head off some of the more obvious dumb questions.

    Also, the URL provided is for a very temporary place: Ingo's personal stuff. A year from now people might read the archived comments on Slashdot, and I thought it would be nice to have the announcement in there, especially because the link probably won't work anymore. (Although I may have been wrong about the link not working anymore; there seems to be lots of older stuff on there that he never took down. Oh, well.)

    steveha

    --
    lf(1): it's like ls(1) but sorts filenames by extension, tersely
  104. Re:Great! [Scott] by waveman · · Score: 1

    "Exactly true, and in some parts of Australia, there are laws prohibiting the use of full role cages and racing harnesses because they make a vehicle safer at high speed, thus enticing the driver to drive at a higher speed"

    There is another economic aspect to this as well.

    When I drive fast, I get all the benefit. However the risk is shared by other road users. This is the classic economic problem of externalities. Just as in pollution, the polluter gets the benefit, but everyone breathes the smoke.

    This is not just theory. When they made seat belts compulsary here, more pedestrians died. The reason was that people drove faster and pedestrians were more likely to get hit, and got hit harder.

  105. Re:Great! [Scott] by EvilNTUser · · Score: 1

    In a perfect world, I'd agree. But people are stupid. The average driver won't realize that cost increases exponentially in your example, and thus won't change his risk estimation accordingly.

    --
    My Sig: SEGV