Portal 2 Incompatible With SELinux
jones_supa writes "Valve has recently released Portal 2 on Steam for Linux and opened a GitHub entry to gather all the bugs from the community. When one of the Valve developers closed a bug related to Portal 2 recommending that the users disable a security feature, the Linux community reacted. A crash is caused by the game's interaction with SELinux, the Linux kernel subsystem that deals with access control security policies. Portal 2 uses the third-party Miles Sound System MP3 decoder which, in turn, uses execheap, a feature that is normally disabled by SELinux. Like its name suggests, execheap allows a program to map a part of the memory so that it is both writable and executable. This could be a problem if someone chose to use that particular memory section for buffer overflow attacks; that would eventually permit the hacker to gain access to the system by running code. In the end, Valve developer David W. took responsibility of the problem: 'I apologize for the mis-communication: Some underlying infrastructure our games rely on is incompatible with SELinux. We are hoping to correct this. Of course closing this bug isn't appropriate and I am re-opening it.' This is more of an upstream problem for Valve. It's not something that they can fix directly, and most likely they will have to talk with the Miles developers and try to repair the problem from that direction."
Why does a decoder need execheap? Is there some sort of optimization that causes the processing and data to be not separated? It sounds like an invitation for all kind of exploits (which is presumably why it is banned by execheap).
Also, is there a reason to use a specific MP3 decoder? Is it because of licensing, or are there technical reasons?
Why link to softpedia? They are morons who do no research, this is a simple bug Valve are working around. The damn game is in beta for a reason.
All of my computers are important enough, and I'm certainly not going to increase the risk of attacks on my gaming computer, either.
I think that most Windows gamers run anti-virus. Do you also have good advises for them ?
I disagree. The more secure desktops are, the less server admins need to worry about them being hijacked and used to co-ordinate DDOS attacks.
Anti-virus software is only good for finding known/dumb viruses.
Last time I checked, it's a very bad practice to allow executable code to be writable. Sort of like freely using eval, goto or passing in unvalidated inputs for sql queries.
I think it's a culture clash of developers who've only worked in a Windows environment and consequently are used to turning off operating system security so they can run a program, usually a game, vs. the Linux community who inherited the Unix culture where you can play games on the operating system, but you can't play games with the operating system.
Oh my god!?!? So what about the thousand enterprise software and services (from IBM to Oracle) which specifically say to absolutely disabile SELinux?!?
Let's be honest, SELinux is one of the most useless piece of software ever created by men...
Step away from your computer, go outside and have fun.
Firefox uses writeable+executable memory for its Javascript engine. So does every other JIT compiler (Java, Mupen64plus, PCSX, Yabause...)
you just need to allow the portal2 binary to use execheap. Now obviously its not good that portal2 uses execheap, but SELinux is fine grained enough to allow for it.
That is what it boils down to. Do i trust a game company on a secured system? No.
---- Booth was a patriot ----
Great game. But do I need some grinning show off using my box for their, "needs?"
And here I thought they used Vorbis.
Get free satoshi (Bitcoin) and Dogecoins
The more secure desktops are, the less server admins care about them being hijacked and used to co-ordinate DDOS attacks.
Fixed it for you.
Mss was around in the DOS days. It was what you call a web app today - done fast and cheap. Why do game shops use such junk when it comes to audio? They go all out for gfx but audio it's a whateverthehellisoutthere - cheap.
Just a common development day.
It's precisely for this reason the bug tracking systems has 're-opened' status.
Lisias@Earth.SolarSystem.OrionArm.MilkyWay.Local.Virgo.Universe.org
I agree with the original poster. If you absolutely must have security then online gaming is going to be a big hole in your defenses. It may be possible to secure a gaming rig but you can bet it's a massive job. I'd never trust it for anything important.
If a computer isn't important enough to need SELinux, it should be used as a paperweight instead.
Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
Not sure why this was modded down. There's an element of truth in it.
execheap? never heard of.
I read that as "exe cheap", is that correct?
Oracle didn't make SElinux. Turning it off is just a bad idea these days. If you don't understand how it works or how to use it, step away from the root prompt and go back to class, but don't switch it off.
I was promised a flying car. Where is my flying car?
While not false, the cost associated with NOT relying on third party tools also means that smaller studios could not possibly develop anything halfway competitive. Larger studios in turn would have to dedicate far more resources to developing the underlying basic engines rather than content.
Yes, reliance on third party tools, APIs, engines and libraries makes you dependent on them. But it also frees a lot of resources that you can invest in the game rather than developing its foundation.
We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
Guy is right....
Over the years I learned to use basically the base tools which are supported until infinity..... And little else.
When you install your linux OS... what tools are you *mostly* seeing?
gcc + make + ld
So now I code in C++ (guilty of loving C++11) with a bunch of header only libraries that compile with a basic makefile (no nested recursive crap). I use the header only unit testing framework called CATCH (it rocks, I love it) and I've been using C++11 future/promises to write very readable multi-thread code.
Wrote my own log thread class with printf style logging and thread-safe lock-free so threads don't block on logging. Using libmicrohttpd from GNU project for an embedded lightweight webserver.......
Without even thinking about it, the code I write tends to compile without special #ifdefs on pretty much Windows/Linux/BSD/OSX/POWER. I guess once I got over the scary hurdles I now feel super comfortable using tools that basically create operating systems and remain in critical uses which mean it's not going away soon.... (like python 2.x did, or VB6, or ASP, or Silverlight, or even Java-pre generics). C++11 has made it relevant yet still capable of building an operating system...
Valve should learn some of these tips....
"In the end, Valve developer David W. took responsibility OF the problem"
Huh?
You mean "FOR the problem". What the fuck is it with Americans?
The same people complaining about Valve instructing people do disable SELinux are the very first people to recommend doing exactly the same thing when someone online asks "How do I do [basic thing] in Linux? It doesn't seem to be working." There isn't a single message board dedicated to Linux that isn't filled with "disable SELinux" posts.
-1 disagree is not a modifier for a reason. -1 troll, flaimbait, redundant, overrated are NOT acceptable substitutes.
I am sorry if I offend someone now but I think this is a non-issue.
Your "playtoy" does not work with "serious tool"? Yes, I think that is more a feature. The idea of SELinux is to have a secure, solid Linux and you use it where you need a secure, solid OS. That is not where games are supposed to be.
I turn off that shitty SELinux on every machine here. I got tired of the bugs in it and the constant blocking of all my other software. My "paperweights" work quite well now.
On most systems, SELinux is only partly turned on, anyway. If you tighten up SELinux to the point that it would actually stop programs from doing bad things, then the system becomes unusable. "You can't write in that directory" (but I own that directory and it is a subdirectory in my home dir that I created 1 minute ago). "You can't read that file" (I could before). Very annoying.
I don't know what SELinux has morphed into but a few years ago it was a total PITA. Plus, coming from the NSA, you just know it doesn't have your best interests at heart.
This way, it can only be one thing at a time which means that the malicious code can't enable itself.
Unless the malicious code sprays itself over the writable area and returns to libc to make it executable.
Yeah. First thing I do on new Linux installs is disable SELinux. Linux does satisfactory job protecting against the common problems (like buffer overflows) without SELinux. SELinux adds hassle well past the point of diminishing returns for improvement to security.
Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion.
i guess because all dependencies are inherently a trade off, it's up to anyone to find adecuate balance depending on the situation, and publicly stating that one is systematically way unblanced on either side isn't interesting info at all. particularly, if this anonymous poster had to be coherent, he would have to be coding on cpus built with his own hands, not to mention having written his own compiler and os from scratch. that would be quite a rave party in house!
On iOS, as I understand it, no third-party app is allowed to have its equivalent of the execmod permission. Only Apple's code loader and Apple's JavaScript engine have that.
If only thus happened more makes me think of which games actually implement reality a base of play If it cannot make the grade without more sensory deprevation, also If you were deaf what it would be like in that game environment aswell as how actually intrigued you are to implement your own audio sensory information hud. Its a factual CIA operative protocol to gather information from a subject by inducing deafness not the actual (or lack thereof) Centrel(pun on sentinel) Intelligent Agency but the unwitting crop of untriable indecent citizen counter-intelligence officers.
Why would you use MSS nowadays? It was useful back in the early 90s when you wanted to write DOS executables that worked with different sound cards and such, but in this day and age it seems kind of pointless.
Linux is not ready for gaming, Valve is making a huge mistake. Developers will try and encounter tons of problems like that and most will abandon the port project. Just going from DirectX to OpenGL is a lot of hard work for nothing from a graphic programmer stand point.
Stop disabling SELinux
You must not play games on windows.
Actually, I wouldn't mind games (especially if they're offline games) as much as Steam itself. Steam requires to be online and requires elevated rights to make installation of games "just work". This is not very good from a security standpoint.
Enjoyed reading this quote from the Miles Sound System website:
"Miles is super robust. Since we ship in so many games, Miles just gets better and better - it just doesn't crash."
This is why open source bug reporting systems need a "developer in denial" status. Here's the original bug report. If a developer tries to close a bug and the users don't agree, the bug should go into "developer in denial" status and that should count against the developer's stats. This particular bug was closed by Drew Bliss of Valve. 3 followers, 0 stars, 0 following. Should be flagged as "unsuitable for employment on security-related projects".
Nothing works with it. First step on all our boxes is to turn it off, it couldn't be more intrusive. If it were easier to use it would be more useful.
Pro-tip: Read this story in the voice of GLaDOS to make it much more fun.
I too think it's a clash of cultures, but I think the clash comes from people not grasping what BETA means. I think you'll find that the "unix culture" advocates not to run beta software on production equipment, even if production equipment is just a facebookmachine for your mom.
Simply put, gaming and the security model enforced by SELinux, just don't mix. The whole idea of SELinux is to provide fine-grained control to system resources. You can't have that and expect acceptable gaming performance. The specialized way that Miles' uses memory is just one example. The modern "direct" graphics drives are another.
How to solve this? Simple. Don't play games on your security assets. The security provided by SELinux isn't really intended to protect your checkbook from buffer overflow attacks.
Kriston
Wow, really? Sorry random person on the Internet, but you are *completely* wrong. Did you even read the link on return-oriented programming (ROP)?
Here's how ROP works.
First, I (the attacker) get memory corruption on your program. Let's say a big, meaty buffer overflow on stack (yes, I still see these vulns all the time. In 2014. It makes me sad too).
Second, I spray a bunch of fake stack frames, overwriting all the real return addresses and frame pointers. I also dump some shellcode.
Third, the function I'm in returns. Instead of returning to the shellcode directly, though (can't, because it's not executable), it returns to an instruction somewhere that does a tiny piece of work (like loading the address of the page with the shellcode into a register) and then returns. This is called a "gadget".
Fourth, that first gadget "returns" into another gadget, and so on, each one setting up a function call that will convert the page containing shellcode from RW to RX.
Fifth, after the call is set up, the last gadget (second-to-last sprayed stack frame) "returns" to the entry point of the memory protection call (mprotect on Linux, VirtualProtect on Windows).
Sixth, the final sprayed stack frame - the one the mem protection function is using - returns to my newly-executable shellcode. You are pwned.
So yeah, it turns out that bypassing W^X is really not that hard. This is not a new technique, either; it's been around since basically right after DEP (rather, the NX bit that enforces no-execute at the CPU/memory manager level on any modern OS) was invented. There are actual compilers for ROP, where C goes in one end (along with the program you're exploiting) and the ROP chain comes out the other. You don't need very much code to be able to make ROP Turing-complete. This is partially due to the way that x86/x64, with their variable-length instructions, allow mis-aligned operations. You may think there's code in your program that loads the stack pointer into EAX and then immediately RETs, but if you read every single byte of the program (and all its loaded libraries) as a potential instruction start, you will probably find one!
To defeat ROP, you use ASLR (Address Space Layout Randomization), which in theory prevents successful ROP by randomizing the addresses of all the gadgets (specifically, loading all the executable code at addresses which have been XORed with a random mask). In practice, just like the way somebody will do something stupid that throws away the protection of DEP (like execheap does here...), somebody will write code that relies on being loaded at a fixed address, making an ASLR bypass possible. There are other ways too, like combining the overflow bug with an information leakage bug that tells the attacker what the ASLR mask is (i.e. if they can leak the address Y of something that is "supposed to" be at address X, they can get the ASLR mask M = Y^X) and then XOR their ROP addresses before exploitation.
Nonetheless, ROP is harder than just smashing the stack (or heap) data structures and pivoting into your shellcode. Marking some memory as RWX is just asking for trouble, and should never be done.
There's no place I could be, since I've found Serenity...
The fuck? No, you do not create your own top-level directories. You can do what you want on your own system, as long as interop means nothing to you, but if your tool needs to create top-level dirs on my system, it is broken by design. You know there are standards for this shit, right?
You both sound like dumbasses -- willfully ignorant. Carefully written code is not the point. For one, your shit does not smell like roses, and at best it has no security flaws that you know of, unless you have formally verified your program. For two, I'm not trusting your code, I'm trusting a binary compiled from your code, and a few thousand other binaries like it. Security is always opposed to usability, and maybe you won't like the trade-offs it may entail, but discarding a security tool entirely because you can't be bothered to figure out how to use it correctly, or how to adhere to common well-known standards, is a special kind of idiocy.
Non-standard top-level dirs, ye gods. There are many standards to choose from, and if you are so full of hubris you might make your own standard. Just placing things in whatever TLDs you want is not fucking acceptable -- a grave affront to professionalism.
With a lot of commercial applications on linux the first thing in the manual is "disable SElinux".
Ubuntu/Debian doesn't use SELinux, though, and that's the platform that Valve actively supports. I don't believe you have to disable AppArmor.
That said, if Valve goes ahead and makes Portal2 compatible with SELinux that just goes to show that they're the Good Guys.
> i will protect against buffer overflows attacks.
> while running a closed source application that downloads other applications from the internet. And it all runs as root so i can't cheat.
Genius. You're a fucking genius.
SELinux came from...... the NSA. Oh...
Only boring people are ever bored.
I have to say, good luck with that.
This isn't a windows related issue and the cheap shots aren't necessary nor do they advance the discussion.
Sounds like SELinux is to Linux like UAC is to Windows.
Not really. Linux inherently does everything UAC does and more. SELinux tries goes beyond that.
Instead of just needing permission to make changes to your computer, SELinux requires a process that you gave permission to make a change to your computer get permission again to make a different kind of change to your computer (and again and again and again).
As reported, it also forbids executable stacks. Ordinary Linux only requires programs which use executable stacks to declare themselves. The vast majority of programs don't need to, so they're protected against stack overflows.
A stack overflow in a single-user game running with ordinary account permissions is, quite frankly, not a security issue.
Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion.