Advanced

Linux: Tainting the Kernel From Userland

Posted by Scott_Ruecker on · 4 comments
KernelTrap
Mail this story
Print this story

Theodore Ts'o proposed a new patch allowing a userland program to taint the kernel by writing to/proc/sys/kernel/tainted, "to be used when userspace is potentially doing something naughty that might compromise the kernel." When asked when this would be needed, Theodore went on to explain, "the problem is that the Real-Time Specification for Java (RTSJ) **requires** that the JVM provide class functions which provide direct access to physical memory; all physical memory.

In fact, the RTSJ compliance test explicitly checks for this; it requires that you give the compliance test the address of a few hundred megs of physical memory for the test.". He went on to add, "I was so unhappy about being forced by the RTSJ specification to do this insane thing that I wanted to make sure that if it were ever used, it would set a TAINT flag to warn people that just about anything unsane could have happened, and the system's stability was at the mercy of the competence of Java application programmers.".

The conversation that followed proposed having the tainting happen automatically when a process opens/dev/mem for writing. The notion that running X would then taint the kernel was briefly discussed, and Theodore replied, "it may make sense to have an explicit taint flag which means direct access to memory, via /dev/mem or otherwise, with exceptions for I/O mapped memory not claimed by a device driver (and of course X until it is fixed, or never, whichever comes first)."

Full Story

  Nav
» Read more about: Groups: Kernel, Linux; Story Type: News Story

» Get new stories by e-mail: nightly or as they are published

« Return to the newswire homepage

  Related stories
» More like this

Comments (4)

> the Real-Time Specification for Java (RTSJ) **requires** that the JVM provide class functions which provide direct access to physical memory; all physical memory.

Now, I'm not a programmer, but I am an Engineer, and this puts up all sorts of red flags for me. TAINT flag be damned, why was this ever a part of Java, and since it is, why do we want to use Java? Java is beginning to sound like less and less of a deal.
This does sound bizarre. I thought we left that sort of thing behind with the tired corpse of MS-DOS.
Real-Time specification, not normal every day Java, or even enterprise Java.

This is a spec for java that would be used for real time stuff like as a timing system in a laboratory. Waiting for the OS to get around to allocating resources to a program is not an option in real-time systems.

Of course in Real-Life there are very few systems that need Real-Time. For those, running in user-space (and consequently user-time) is just fine.

This is a red flag, but real-time systems are only used when the benefits of quick memory access outweigh the drawbacks of trashing memory. Regular Java runs in a memory protected 'sandbox'
Thanks for clarifying that number6x.

Post a comment

A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.

Your message:
|||||
10
Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help

Sign up and post (it is free)  or  Log in and post