Google Backs Linux Project To Make Android, Chrome OS Harder To Hack (cnet.com) 114
Google said Thursday it's funding a project to increase Linux security by writing parts of the operating system's core in the Rust programming language, a modernization effort that could bolster the security of the internet and smartphones. From a report: If the project succeeds, it'll be possible to add new elements written in Rust into the heart of Linux, called the kernel. Such a change would mark a major technological and cultural shift for an open-source software project that's become foundational to Google's Android and Chrome operating systems as well as vast swaths of the internet.
Miguel Ojeda, who's written software used by the Large Hadron Collider particle accelerator and worked on programming language security, is being contracted to write software in Rust for the Linux kernel. Google is paying for the contract, which is being extended through the Internet Security Research Group, a nonprofit that's also made it easier to secure website communications through the Let's Encrypt effort. Adding Rust modules to the Linux kernel would improve security by closing some avenues for hackers can use to attack phones, computers or servers. Since it was launched in 1991, Linux has been written solely in the powerful but old C programming language. The language was developed in 1972 and is more vulnerable to hacks than contemporary programming languages.
Miguel Ojeda, who's written software used by the Large Hadron Collider particle accelerator and worked on programming language security, is being contracted to write software in Rust for the Linux kernel. Google is paying for the contract, which is being extended through the Internet Security Research Group, a nonprofit that's also made it easier to secure website communications through the Let's Encrypt effort. Adding Rust modules to the Linux kernel would improve security by closing some avenues for hackers can use to attack phones, computers or servers. Since it was launched in 1991, Linux has been written solely in the powerful but old C programming language. The language was developed in 1972 and is more vulnerable to hacks than contemporary programming languages.
The language is not the problem (Score:4, Informative)
The algo, the compilator, and the dev are the problem.
Re: (Score:1)
Everybody must report to Google.. Problem solved
Re: The language is not the problem (Score:5, Interesting)
The algo, the compilator, and the dev are the problem.
I've watched C programmers claim that it's easy to avoid security vulnerabilities by just planning your code better. I've also watched C programmers complain about Rust because it forces you to plan your code better.
The first group of them is especially problematic, because the only way you can claim that your code doesn't have any security vulnerabilities is if you're some kind of super programmer that is incapable of producing bugs in their code. That kind of programmer just doesn't exist, and anybody who claims to be that kind of programmer should be trusted the least to write secure code.
The thing with Rust is it guarantees that you can't make certain kinds of mistakes that C offers zero guarantees against. At best you can have a compiler that performs code analysis to look for bugs, but there are never any guarantees.
Re: The language is not the problem (Score:4, Insightful)
The kind of mistakes that Rust protects you against is very limited and easily avoidable by following good coding practices.
All Rust does is make things slightly more idiot-proof.
If your language mostly relies on marketing about letting bad developers write slightly less shitty code, then most likely it doesn't really add any value.
Re: The language is not the problem (Score:2)
Re: The language is not the problem (Score:5, Insightful)
As a bad developer, the idea of less shitty code appeals to me!
Re: The language is not the problem (Score:5, Insightful)
As a user who doesn't feel like auditing the entire Linux kernel for shitty code, the idea of automatic guard rails that keep people from writing shitty code appeals to me too.
Re: The language is not the problem (Score:5, Insightful)
The amount of exploits still caused by buffer overflows and use after free's despite tons of tools and auditing to try to catch them is what it is.
Whether they are caused because they are hard to avoid or because programmers on average are just that bad is kinda besides the point to me as a user. From your perspective a slightly more idiot proof language must be an improvement, because most programmers for the software you rely upon to provide you with both direct function and indirect function within the society you live in are idiots.
I personally don't think most programmers are idiots and those flaws are as hard to avoid as to detect within C(++) code, but that's just me. It doesn't change the necessity for Rust.
Re: (Score:2)
The kind of mistakes that Rust protects you against is very limited and easily avoidable by following good coding practices.
In other words C/C++ programmers get thrown under the bus because all these problems are poor programmers. Almost makes one want to pick up a language that follows good programming practices so the next time the blame train comes around it will not run over the wrong thing.
Re: The language is not the problem (Score:2)
The computer does what it is told. The problem is not the soldier, the problem is the general. But let's be honest. How common is a memory error in the kernel? I thought Linus inspects and approve everything and he never makes a mistake.
Re: The language is not the problem (Score:5, Informative)
Re: (Score:3)
Re: (Score:2)
Re: The language is not the problem (Score:5, Informative)
> The kind of mistakes that Rust protects you against is very limited and easily avoidable by following good coding practices.
The major good coding practice that Rust protects you against is using C. :-)
More seriously: I've worked in C code for the majority of my career, and I would NOT consider the protections Rust provides to be easily achieved by good coding practices. Rust gives provable protection against memory sharing, bound overwrites, and thread interaction. Those aren't trivial! Even if you "upgrade" to C++ to have all the OO power for construction-is-allocation, exception propagation, etc, you still fundamentally have a language that allows bad practices and even encourages them in its simplest syntaxes. Rust provides the same low-level memory manipulation and speed of C without the risk.
C++ with warnings (Score:3)
C++ written with RAII can be made pretty safe. And I would like to see some compiler warnings about pointer arithmetic etc. which would help a lot.
But C++ is a dog.
The biggest problem with Rust is the documentation, which boasts about solving problems that no competent RAII C++ programmer would have. I think there are a few good bits, but they are not made obvious.
You also need to use a different coding style, more like traditional Visual Basic than C. Using Array Vectors instead of linked pointer struct
Re: (Score:2)
I believe rust grew out of the founder's experience with OCAML.
C won't be bulk rewritten in Rust because of the syntax but I wonder if we're discussing robustness through a stricter compiler why safe-C dialects such as Cyclone never took off.
http://cyclone.thelanguage.org/
Re: C++ with warnings (Score:2)
While there may be a niche for Rust, most of the kernel could be written in a modern garbage collected language like Java or .Net. They are much more powerful and very efficient if you can resist the temptation to create too much garbage.
Why on earth would you put a garbage collection runtime in a kernel? Especially when you have a language like rust that literally gives you the best of both systems languages and garbage collected languages, with none of their drawbacks?
Re: (Score:2)
Rust has none of that bullshit. Instances are NOT copyable by default but t
Re: (Score:2)
C++ does fix some of the issues in C e.g. you can manage resources and memory a little easier, but it's a monster in its own right. It doesn't track object lifetimes and rules governing copy (and now move) are horrific and complex. It also introduces its own subtl
Re: The language is not the problem (Score:2)
The kind of mistakes that Rust protects you against is very limited and easily avoidable by following good coding practices.
That's like saying that all bugs are easily avoidable by following good coding practices. And it's totally wrong, even when you follow good practices you're bound to make mistakes. You might make fewer mistakes, but the larger your project gets, the more mistakes you'll make anyways.
And saying the types of mistakes rust helps against is "very limited" is disingenuous; it eliminates the possibility of entire classes of bugs, including non-memory bugs like concurrency.
Re: (Score:2)
That's like saying that all bugs are easily avoidable by following good coding practices.
This makes no sense. How does "The kind of mistakes that Rust protects you against is very limited and easily avoidable by following good coding practices." turn into an assertion of "all bugs are easily avoidable"?
And saying the types of mistakes rust helps against is "very limited" is disingenuous; it eliminates the possibility of entire classes of bugs, including non-memory bugs like concurrency.
Rust does not eliminate concurrency bugs.
Re: The language is not the problem (Score:2)
This makes no sense. How does "The kind of mistakes that Rust protects you against is very limited and easily avoidable by following good coding practices." turn into an assertion of "all bugs are easily avoidable"?
Because there is no single bug or category of bugs that good coding practices will eliminate. It will surely reduce the chance of them ending up in your code, but that is never a guarantee.
Meanwhile, Rust offers that guarantee.
Rust does not eliminate concurrency bugs.
To be specific, it eliminates the possibility of data races:
https://blog.rust-lang.org/201... [rust-lang.org]
Re: (Score:2)
Because there is no single bug or category of bugs that good coding practices will eliminate. It will surely reduce the chance of them ending up in your code, but that is never a guarantee.
Even if for the sake of argument it is stipulated the statement above is true how does falsely asserting a subset of bugs is easily avoidable morph into an assertion that "all bugs are easily avoidable"?
Lets say I came up with a scheme of putting Krusteaz out of business and it proves to be ineffective and misguided or say it works perfectly and everyone is forced to use Bisquick or make their own pancake mix... The notion wanting to put Krusteaz out of business is the same as wanting to put all companies
Re: (Score:2)
Even if for the sake of argument it is stipulated the statement above is true how does falsely asserting a subset of bugs is easily avoidable morph into an assertion that "all bugs are easily avoidable"?
Because it equally applies to any kind of bug, not just the ones that Rust offers guarantees against. There is no rhyme or reason why his statement would be limited in scope to just the kind of bugs Rust offers guarantees against.
Lets say I came up with a scheme of putting Krusteaz out of business and it proves to be ineffective and misguided or say it works perfectly and everyone is forced to use Bisquick or make their own pancake mix... The notion wanting to put Krusteaz out of business is the same as wanting to put all companies out of business is not something that I understand.
Probably because that is a terrible analogy.
In big bold faced text Rusts very own official documentation stipulates "However Rust does not prevent general race conditions."
Hence I specified that it applies to data races.
Re: (Score:2)
Because it equally applies to any kind of bug, not just the ones that Rust offers guarantees against.
What loufoque said was "The kind of mistakes that Rust protects you against is very limited and easily avoidable by following good coding practices."
What loufoque did not say was "All mistakes are easily avoidable by following good coding practices"
You are asserting both statements are effectively the same without offering a compelling reason why that would be the case. All you have done thus far is assert an equivalence exists between statements without explaining WHY you believe that to be the case.
There is no rhyme or reason why his statement would be limited in scope to just the kind of bugs Rust offers guarantees against.
I sus
Re: (Score:2)
You are asserting both statements are effectively the same without offering a compelling reason why that would be the case. All you have done thus far is assert an equivalence exists between statements without explaining WHY you believe that to be the case.
I did. Many times.
I suspect the reason loufoque decided to explicitly limit scope is these things are relatively easy to systematically address generally while other types of problems have no reasonable general solution.
This is where you're confused: he said mistakes can be avoided, he didn't say anything about solutions to problems. Those are very different things. But assuming that's what you meant (even though your words say otherwise,) be specific here: Name the types of programming mistakes that can't be avoided (or otherwise mitigated, as I'm asserting) with better coding practices.
What you said was "it eliminates the possibility of entire classes of bugs, including non-memory bugs like concurrency." which is of course incorrect.
Which is why I qualified it.
Re: (Score:2)
I did. Many times.
You have failed to do so on even a single occasion.
This is where you're confused: he said mistakes can be avoided, he didn't say anything about solutions to problems.
The phrase "I suspect" means what to you?
Which is why I qualified it.
Separately AFTER you were called out on it. More importantly the "data race" language is effectively meaningless as a "class of bugs". People care about race conditions. Saying there are no data races means squat in the real world. Well yea this answer is wrong but hey at least the data was not clobbered is not a thing. It's like doing uncommitted reads in a database and thinking you've accomplished something u
Re: (Score:2)
You have failed to do so on even a single occasion.
I even did so in that very post you replied to. That you are unable to comprehend it doesn't matter to me.
The phrase "I suspect" means what to you?
It means that you've either got some very bad reading comprehension or your sleuthing skills are terrible. Either way, you're nowhere close, and it says a lot about your understanding, or lack thereof, of the subject at hand. Disagree? Then either answer the question or quietly acknowledge that you're arguing about nothing.
Separately AFTER you were called out on it.
"called out"? You mad bro?
My statement wasn't incorrect, it just wasn't specific
Re: (Score:2)
The kind of mistakes that Rust protects you against is very limited and easily avoidable by following good coding practices.
There is no good coding practice that prevents you from free-ing a pointer twice or forgetting to free it.
And the first one is a real problem if the malloc/free library is not robust. And it is a performance problem, if the library is robust.
Actually, I consider people who make arguments like yours: idiots. And your final sentence nails it: If your language mostly relies on marketing a
Re: (Score:2)
The kind of mistakes that airbags and seatbelts protect you against are very limited and easily avoidable by following good driving practices.
Re: (Score:2)
And I think we can all agree that the kernel probably has a higher threshold for coding quality and inspection than most source code. So even having super programmers will not save a project written in C. And most software
Re: (Score:1)
The easiest way to see what impact Rust could have on code quality is to look at the CVE database. A substantial % of CVEs are for for things like invalid pointers, double frees, data races, buffer overflows etc. Rust either doesn't allow those things by design or fails at compile time.
I'm waiting patiently for someone to write better software in their favorite better language. We've been hearing for literally decades how x language is better yet nothing of consequence ever seems to get written in it and the excuses are always predictably the same.
When can we expect good web browsers, operating system, codecs, AAA games, network stacks, databases or really anything to get written in (insert language here) with better results? Will we have real hoverboards and working fusion reactors by
Re: (Score:1)
Re: (Score:2)
The algo, the compilator, and the dev are the problem.
I've watched C programmers claim that it's easy to avoid security vulnerabilities by just planning your code better. I've also watched C programmers complain about Rust because it forces you to plan your code better.
The first group of them is especially problematic, because the only way you can claim that your code doesn't have any security vulnerabilities is if you're some kind of super programmer that is incapable of producing bugs in their code. That kind of programmer just doesn't exist, and anybody who claims to be that kind of programmer should be trusted the least to write secure code.
The thing with Rust is it guarantees that you can't make certain kinds of mistakes that C offers zero guarantees against. At best you can have a compiler that performs code analysis to look for bugs, but there are never any guarantees.
Biggest problem in code from lazy or inexperienced programmers is the failure to check return codes. Return codes that report buffer overruns, or other.
Re: The language is not the problem (Score:2)
Name even one active programmer who hasn't had any bugs in their code in the last year. At the end of the day, security vulnerabilities are just bugs.
Re: (Score:2)
Isn't that victim blaming at it's finest?
OpenBSD (Score:2)
OpenBSD is written almost entirely in C, and is extremely secure. That's because the developers put an emphasis on security, and the man pages for functions in OpenBSD reflect that.
Re: (Score:2)
And because OpenBSD supports so little hardware that it's a small fraction of the size of the Linux kernel. A smaller, slower-evolving code base is always easier to secure.
Re:OpenBSD (Score:5, Interesting)
OpenBSD also has an inflated reputation because people like to accept random things they hear as true.
OpenBSD gained reputation for being secure 20 years ago simply by having everything disabled by default, which is common now but wasn't then. And yes, they maintain OpenSSH and audited some packages, but that's it.
They have always strongly resisted introducing anything like MAC (SELinux, AppArmor) which would really make the system secure. At this point I'd rather run NetBSD which has some nice features like VeriExec. OpenBSD security is a myth, and it's no more secure running it on a gateway than any other stripped down hardened *nix system.
Re: (Score:3)
Re: (Score:2)
Got it in one.
Oh, and management has to alot time to *do* security; "get it working, and we'll bolt on security later" means "it'll never happen".
If they really wanted a secure system (Score:2)
The title of the presentation is, "Software That Never Fails and Can’t Be Hacked"
https://www.youtube.com/watch?... [youtube.com]
Re: (Score:2)
I think the compromise is "never fails and can't be hacked" be at the bottom-most layers.
Re: (Score:2)
i decided to check that link just because of your fz quote.
i hurried past the pompous introduction and self-gloating, past the embarrassing caltech ceo nonsense ... and really had enough halfway through the "alumnus"'s doom calling.
if he actually does emit some interesting idea or concept please provide an one-liner abstract and/or a timestamp and i will be delighted to retry.
Re: (Score:2)
Maybe something about treating code like one treats mathematics with lots of proofs. The whole thing is rather information poor and long on, ah somethings wrong with the world.
Re:If they really wanted a secure system (Score:4, Interesting)
If you want to treat code more like math, you should try programming in ACL2. You write pre and post conditions for parameters as part of every function and the compiler emits a human-readable mathematical proof of correctness as part of compilation. AMD uses ACL2 as their language for the details of their chips. I've seen rendering engines written with ACL2 that can prove the graphics correctness for all edge and corner cases. It's quite a potent language -- LISP variation -- with good performance characteristics.
Actually ... (Score:5, Insightful)
Linux has been written solely in the powerful but old C programming language. The language was developed in 1972 and is more vulnerable to hacks than contemporary programming languages.
Noting that "old" doesn't mean obsolete and it's not necessarily more vulnerable to hacks but rather more vulnerable to poor/unsafe programming techniques -- that make the results more vulnerable to hacks. The kernel could be re-written/updated in C using better practices, but using a "safer" language makes it easier to not have to think/worry about those things. On the other hand, re-writing it in Rust means re-proving the new code is correct. I expect problems either way... Generally, I'd rather update working code than port it and/or generate new code from scratch.
Re:Actually ... (Score:5, Interesting)
The kernel could be re-written/updated in C using better practices, but using a "safer" language makes it easier to not have to think/worry about those things.
Not really. If you've ever tried writing a program in Rust, you'll find that the compiler pounds you over the head with those things and refuses to generate a binary until you use better practices.
Re: (Score:2)
The kernel could be re-written/updated in C using better practices, but using a "safer" language makes it easier to not have to think/worry about those things.
Not really. If you've ever tried writing a program in Rust, you'll find that the compiler pounds you over the head with those things and refuses to generate a binary until you use better practices.
Thanks for info, though I meant some languages won't allow dangerous things or the resulting program will complain/die at runtime when they occur whereas C will allow them and/or the program will keep right on running.
Re: (Score:2)
or the resulting program will complain/die at runtime when they occur whereas C will allow them and/or the program will keep right on running.
A program dyeing at runtime will do so before it has performed an erroneous action and will produce an error and a stack trace showing what happened. A C program in a similar situation will execute the erroneous code and sooner or later crash. There is no safe "the program will keep right on running".
Re: (Score:2)
There is no safe "the program will keep right on running".
I didn't mean to imply there was and/or that doing so would be a good thing, just that it's an artifact of the language's lack of safeguards. (Said as a long-time C programmer)
Re: (Score:2)
It is basically random if the C program keeps running or crashs.
Depend on the problem. Buffer overflow, most likely a crash sooner or later.
Forgot to free some memory - either the program gets "out of memory" eventually - or it is no problem as the program, e.g. a C compiler terminates before that.
Double free some memory: most likely a crash.
Re: (Score:2)
Re: (Score:3)
I always use the pedantic flag if I'm writing C code, but sorry, it's not even in the same league as Rust when it comes to strictness. My estimate is that -pedantic might catch 25% of the things that Rust enforces.
Re: (Score:2)
I would agree with that estimate, especially in any multithread application.
Re: (Score:2)
I keep seeing comments like this and what you need to do is stop and consider why there's still drive to replace chunks of the Linux kernel with Rust if it's as easy as this. A whole bunch of people have looked at it and decided that it's at least worth a try to code up some chunks of the kernel in Rust because despite everyone on slashdot apparently being an expert, a whole bunch of people that have a stake in Linux being secure have come to the conclusion that it's not enough to turn on the --pedantic fla
Re: (Score:2)
I predict, with Rust, the kernel will be approximately 4x bigger and waste cache. Cache which would be better used for applications. The kernel does not produce useful results, it is overhead. It needs to be small as possible so it can stay out of the way. Memory is cheap, but cache and registers are the bottleneck to performance.
Re: (Score:2)
Re: (Score:2)
Wow, imagine if the Linux kernel contributors knew that!
Re: (Score:2)
Re: Actually ... (Score:2)
Rust is not just safe C.
It's a strongly opiniated language made by people who misunderstood how to use C++.
C, on the other hand, is a pragmatic no bullshit language, that among others doesn't require adhesion to a cult to use.
Re: (Score:2)
C, on the other hand, is a pragmatic no bullshit language, that among others doesn't require adhesion to a cult to use.
No argument here ... been using it since the 80's.
Re: (Score:2)
Re: (Score:3)
Re: (Score:2)
Re: (Score:3)
Ironically you couldn't manage to write this without sounding pretty darn tribal yourself.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: Actually ... (Score:2)
Itâ(TM)s also a stupid comment made by someone thatâ(TM)s clearly never done kernel development for any significant amount of time. The kernel makes heavy use of modern C extensions and standards, and often drives changes standardization (often done jointly with the glibc folks). The kernel also makes rather heavy use of preprocessor macros and inline assembly that makes it a challenge even for non-gcc C compilers to build, though the use of gcc-specific extensions has reduced in recent years as o
Re: (Score:2)
Re: (Score:2)
I hope you were speaking in generalities because that's not what I was saying. But, using Rust won't be a panacea for all the programming woes of the original C code and rewriting things, even in Rust, may bring new bugs and problems. Some things may be better redone in Rust, some may be better left in C and updated.
Also, you sounded a bit jerky and should work on your delivery...
No thanks (Score:2)
Re: (Score:2)
Re: (Score:3)
The entirety of Linux is the kernel. If you're marketing something else as "Linux" you're abusing the trademark.
Re: (Score:2)
Re: (Score:1)
Re: (Score:2)
Re: (Score:1)
Re: (Score:2)
Re: (Score:1)
Re: (Score:2)
Re: (Score:1)
Re: (Score:2)
Re: (Score:1)
Re: (Score:2)
Re: (Score:1)
How can they prove NSO (Score:1)
Obvious question (Score:3)
(and kinda hinted at at the end of the article)
why is Google still basing Chrome OS and Android on Linux?
They have Fuchsia, as recently rolled out in production to Nest.
Chrome OS is a V8 virtual machine. Android is a Java-like virtual machine. Why should either runtime care what the underlying OS is?
Crostini can run as a VM on top of Zircon, surely.
Re: (Score:2)
Chrome OS is Linux.
Android is Linux.
The virtual machines are the containers hosting/running the Apps. Has nothing to do with the OS at all.
Re: (Score:2)
I don't even know (nor do I care to search) whether Fuchsia is or tries to be POSIX-compatible so much of those glue libraries I was talking about (they were between the kernel
Looking in the wrong place (Score:3)
The kernel has a pretty good security track record, if they want to find areas that need to be improved, they might start with that massive Java runtime theyâ(TM)ve layered on it and forced every app to go through.
Every few years a new language replaces C again (Score:2)
Re: (Score:2)
Rust does seem to be gaining quite a bit o
Is there a reason to lower the bar? (Score:1)
C is not more vulnerable. (Score:2)
Re: (Score:1)
Looking at the other comments it looks like we have yet another flame war. Like between SYS V and BSD, Gnone and a professional looking desktop like KDE. RedHat and Debian. Wish debian would just go away.
LOL, Some of the comments remind me of SNL. Dan Aykroyd and Jane Curtain. Jane you ignorant slut. bla bla bla... Jane would respond Dan you pompass asshole bla bla bla... Funny bit.
You C people, you ignorant slut...It's terrible. Being a C guy myself - You pompass assholes... it's secure if you are a real p
Re: Wrong language (Score:1)