Live data from Hacker News

Gokrazy: A pure-Go userland for Raspberry Pi 3 appliances

gokrazy.org

41–50 of 90 posts

Re: Gokrazy: A pure-Go userland for Raspberry Pi 3 appliances

#41
post #8

This is great! I think it could have uses far beyond the Raspberry Pi. As someone who's worked in the consumer electronics industry for years, I think we desperately need to rethink our approach to Linux-based electronics with respect to both the userland and the primary application. A legacy-free framework written in a safe language could go a long way to improving our currently lousy reputation with respect to secu…

Shameless self-promotion: also take a look at https://github.com/u-root/u-root :) (The gokrazy and u-root people all work at Google, I just contacted them to see if we can help each other. Not a competing project.)

Any relation to https://github.com/u-boot/u-boot ?

Re: Gokrazy: A pure-Go userland for Raspberry Pi 3 appliances

#42
post #14

Earlier quoted context omitted.

Go is memory-safe. See also https://en.wikipedia.org/wiki/Memory_safety

Go is not memory safe (though is certainly safer than C++). Various Go constructs like interfaces and slices are implemented via non-atomic multiword structs, and data races may result in invalid values leading to memory corruption, etc. See https://blog.stalkr.net/2015/04/golang-data-races-to-break-m...

Yours is a stricter and not-commonly-used definition of "memory safe", which typically means "in the C sense" i.e. pointer arithmetic and bounds checking. Go is certainly memory safe by the typical definition.

Re: Gokrazy: A pure-Go userland for Raspberry Pi 3 appliances

#43

Earlier quoted context omitted.

Shameless self-promotion: also take a look at https://github.com/u-root/u-root :) (The gokrazy and u-root people all work at Google, I just contacted them to see if we can help each other. Not a competing project.)

Any relation to https://github.com/u-boot/u-boot ?

Doesn't look like it. U-boot is a boot loader for PowerPC/ARM/MIPS/ boards. A typical Linux-based embedded system would consist of U-Boot, the Linux Kernel and a filesystem. u-root would be one of the many ways to construct this filesystem.

Re: Gokrazy: A pure-Go userland for Raspberry Pi 3 appliances

#44
post #8

This is great! I think it could have uses far beyond the Raspberry Pi. As someone who's worked in the consumer electronics industry for years, I think we desperately need to rethink our approach to Linux-based electronics with respect to both the userland and the primary application. A legacy-free framework written in a safe language could go a long way to improving our currently lousy reputation with respect to secu…

A large portion of the recent widely exploited NAT box / IP camera vulnerabilities and malware are exploiting logic bugs, backdoors and default passwods - instead of memory safety bugs. I agree memory safe systems are needed, but nontechnical changes are also needed to fix the widespread IoT vendor negligence.

Re: Gokrazy: A pure-Go userland for Raspberry Pi 3 appliances

#45

Earlier quoted context omitted.

Go is not memory safe (though is certainly safer than C++). Various Go constructs like interfaces and slices are implemented via non-atomic multiword structs, and data races may result in invalid values leading to memory corruption, etc. See https://blog.stalkr.net/2015/04/golang-data-races-to-break-m...

Yours is a stricter and not-commonly-used definition of "memory safe", which typically means "in the C sense" i.e. pointer arithmetic and bounds checking. Go is certainly memory safe by the typical definition.

What's the typical definition? With data races, you can access array values out-of-bounds, which seems like the most fundamental thing you'd want protection from in a memory safe language.

Re: Gokrazy: A pure-Go userland for Raspberry Pi 3 appliances

#46

Earlier quoted context omitted.

Shameless self-promotion: also take a look at https://github.com/u-root/u-root :) (The gokrazy and u-root people all work at Google, I just contacted them to see if we can help each other. Not a competing project.)

Any relation to https://github.com/u-boot/u-boot ?

No, what sigjuice said is right. The name was derived off u-boot, though, and u-root can be used (and is in use) with LinuxBoot.

