News for hackers. Stuff that matters.
Re:Linux Foundation to support Zephyr microkernel by cpeterso on Thursday February 18, 2016 @02:42PM (#11128668)
Why is the Linux Foundation interested in supporting a non-Linux operating system?
Re:Linux Foundation to support Zephyr microkernel by Animats on Thursday February 18, 2016 @03:32PM (#11129070)
That's a good question. Anyone know the political background?

Zephyr is for systems far too small for Linux. You don't even have to have a file system.

Several of the endorsers in the press release speak of Zephyr as "secure". This OS has no memory protection, no user IDs, and no permission system. Any code can do anything. Messages are passed around as raw pointers; they're not copied. Nor is the size sent with the message. And it's all in C. What could possibly go wrong?

There's nothing wrong with using an OS like this when your application program is a few hundred lines. But if you add a networking stack and a mini web server, there's going to be trouble.

[1] https://www.zephyrproject.org/doc/api/api.html

Re:Linux Foundation to support Zephyr microkernel by wslh on Thursday February 18, 2016 @03:48PM (#11129189)
> What could possibly go wrong?

Well, my microwave firmware doesn't have any protection either but, seriously, you can apply security models/proofs to the code you run there.

Re:Linux Foundation to support Zephyr microkernel by kbenson on Thursday February 18, 2016 @06:20PM (#11130179)
You just made me think of what might actually be be possible if you could hack a microwave through the control pad. I'm not sure what could be accomplished with sending unrestricted commands to the hardware in a microwave, but depending on the cheapness of the components, I suspect it's not good.
Re:Linux Foundation to support Zephyr microkernel by schoen on Thursday February 18, 2016 @08:14PM (#11130811)
I have a friend who succeeded in emulating a microwave using MAME and a dump of the microwave's ROM. (I don't remember exactly what all of the microcontroller outputs are; most of them have to do with the LED user interface rather than activating the magnetron.) Of course the emulated microwave can't really cook food (maybe only emulated food...), but you could use that kind of emulation with a debugger to experiment with possible software vulnerabilities.

Since it was possible to reprogram Super Mario World through the controller, it seems pretty plausible that it's possible to reprogram some embedded systems through their UI even when they're not designed for that!

http://hackaday.com/2015/01/22/reprogramming-super-mario-wor...

Re:Linux Foundation to support Zephyr microkernel by kbenson on Thursday February 18, 2016 @08:57PM (#11131002)
> Since it was possible to reprogram Super Mario World through the controller, it seems pretty plausible that it's possible to reprogram some embedded systems through their UI even when they're not designed for that!

That's about what I was thinking. Hell, if there's a standard set of firmware that most, or even just most cheap ones ship with, then it might even work for a large chunk of the units in the wild.

Re:Linux Foundation to support Zephyr microkernel by jonathankoren on Thursday February 18, 2016 @07:26PM (#11130560)
I think an entertaining short story could be premised on this idea.
Re:Linux Foundation to support Zephyr microkernel by 0xdeadbeefbabe on Thursday February 18, 2016 @05:13PM (#11129749)
Well ok, but at least the programs are few hundred lines long. I'm just saying I know that printf("hello world") will halt, and that's a good thing.
Re:Linux Foundation to support Zephyr microkernel by cpeterso on Thursday February 18, 2016 @03:50PM (#11129209)
It seems like small, custom systems like these without memory protection should at least use a safe language like Rust.
Re:Linux Foundation to support Zephyr microkernel by SeanDav on Thursday February 18, 2016 @04:28PM (#11129471)
C can be very safe or very unsafe, it just depends on how you use it. As a counter point: critical code for missions to Mars are written in C.

http://www.verticalsysadmin.com/making_robust_software/

Re:Linux Foundation to support Zephyr microkernel by obelisk_ on Thursday February 18, 2016 @04:59PM (#11129654)
Just because expert C programmers were able to make it work doesn't mean that C is the best way to write secure code. I say this as someone who writes quite a bit of C (though I don't view myself an expert in it yet).
Re:Linux Foundation to support Zephyr microkernel by SeanDav on Thursday February 18, 2016 @05:09PM (#11129724)
I highly doubt they just drew C out of a hat and decided to make it work for their multi million dollar, "absolutely-cannot-fail-software". They would have considered other languages out there. C was the winner.
Re:Linux Foundation to support Zephyr microkernel by nickpsecurity on Thursday February 18, 2016 @06:02PM (#11130084)
Speaking from high-assurance niche, C absolutely sucked for that in more ways than you can imagine. Like the recent NASA post, the reason they use C is tooling and available talent. Ridiculous amounts of manpower went into developing static analysis, testing, compilers, etc for C. The best talent in high assurance pretty much all know C, too, whether or not it's their default language. Almost all the hardware supports it, too.

So, a combo of top talent w/ a C history and tons of tooling made most of them go with C. Many others went with Ada/SPARK. A few small fish even use typed or structured assembler. C is only chosen due to tooling and "better the devil you know" philosophy. Work on superior languages got more results with less effort in both human and mechanical reviews, though. So, the inferior language is only used due to an accident of history.

Details on that here:

http://pastebin.com/UAQaWuWG

Re:Linux Foundation to support Zephyr microkernel by pekk on Thursday February 18, 2016 @11:12PM (#11131478)
Are you recommending that people switch to Ada, or Pascal, or what? Your pastebin seems to strongly favor Algol-likes. It would be nice to see some more substantive reasons why people should be using an Algol-like language in 2016. Just saying that C was originally hacked together to be expedient doesn't quite make that case.
Re:Linux Foundation to support Zephyr microkernel by nickpsecurity on Thursday February 18, 2016 @11:39PM (#11131587)
There's a number of HLL's to choose from today with less safety issues. Start with an efficient one. If developing languages or compilers, then put effort into one that has a nice foundation instead of C. Similarly, there's prior work on C-like languages that had enhanced safety (Cyclone, Ivory) and tools like Softbound+CETS that automatically make code safe w/ a penalty. Use or invest effort in such tools. And finally, if nothing else is available, use a subset of C with sensible coding style and throw every bug-finding tool you can at it.

Those are the recommendations in that order. What you use depends on your domain, constraints, skills, and so on. Modula-2, Active Oberon, Modula-3, Free Pascal, and Component Pascal were probably closest to C's domain in terms of safe, efficient, easy-to-compile languages. Ada is systematic in all the errors it handles but with steep, learning curve. SPARK straight up proves your code. One can also use DSL's/4GL's that generate proper C w/ automated checks like iMatix and Galois do (and I once did). I've also seen Ocaml and LISP used for real-time, even embedded, systems with custom runtime. Ocaml was also used for tooling w/ source to object code verification.

So, there's a number of options. Each are behind C currently in tooling due to limited uptake and investment. More uptake and investment can fix that. Even so, average results of those tools have far lower defects than C code with shorter time to train people (ignoring Ada). That most teams aren't composed of geniuses in safe coding means that's important too.

Re:Linux Foundation to support Zephyr microkernel by snaky on Friday February 19, 2016 @05:24AM (#11132708)
Add to the list ATS, combining features suited for low-level programming (and C-level performance) and dependent types to make it safe.
Re:Linux Foundation to support Zephyr microkernel by nickpsecurity on Friday February 19, 2016 @09:42AM (#11133671)
ATS is interesting. I've seen it used in device drivers and one 8-bit system IIRC. The reason I left it off is that I'm not sure most people can learn how to use it. Whereas, we've taught ALGOL languages, Scheme, and Ocaml to all kinds of people where they're effective enough with types & assertions.

These more mathematical languages have to prove themselves out with real-world examples, algorithms and compiled code, before I recommend them. I'd like to see CompSci keep hammering away at them to find easier and easier ways of learning and using them. Not to mention improve tooling.

Re:Linux Foundation to support Zephyr microkernel by nickpsecurity on Thursday February 18, 2016 @11:50PM (#11131620)
Oh yeah, you had another question: why ALGOL-like languages? I chose ALGOL-like over C-like specifically rather than over every style. The reason is that ALGOL-like languages had better design decisions:

1. Be closer to English to make them easier to read. Important as software is read more than written. Also can help in reviews.

2. Generally have proper features like modules or interfaces to aid programming in the large.

3. Still efficient enough for programming close to the metal.

4. Prefer sane defaults or automated checks on issues that trip programmers up. A good implementation usually lets you turn these off for a module if needed.

5. Tradition of thorough language reports and grammars means less undefined behavior.

6. Most common stuff is still efficient once compiled. If Wirth-like, then also efficient to compile.

7. Less tied to a specific processor style with its own style being more amenable to safe, maintainable operation. See Burroughs B5000 processor vs PDP-11's.

8. IMPORTANT. Easier to develop tooling for verification, esp static or dynamic analysis.

9. Easier to verify mathematically.

So, these are some things off the top of my head that various languages more ALGOL-like did better than C-like languages. I wouldn't say there was a single one that had all these traits but Modula-3 came close. A modified version of Go might as well given its predecessors were used in safe-language OS's. Hope this brainstorm gives you some idea of what things I valued vs C's style.

Re:Linux Foundation to support Zephyr microkernel by pcwalton on Thursday February 18, 2016 @06:04PM (#11130097)
I suspect NASA chose C due to some combination of (a) the tiny verified subset they were using was secure; (b) it doesn't matter that much how secure your language is when you're spending countless sums to verify it anyway; (c) their people and/or their new hires had experience with C; (d) their systems were designed for it. None of these reasons are valid reasons to start a new, reasonably-budgeted, security-critical project in C.
Re:Linux Foundation to support Zephyr microkernel by nickpsecurity on Thursday February 18, 2016 @09:31PM (#11131132)
Great response except for (b). The language choice matters. Some are too complex to verify in typical usage. Fortunately, despite its complexity, C was primitive enough for tools to catch up with a subset of it. One can overdo it. See INTERCAL. ;)
Re:Linux Foundation to support Zephyr microkernel by pcwalton on Thursday February 18, 2016 @05:56PM (#11130042)
Because NASA spends 10x the resources to develop and verify that software. If you are willing to spend that much, any language can be secure.
Re:Linux Foundation to support Zephyr microkernel by tosseraccount on Thursday February 18, 2016 @04:23PM (#11129438)
The first "stable" version of the Rust, version 1.0.0, was released in May 2015 - wikipedia.

Seems like Rust needs a few more laps around the track.

( Rust is from Mozilla Foundation, perhaps we can see some alternate implementations of their products to see how reliable they are with Rust ).

Re:Linux Foundation to support Zephyr microkernel by bluejekyll on Thursday February 18, 2016 @09:16PM (#11131065)
And it's seen 6 minor releases since then. Probably more stable than this kernel.
Re:Linux Foundation to support Zephyr microkernel by zem on Thursday February 18, 2016 @08:54PM (#11130990)
you might find this interesting: https://github.com/fpiot/arduino-ats
Re:Linux Foundation to support Zephyr microkernel by ryao on Friday February 19, 2016 @02:25AM (#11132137)
A kernel is not an operating system.

As for the Linux Foundation, they seem to be branching out into strengthening the entire Linux ecosystem. Having Zephyr for embedded firmware on the bits not running Linux in Linux systems (e.g. sensors) is a step toward that.

Re:Linux Foundation to support Zephyr microkernel by fudged71 on Friday February 19, 2016 @01:23AM (#11131955)
The Linux Foundation is focussed on creating open source consortiums, regardless of their impact on Linux.
Re:Linux Foundation to support Zephyr microkernel by joezydeco on Thursday February 18, 2016 @03:04PM (#11128837)
More nodes = more backend servers?
Re:Linux Foundation to support Zephyr microkernel by digi_owl on Thursday February 18, 2016 @05:29PM (#11129862)
Likely they are shooting for the whole unikernel craze.

Cram this with some server into a VM and drop the VM on top of Linux in the cloud.

Supposedly this setup provides performance vs security middle ground between containers and a full blown distro in a VM.

Meaning that as there is just a minimal kernel present you get higher performance, while being wrapped in a VM reduce the potential of exploits compared to a container.

Re:Linux Foundation to support Zephyr microkernel by Animats on Thursday February 18, 2016 @06:15PM (#11130161)
No, the architecture is all wrong for this being part of a container system. This is for tiny embedded computers. Like RFID tags.