Slashdot Mirror


Transmeta To Add 'NX' Antivirus Feature To Chips

Autoversicherung writes points to a ZDNet story which says that "Transmeta will support "No Execute," or NX, in their next core revision. Transmeta will provide advance versions of Efficeon-based systems with NX support to Microsoft for testing. Hope Linus get a few too, even if he's no longer working there. The NX-equipped Efficeon chips are due for general release later this year."

29 of 265 comments (clear)

  1. Enterprise Computing? by AKAImBatman · · Score: 4, Funny

    If they call it the "NX-01", I'm gonna shoot somebody.

    1. Re:Enterprise Computing? by DarkHelmet · · Score: 4, Funny
      NX-01? Is that a Star Trek reference? I always thought that Star Trek ended after First Contact. Damn... I'm glad they didn't drag that franchise out and run it into the ground...

      Or maybe I'm from a parallel universe...

      --
      /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i
  2. No Execute? by Anonymous Coward · · Score: 5, Funny

    So how do you turn on this feature? I'd love for "No Execute" to protect me from accidentally running Windows if I choose the wrong option in my dual-boot setup. Will NX be supported by Grub/Lilo?

  3. Note to editors by Anonymous Coward · · Score: 5, Insightful

    The NX bit is not an 'antivirus' feature.

  4. is this worth it? by Sunda666 · · Score: 4, Interesting

    Hmm I may be totally wrong here, but ain't this NO EXECUTE thing a responsibility of the operating system?!?
    Why implement this at the hardware level, besides "making windows more secure"?

    cheers.

    --


    ``If a program can't rewrite its own code, what good is it?'' - Mel
    1. Re:is this worth it? by LostCluster · · Score: 5, Insightful

      Because any time you're allocating memory for yourself, the OS isn't quite sure just what you're going to put there. When it's assembly-written code, the OS really can't tell the difference between the load of more code and the load of data.

      Besides, what if the buffer exploit is inside the operating system itself? Even Linux could fall victim to that kind of mistake. We've found that as long as bad code is distributed, somebody will still be running it long after the issue has been discovered and patched, and there's been worms to prove it.

    2. Re:is this worth it? by MonMotha · · Score: 4, Informative

      It can be done in software (grsecurity does it on x86 in linux), but is much faster if done in hardware (and I believe linux makes use of it already on those archetectures which support it such as Alpha and UltraSparc).

      There is significant overhead in doing it in software since you need to check the NX flag every time you bring up a page of code to execute. If it's done in hardware, you don't need to even do a context switch on many archetectures, and the hardware will just throw an exception if something bad happens (trying to execute code marked not executable), which the kernel will catch and handle (likely by segfaulting the offending process). Possibly remote root hole turns into a trivial DoS attack.

    3. Re:is this worth it? by Chester+K · · Score: 4, Informative

      Hmm I may be totally wrong here, but ain't this NO EXECUTE thing a responsibility of the operating system?!?

      Unless it's Palladium, the operating system doesn't care what's running in user space beyond what it needs to know about to ensure operational integrity. A buffer overflow in an application doesn't compromise the OS, it compromises the application -- and even if it wanted to, the OS likely wouldn't even be able to tell with any reliability that something illicit was happening in the process. The NX flag is a way of letting the OS know how to know if things go sour.

      --

      NO CARRIER
  5. How is this different? by AKAImBatman · · Score: 4, Interesting

    Ok, maybe I don't get this. How is this different from marking a block of memory as data, not code? The real problem is that certain OSes mark all memory as both code and data. Sure, it's easier on the bookkeeping, but it allows buffer overflows. If data was kept in data segments, and code was kept in code segment, the worst that would happen is a corrupted data segment, and/or a General Protection Fault.

    1. Re:How is this different? by RuneB · · Score: 5, Informative

      The OS isn't the problem, most OSes already keep code and data is separate segments. The problem is the x86 chip, which has no separate execute permission bit for memory, and assumes that anything that's readable is also executable. This makes it hard to protect random pages on the x86. The no-exec patches for x86 use various tricks to try and work around this limitation, but it's still not as good as having a separate execute bit per page of memory.

      --
      dtach - A tiny program that emulates the detach feat
  6. How well will this work against VBScript viruses? by netsharc · · Score: 4, Interesting

    Because, VBScript viruses come as source-code, and the script engine reads it and executes the functions that the commands want.

    Or .exe attachments, I bet they will still work when the hapless user double-clicks on them.

    Or ActiveX holes.. well this would be harder to exploit with the NX feature..

    --
    What time is it/will be over there? Check with my iPhone app!
  7. So simple, we might as well do it. by LostCluster · · Score: 5, Informative

    Just so we're clear here... NX isn't any sort of DRM technology.

    It's a pretty smart idea, moving the core concept of "file permissions" into the RAM addressing space. Simply put, if the chip has been told that a certain area of memory has been marked "No eXecute", and then the execution point somehow gets there, an error event is raised to the operating system and that process is killed.

    Basically, it's an unreliable but better-than-nothing safety backstop behind unchecked buffers. If somebody manages to exploit a buffer overflow, there's a semi-random chance that the virus code might just crash into being allocated into another area marked NX, and when the execution point gets there the underlying application starts to crash.

    Of course, any memory space intended for data and not code should be marked NX... are people going to be smart enough to actually do that when on hardward that supports it? Let's hope so... it'll at least limit the spread of worms.

    1. Re:So simple, we might as well do it. by steveha · · Score: 4, Insightful
      A buffer overrun is a way of putting data PAST the end of your variable (which would be marked NX in your hypothetical scenario) into an about-to-be-executed chunk memory.

      That could be true, if the buffer were placed right before an executable chunk. But it never is. Variables are allocated on the stack, not in code space. Heap memory is often allocated near the stack, but again not in code space.

      When a program calls a function, it stashes a return address on the stack. This address specifies where execution should resume after the function returns. If an exploit can overrun the stack, the exploit overruns this return address! So an exploit will fill a buffer, run off the end of the buffer, put an address on the stack right where it overwrites the return address of the current function, and possibly then overrun some more. If there is a function embedded in the overrun (either on top of the buffer, or after the return address) the address of that function is used to overwrite the return address. So when the function returns, that function runs. A small amount of code can act as a bootstrap loader that loads the rest of the exploit.

      Here's a primer on how to write a basic stack smashing local root attack. I just found this with Google.

      http://community.core-sdi.com/~juliano/htce.txt

      Here's the text of a comment from the sample code:

      filling up the end of the buffer with our shellcode which will be executed on the stack after the bof

      Emphasis added by me. "executed on the stack"... in other words, this exploit would not work if the stack were marked NX, like I said.

      Can you find me an article about how to execute a stack-smashing attack, where the exploit actually blows past the end of the stack or the heap and somehow winds up in normal code space? I have never heard of any such. Can you find even one example of the technique as you describe it?

      steveha
      --
      lf(1): it's like ls(1) but sorts filenames by extension, tersely
  8. Re:I didn't RTFA, but by zgornz · · Score: 5, Informative

    NX is completely different from NOP.

    NX means you can mark a segment of code, well not code but data, as NX [Not Executable]. So lets say I mark some buffer as NX (Because it is just to contain a string anyway) and then someone finds a buffer overflow, and fills my string with some shell code then uses the buffer overflow to jump over to the string's location.

    No luck, the shell code is marked NX.

  9. XP SP2 adds NX support by Barlo_Mung_42 · · Score: 4, Informative

    I know you were attempting a joke. But to bring it back on topic:
    http://www.microsoft.com/technet/prodtechn ol/winxp pro/maintain/sp2chngs.mspx

  10. Anti-virus? by __aagctu1952 · · Score: 5, Insightful

    How exactly is this an anti-virus feature? Anti-buffer-overflow, yes. Anti-worm... well, maybe, but it'd be a bit of a stretch (anti-worm-based-on-buffer-overflow rather). Anti-virus? Hell no.

    I just love tech journalism...

  11. Re:I didn't RTFA, but by bnavarro · · Score: 4, Informative

    It's been awhile since I took Assembly, but from what I understand, NX, or "No Execute", is an instruction that tells the processor to refuse to execute any binary data stored in certain locations in memory. This way, you cannot execute code that might be hidden inside, say, a string variable; this is a common exploit used by trojans & worms called a "buffer overrun", meaning it tries to insert code past the legal length of the string, and, if conditions are right, the code gets executed before the program crashes. I believe that the "NX" feature is found on "Big Iron" processors, and has been for quite some time.

    NOP, on the other hand, is "No Operation". Literally, step over this instruction and do nothing. Applications for this are fairly limited, but they do not include attempting to block illegal code from running inside of data space

  12. Let me guess... by mikeophile · · Score: 4, Funny

    The "no execute" function is a subset of a call from a governor.

  13. Re:DRM? by MonMotha · · Score: 4, Informative

    As long as you still have access to "supervisor mode" on your processor (the context the kernel runs in), you'll be able to set the NX flag however you like. Basically, this means that without other measures to prevent you from loading kernel code, all this does is prevent buffer overflows in userland software (and possibly the kernel if the kernel decides to use it, which is probably a good thing).

    Now, this isn't to say anything about other mechanisms which would prevent you from loading your own code onto a processor (which is what most of Microsoft's proposed DRM schemes do), but it could close off an avenue of bypassing that DRM (via poorly coded "trusted" software).

  14. Re:How well will this work against VBScript viruse by LostCluster · · Score: 4, Informative

    It won't. So long as the user insists on granting run permission to something they shouldn't run, it's gonna run.

    This only works when the problem is when something is trying to apply the buffer exploit way of taking over the execution point.

    Still... just because it doesn't cure cancer is no reason to throw out a cure for the common cold.

  15. Re:Failure ? by bersl2 · · Score: 4, Insightful

    "No need to bother writing secure code cus new chips will have NX technology?"

    I don't think that this segment of the programming population falls into those kind of pitfalls very often.

    I know at least one other post called it a "fallback" measure, which sounds about right. It's a third line of defense against buffer overflows and the like (the first being good programming practices, the second being things like libsafe).

    Sure, it is also helpful towards Microsoft; I can see how it restricts circumvention of DRM. But there are always other ways around. If you overflow into a buffer not protected by NX, you still have arbitrary code execution on your hands.

    Of course, this is just what I get from the other posts and intuition. It's not like I RTFA or anything...

  16. Re:I didn't RTFA, but by tedu · · Score: 4, Informative

    NX is not an instruction at all. it's an extra bit in a page table entry, augmenting the existing read and write bits (among other). once the x86 page table format was decided, it wasn't possible to go back and add a new bit. the introduction of PAE means that the page table entries are twice as big, mostly for larger physical addresses, but an extra bit can be shaved off and used for NX.

  17. Re:Expect intel to make a counter to this... by MBCook · · Score: 4, Informative
    This is a counter to AMD adding NX to the Opteron/Athlon64 line of chips. Intel already countered that by announcing that it would have NX on it's chips (which it calls NE or ND or something) a few days ago.

    Either way, it's nice to see everyone supporting this. Definatly seems like good technology to me.

    --
    Comment forecast: Bits of genius surrounded by a sea of mediocrity.
  18. Re:I didn't RTFA, but by tedu · · Score: 5, Informative

    the "execute" flag, assuming you are talking about memory protection and not some file permission bit which is unrelated, depends on CPU support. linux supports it on x86 no better than microsoft. if you use openbsd or pax patches, segments or other tricks are used to fake an X bit. but your assertion that ms can't implement an execute flag while linux (especially the stock kernel) can is pretty false.

  19. Re:Failure ? by hchaos · · Score: 4, Informative
    Is it me or does this sound like a tremendous failure on the part of operating system vendors, in that this has to be implemented in hardware?
    It's just you. The reality is that there is a tremendous failure on the part of the hardware vendors that would require this to be done in software.

    Here's why:
    • To implement this in the OS requires that the OS look up the value of the instruction pointer in an NX table every time it changes pages (assuming that the NX flag operates on a page basis), which would add several clock cycles to every JMP/JR/CALL instruction, and would significantly decrease performance.
    • If a basic feature such as this one needs to be implemented by every operating system, it makes more sense to implement it via hardware (the applicable cliche being "Don't reinvent the wheel").
    Im sure its more secure but hell, I think this could in the end lead to more complacency in software design. "No need to bother writing secure code cus new chips will have NX technology?"
    Alternatively, if resources don't have to be dedicated to fixing this problem, those resources can be devoted to fixing other problems. This argument is a little like the argument that, if I want to lose weight, I shouldn't exersize, because I might become complacent about what I eat.
  20. Re:I did RTFA by MBCook · · Score: 4, Informative
    N o e X ecute.

    It allows you to mark, in hardware, which pages of memory can and can not be exected from. The way it prevents buffer overflows is this:

    Application sets up the buffer, and code expoits it to put it's own data into the buffer so it can be executed. But because the page of memory that was holding the buffer was marked NX, the processor won't EVER execute it, it will raise an exception.

    So by using this you can make it nearly impossible to exploit buffer overflows in software. You'd have to find software that didn't set the bit. I can see no reason to do such a thing other than some kind of self modifying code buffer, and I would hope people would know better than that by now because if you implement that and let the user pass code, you're just ASKING for bugs.

    Linux supports it, I think OpenBSD supports it (other BSDs probably too), Windows XP SP 2 is supposed to support it, I think Solaris supports it, and that's all I know off the top of my head (but that's all the major OSes anyways).

    --
    Comment forecast: Bits of genius surrounded by a sea of mediocrity.
  21. Transmeta hired Babayan's student instead of him.. by hansreiser · · Score: 4, Interesting

    Boris Babayan is a Russian chip architect who has never gotten the funding (tens of millions at least are needed these days) to adequately pursue a whole set of interesting ideas of his. He is the guy behind Elbrus, the interesting Russian CPU that never materializes because the money never happens.

    Transmeta seems to be based on hiring one of his students, and implementing some version of Babayan's many ideas. Code morphing, protecting code from going out of bounds in hardware, these ideas are originally Babayan's. Maybe they should hire the master not the student, and then things might actually work. It is always sad when people don't realize the students are often not a good substitute for the original. It would be really nice to see Babayan get a shot at doing something in reality.

    Of course, I say this without ever having met said student, and I am biased because I did meet Babayan and was personally impressed by him, so take this all with a grain of salt. Maybe I would be equally impressed by the student. Sure would be nice to see Babayan get a try at it though.

  22. Re:Data General & the obscure Motorola 88000-s by nacturation · · Score: 4, Interesting

    Just goes to show that technological leadership is never any guarantee of marketplace leadership - x86 hardware is only now getting some of the features that Data General and Motorola were peddling [without much success] about fifteen years ago.

    Completely unrelated to this is the fact that patents last only seventeen years. I'm sure it's a coincidence though.

    --
    Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
  23. Quick tutorial: code/data, buffer exploits, OS,MMU by stienman · · Score: 4, Interesting

    Ok, the whole problem started with two decisions.

    * Usage of a von Neumann architecture

    * Storing call stack in buffer space

    And it blossomed from there.

    A von Neumann architecture keeps code and data in the same memory space. This means that the CPU can treat anything in memory as code or data - it doesn't care. Further, the software stack which stores temporary variables and return addresses (where to return when a function is complete) is also stored in this same memory area which can be executed. These two decisions provide great flexibility and power in memory management, but with great power comes great responsability.

    So a buffer exploit happens like this:
    A function is called.
    The current address of program execution is stored on the stack.
    Any variables the function uses are also stored on the stack after the return address.
    Typically stacks grow down from the top of memory and code is stored at the bottom of the memory space.
    Then function execution begins.

    However, arrays stored in the stack grow upward.
    If you store a return address, then put an array right after it of, say, 32 integers, then the 33rd integer is the return address of the code that should be executed when the function completes.
    If you store code in the array, then change the return address (at location 33 in the array) to point to the bottom of the array you have your own little function running instead of what the program author intended. Obviously a program that prevents itself from writing outside its own array bounds does not suffer from this particular problem.

    The CPU already has an MMU which tracks memory reads and writes into sections of memory called pages. The idea is that the OS can be called if the program accesses memory that is stored on disk, the OS can restore the memory, then it can return to the program. However the OS cannot tell whether the CPU is asking for paged memory because it wants to execute it or merely store/read data in it. Further, the OS may not called at all if the page is in memory since most page faults occur only when memory is on the disk.

    The no execute bit is added to each page that the MMU manages. When a program needs more stack space it asks the OS for another page of memory, and the OS, knowing that it's data and not code, sets the NX bit. Then the CPU can report to the OS whenever the program jumps to an address inside the data area, trying to execute that memory as code.

    This does NOT eliminate buffer overflows, but it can prevent code execution via overflows. Further, since the OS manages the program stack (for the most part, sometimes through libraries so a recompile may be necessary) then programmer interaction or changes are not needed to make individual programs work under this new system.

    Lastly, most OSs prevent writing to code locations (ie, you have to jump through hoops as a programmer if you want your program to self modify its own code as in genetic programming) so by preventing writes to code locations, and preventing execution from data locations then you've eliminated every method that a person could cause the computer to run code that the programmer did not intend to run. This means that further exploits are due directly to the programmer adding code which, for instance, provides an interpreter in their own program (such as with VBScript, Perl, any interpreted language by itself or inside a program) or explicitly sets up an insecure area where code and data can mix and be executed.

    -Adam