Re: Gokrazy: A pure-Go userland for Raspberry Pi 3 appliances

#47
post #8

This is great! I think it could have uses far beyond the Raspberry Pi. As someone who's worked in the consumer electronics industry for years, I think we desperately need to rethink our approach to Linux-based electronics with respect to both the userland and the primary application. A legacy-free framework written in a safe language could go a long way to improving our currently lousy reputation with respect to secu…

Exactly, the security in legacy systems is non-existent. I've been pretty pleased moving systems to the nerves-project [1] (which like GoKrazy has an A/B root file-system) to replace deprecated and ancient firmware systems. One of those setups required a Windows XP machine to flash the particular MCU that's obsolete now, a huge pain. It was almost impossible to update / patch.

Nerves is based on a Buildroot core but most of the system is built with Elixir and BEAM/OTP. It's fantastic having a high level language built for robustness and reasonable security. Still, I have dreams of porting BEAM to Redox OS one day [2] and replacing the C userland-bits with Rust-bits. Especially if you could represent the micro-kernel services as actors. That would be amazing!

1: https://nerves-project.org/ 2: https://github.com/redox-os/redox

Re: Gokrazy: A pure-Go userland for Raspberry Pi 3 appliances

#48

Earlier quoted context omitted.

Go is not memory safe (though is certainly safer than C++). Various Go constructs like interfaces and slices are implemented via non-atomic multiword structs, and data races may result in invalid values leading to memory corruption, etc. See https://blog.stalkr.net/2015/04/golang-data-races-to-break-m...

Yours is a stricter and not-commonly-used definition of "memory safe", which typically means "in the C sense" i.e. pointer arithmetic and bounds checking. Go is certainly memory safe by the typical definition.

I don't see why it's a different definition, though. What's he's saying is that it's very easy to break Go's bounds checking with race conditions, and produce memory corruption. This isn't true of languages traditionally considered as memory safe - e.g. Java or Python.

Re: Gokrazy: A pure-Go userland for Raspberry Pi 3 appliances

#49
post #44
post #8

This is great! I think it could have uses far beyond the Raspberry Pi. As someone who's worked in the consumer electronics industry for years, I think we desperately need to rethink our approach to Linux-based electronics with respect to both the userland and the primary application. A legacy-free framework written in a safe language could go a long way to improving our currently lousy reputation with respect to secu…

A large portion of the recent widely exploited NAT box / IP camera vulnerabilities and malware are exploiting logic bugs, backdoors and default passwods - instead of memory safety bugs. I agree memory safe systems are needed, but nontechnical changes are also needed to fix the widespread IoT vendor negligence.

Agreed.

gokrazy generates strong passwords by default and listens only on private IP addresses by default to reduce the attack surface.

Re: Gokrazy: A pure-Go userland for Raspberry Pi 3 appliances

#50

Earlier quoted context omitted.

It's everything the kernel doesn't do. In general, that means the surface with which you interact as a user. So if you're used to using a terminal, your SSH connection, your Bash session, are all userland programs (that use kernel features to do things). You can think of it as kernel is a framework like Rails and userland stuff is developers using and expending the interfaces... sort of. When your computer runs headl…

So it's a distribution ? ... that will have security issues, require updates, distribution maintenance, and all that stuff they claim is unacceptable ?

It’s not a full-blown distribution; it doesn’t distribute third-party software. Instead, it allows application authors to build their own distribution (at which point “appliance” is a more fitting word than “distribution”).

Updates are easy to fully automate with gokrazy (and I’ve been using that mechanism for a year at this point) because assembling a new image and installing it over the network is just one simple command. New kernel and firmware versions are provided automatically once they are verified to boot on real hardware.

There is no maintenance aspect in the actual installations (i.e. you don’t need to SSH into them, ran commands to update, etc.) — the root file system is read-only, and an update overwrites it completely. Unless the applications you want to use with gokrazy introduce state, gokrazy defaults to being stateless.

Hope that clarifies things, let me know if you have further questions.

Post reply on HN