4 ms·
This server appears to have been closed source, and I assume the source is lost. My bet is that OpenBSD's X server has a far better security design, as the ser
by chasil 5y ago
This server appears to have been closed source, and I assume the source is lost.
My bet is that OpenBSD's X server has a far better security design, as the server itself no longer runs as root. The aggressive free() also exposed use-after-free bugs never before seen, and OpenBSD has superior mitigations for rop gadget abuse, aslr everywhere, and other exploits beyond the imagination of 1989.
The paper documents problems of Ada, particularly in linking to C (where the use of void * pointer casts was particularly difficult for Ada's type system), and that the Ada implementation had nearly double the lines of code as the C reference.
In the days of 1989, the fastest CPUs were under 100MHz. It is unlikely that any of this code could be salvaged for a modern server, but the accomplishment is interesting.
- yakubin 5y ago> The aggressive free() also exposed use-after-free bugs never before seen What do you mean by that? Is there an overview somewhere about "aggressive free()" that I can read?
- chasil 5y agoI'll look it up for you a little later. OpenBSD altered malloc/free to use mmap instead of sbrk. This allowed free to remove larger allocations from the address space, which caught a lot of programs that were using memory after free.
- chasil 5y agoIt looks like the conversion from sbrk to mmap happened in 2009. https://www.openbsd.org/papers/eurobsdcon2009/otto-malloc.pdf https://www.openbsd.org/papers/eurobsdcon2009/otto-malloc.pd... https://undeadly.org/cgi?action=article;sid=20090106070242 https://undeadly.org/cgi?action=article;sid=20090106070242 https://news.ycombinator.com/item?id=3286254 https://news.ycombinator.com/item?id=3286254 https://web.archive.org/web/20111231094521/http://os-blog.com/how-openbsd-leverages-malloc-to-find-bugs/ https://web.archive.org/web/20111231094521/http://os-blog.co... General architecture: https://utcc.utoronto.ca/~cks/space/blog/unix/SbrkVersusMmap https://utcc.utoronto.ca/~cks/space/blog/unix/SbrkVersusMmap
- yakubin 5y agoThanks for the links.
- phendrenad2 5y agoYeah old academic papers never published their source. Maybe it's stored somewhere at the originating university's library, but I doubt it...
- zetalyrae 5y ago>the Ada implementation had nearly double the lines of code as the C reference I'll point out to others in the audience: this is largely an artifact of Ada syntax being more verbose, and Ada programming practice favouring longer and more explanatory identifiers compared to C (where a lot of code looks like line noise). For example, see this post and compare the size of the C code vs. the equivalent Ada code: https://borretti.me/article/signed-integers-asymmetrical https://borretti.me/article/signed-integers-asymmetrical
- kevin_thibedeau 5y agoA lot of the Ada limitations pointed out in the paper were fixed in Ada95.
- pyjarrett 5y ago> A lot of the Ada limitations pointed out in the paper were fixed in Ada95. I was going to say that as well. I only more recently hopped on the train, but I didn't see anything which would be problematic for Ada 2012. I've had no problems in my projects doing bit manipulation, using function pointers, dynamic dispatch, or interfacing with C code which uses `void*`. > this is largely an artifact of Ada syntax being more verbose There's a very negative connotation of "verbose" like it's the worst thing in the world. The better way of describing this is the language is explicit and focuses on describing intent. This means it doesn't take long to learn to read and understand standard library code or code from other projects.
- zetalyrae 5y ago>There's a very negative connotation of "verbose" like it's the worst thing in the world. The better way of describing this is the language is explicit and focuses on describing intent. This means it doesn't take long to learn to read and understand standard library code or code from other projects. I agree that it's good. But it's objectively longer, which is what I meant.
- 5y ago
- Lucretia9 5y agoThe thing about this would be that it likely still compile with zero changes, if the source were available. The code could easily be converted to later Ada versions and use C.Pointers where necessary (triple pointers), but void * are easy enough to handle now with an access to null record with convention => C.
- cxr 5y ago> This server appears to have been closed source, and I assume the source is lost. The author is @Java4First on Twitter. Give it a shot.
- Jasper_ 5y agoThe X server on a modern Linux system hasn't run as root since around 2013 or so.
- chasil 5y agoUnfortunately, that didn't make it into CentOS 7. # cat /etc/redhat-release; ps aux | grep X\ :0 | grep -v grep Red Hat Enterprise Linux Server release 7.9 (Maipo) root 2114 0.0 0.1 380804 33900 tty1 Ssl+ Aug03 0:51 /usr/bin/X :0 -background none CentOS 8 does appear to run without root. Maybe someday I can use it in production. # cat /etc/redhat-release; ps aux | grep Xorg | grep -v grep Red Hat Enterprise Linux release 8.4 (Ootpa) gdm 1967 0.0 0.0 1586600 21436 tty1 Sl+ Jan13 2:38 /usr/libexec/Xorg vt1 I was not aware that this had happened.