3 ms·
I don't meant to pooh-pooh your project, but Go's memory safety isn't some kind of automatic security guarantee... especially when it comes with a giant downsid
by vinaypai 7y ago
I don't meant to pooh-pooh your project, but Go's memory safety isn't some kind of automatic security guarantee... especially when it comes with a giant downside of having to run as root. Every other production-grade server drops privileges as soon as possible, for a very good reason.
- mholt 7y agoGo does bounds checking and doesn't have dangling pointers, so it's inherently safe from buffer overflows. You don't have to run Caddy as root in production, even to bind to low ports. (None of my sites do.) https://memorysafety.fail https://memorysafety.fail for more info on memory unsafety.
- vinaypai 7y agoThank you for your condescending reply. I understand Go's memory model quite well (and have used Go quite a bit). News flash: you can have bugs of other kinds besides buffer overflows.
- mholt 7y agoEr, sorry, I wasn't being condescending. I intended to clarify some relevant facts, please don't take it personally. You had said: > Go's memory safety isn't some kind of automatic security guarantee... But in some cases, it is. I'm not claiming more than that, nor am I saying that you can't have "bugs of other kinds" -- on which point I agree with you.
- vinaypai 7y ago> Er, sorry, I wasn't being condescending. I intended to clarify some relevant facts, please don't take it personally. Fair enough, it's easy to misunderstand the intended tone in online comments.
- justinclift 7y agoWhy would a Go server need to run as root? Asking because I run Go based servers (in production) on Linux, and they're not running any of the Go processes as root.
- vinaypai 7y agohttps://github.com/caddyserver/caddy/issues/528 https://github.com/caddyserver/caddy/issues/528 It seems like they've fixed their systemd config though to run as a non-privileged user, so that shouldn't be an issue. But it seems like Go processes can't drop privileges because of an open issue with the runtime.
- JdeBP 7y agoIt is interesting to read https://github.com/caddyserver/caddy/issues/528#issuecomment-261125303 https://github.com/caddyserver/caddy/issues/528#issuecomment... , by the way, and see how all of this was later removed because it did not work with older versions of systemd. Notice the reviewer comments at https://github.com/caddyserver/caddy/pull/1127 https://github.com/caddyserver/caddy/pull/1127 .
- JdeBP 7y agoActually, it is because of a long-standing issue with Linux. * http://jdebp.uk./FGA/linux-thread-problems.html http://jdebp.uk./FGA/linux-thread-problems.html