A fork() in the road
https://www.microsoft.com/en-us/research/uploads/prod/2019/04/fork-hotos19.pdf [www.microsoft.com]
2023-03-25 04:02
tags:
malloc
paper
pdf
programming
systems
unix
The received wisdom suggests that Unix’s unusual combination of fork() and exec() for process creation was an inspired design. In this paper, we argue that fork was a clever hack for machines and programs of the 1970s that has long outlived its usefulness and is now a liability. We catalog the ways in which fork is a terrible abstraction for the modern programmer to use, describe how it compromises OS implementations, and propose alternatives.
source: L
Lotus 1-2-3 For Linux
https://lock.cmpxchg8b.com/linux123.html [lock.cmpxchg8b.com]
2022-05-21 21:51
tags:
development
investigation
linux
programming
retro
unix
I’ll cut to the chase; through a combination of unlikely discoveries, crazy hacks and the 90s BBS warez scene I’ve been able to port Lotus 1-2-3 natively to Linux – an operating system that literally didn’t exist when 1-2-3 was released!
source: L
That simple script is still someone's bad day
http://rachelbythebay.com/w/2022/04/05/pipe/ [rachelbythebay.com]
2022-04-19 03:58
tags:
sh
unix
What’s this? The second part of the pipeline still ran? Of course it did. It’s *already running* at the point that the reader fails. Its stdin is hooked to the stdout of the other thing, Unix-centipede style.
The Dirty Pipe Vulnerability
https://dirtypipe.cm4all.com/ [dirtypipe.cm4all.com]
2022-03-07 20:43
tags:
exploit
linux
programming
security
unix
This is the story of CVE-2022-0847, a vulnerability in the Linux kernel since 5.8 which allows overwriting data in arbitrary read-only files. This leads to privilege escalation because unprivileged processes can inject code into root processes.
It all started a year ago with a support ticket about corrupt files. A customer complained that the access logs they downloaded could not be decompressed. And indeed, there was a corrupt log file on one of the log servers; it could be decompressed, but gzip reported a CRC error. I could not explain why it was corrupt, but I assumed the nightly split process had crashed and left a corrupt file behind. I fixed the file’s CRC manually, closed the ticket, and soon forgot about the problem.
Months later, this happened again and yet again. Every time, the file’s contents looked correct, only the CRC at the end of the file was wrong. Now, with several corrupt files, I was able to dig deeper and found a surprising kind of corruption. A pattern emerged.
source: HN
Sandboxing and Workload Isolation
https://fly.io/blog/sandboxing-and-workload-isolation/ [fly.io]
2021-01-10 00:19
tags:
defense
development
security
unix
virtualization
Workload isolation makes it harder for a vulnerability in one service to compromise every other part of the platform. It has a long history going back to 1990s qmail, and we generally agree that it’s a good, useful thing.
From chroot to privsep to docker to firecracker.
A handy diff argument handling feature that's actually very old
https://utcc.utoronto.ca/~cks/space/blog/unix/DiffOldArgumentsFeature [utcc.utoronto.ca]
2020-10-07 21:42
tags:
retro
standard
swtools
unix
If only one of file1 and file2 is a directory, diff shall be applied to the non-directory file and the file contained in the directory file with a filename that is the same as the last component of the non-directory file.
Hacking With Environment Variables
https://www.elttam.com/blog/env/ [www.elttam.com]
2020-07-15 01:16
tags:
exploit
python
security
sh
turtles
unix
Interesting environment variables to supply to scripting language interpreters
source: HN
Make system(3) and popen(3) use posix_spawn(3) internally
https://blog.netbsd.org/tnf/entry/gsoc_reports_make_system_3 [blog.netbsd.org]
2020-07-13 17:55
tags:
netbsd
systems
unix
update
After 1 week of reading POSIX and writing code, 2 weeks of coding and another 1.5 weeks of bugfixes I have successfully implemented posix_spawn in usage in system(3) and popen(3) internally.
source: L
Unix's design issue of device numbers being in stat() results for files
https://utcc.utoronto.ca/~cks/space/blog/unix/FilesystemStatDeviceProblem [utcc.utoronto.ca]
2020-07-01 04:09
tags:
fs
systems
unix
Sometimes, you will hear the view that Unix’s design is without significant issues, especially the ‘pure’ design of Research Unix (before people who didn’t really understand Unix like Berkeley and corporate AT&T got their hands on it). Unfortunately that is not the case, and there are some areas where Research Unix made decisions that still haunt us to this day. For reasons beyond the scope of this entry, today’s example is that part of the file attributes that you get from stat() system call and its friends is the ‘device number’ of the filesystem the file is on.
I think it’s a bit exaggerated to say this is an issue that haunts us. More like a historical note.
Why is there a "V" in SIGSEGV Segmentation Fault?
https://idea.popcount.org/2020-06-18-why-is-there-a-v-in-sigsegv-segmentation-fault/ [idea.popcount.org]
2020-06-18 19:11
tags:
programming
unix
My program received a SIGSEGV signal and crashed with “Segmentation Fault” message. Where does the “V” come from?
source: L
The Deprecated *nix API
https://www.bitquabit.com/post/deprecated-nix-api/ [www.bitquabit.com]
2020-05-21 16:40
tags:
development
swtools
unix
But for “*nix”, without any clarifying context, I for one think in terms of shell scripts and their utilities. And the problem is that my own naïve scripts, despite being written on a legit *nix variant, simply will not run on a vanilla Linux, macOS, or *BSD installation. They certainly can—I can install fish, and sd, and ripgrep, and whatever else I’m using, very easily—but those tools aren’t available out-of-the-box, any more than, I dunno, the PowerShell 6 for Linux is.
source: L
Exploring munmap() on page zero and on unmapped address space
https://utcc.utoronto.ca/~cks/space/blog/unix/MunmapPageZero [utcc.utoronto.ca]
2020-05-15 14:43
tags:
malloc
programming
unix
The difference between Linux and FreeBSD is in what they consider to be ‘outside the valid range for the address space of a process’. FreeBSD evidently considers page zero (and probably low memory in general) to always be outside this range, and thus munmap() fails. Linux does not; while it doesn’t normally let you mmap() memory in that area, for good reasons, it is not intrinsically outside the address space. If I’m reading the Linux kernel code correctly, no low address range is ever considered invalid, only address ranges that cross above the top of user space.
source: L
The Early History of Usenet
https://www.cs.columbia.edu/~smb/blog/2019-11/2019-11-14.html [www.cs.columbia.edu]
2020-04-10 00:51
tags:
email
networking
retro
series
social
unix
>November 2019 is, as best I can recall, the 40th anniversary of the conception of Usenet. (What’s Usenet? The Wikipedia article is ok but not perfect.) I should have written a proper paper; instead, there will (probably) be an irregular series of blog posts.
I didn’t notice the series concluded a while back, so if you were waiting to read the whole thing, it’s done.
How are Unix pipes implemented?
https://toroid.org/unix-pipe-implementation [toroid.org]
2020-03-28 02:20
tags:
c
programming
retro
systems
unix
This article is about how pipes are implemented the Unix kernel. I was a little disappointed that a recent article titled “How do Unix pipes work?” was not about the internals, and curious enough to go digging in some old sources to try to answer the question.
source: HN
Curiosity around 'exec_id' and some problems associated with it
https://lists.openwall.net/linux-kernel/2020/03/24/1803 [lists.openwall.net]
2020-03-26 21:27
tags:
linux
security
unix
The logic responsible for handling ->exit_signal has been changed a few times and the current logic is locked down since Linux kernel 3.3.5. However, it is not fully robust and it’s still possible for the malicious user to bypass it. Basically, it’s possible to send arbitrary signals to a privileged (suidroot) parent process (Problem I.). Nevertheless, it’s not trivial and more limited comparing to the CVE-2009-1337.
source: solar
A Quick Tour of the HP-9000 712/100 NEXTSTEP Workstation
https://bytecellar.com/2016/03/02/a-quick-tour-of-the-hp-9000-712100-nextstep-workstation/ [bytecellar.com]
2020-03-08 22:25
tags:
hardware
retro
unix
While my first NEXTSTEP system was a high-end 486 66MHz PC that I purchased from a NEXTSTEP for Intel fabricator called eCesys out of Alaska, I currently own two qualifying systems: a NeXTstation Turbo Color setup and an HP-9000 712/100 PA-RISC system. I went with the rather more unique (and powerful!) HP “Gecko” for this competition, and decided to put together a little video tour of the system.
source: L
On the Metal: Ron Minnich
https://oxide.computer/blog/on-the-metal-3-ron-minnich/ [oxide.computer]
2019-12-18 01:03
tags:
audio
development
links
systems
unix
On this episode of On the Metal, we interview Ron Minnich. Ron has had a fascinating career working on the interface between software and hardware. Join us as ~we install Gentoo and compile GCC~ to hear a mesmerizing conversation about Unix, Plan9, LinuxBIOS, Chromebooks, RISC-V, of course some Gentoo jokes, flip flop programming toys, and more!
Didn’t actually listen, but there’s a pile of links here anyway.
source: white
Miller
http://johnkerl.org/miller/doc/index.html [johnkerl.org]
2019-12-14 20:58
tags:
sh
swtools
unix
Miller is like awk, sed, cut, join, and sort for name-indexed data such as CSV, TSV, and tabular JSON. You get to work with your data using named fields, without needing to count positional column indices.
This is something the Unix toolkit always could have done, and arguably always should have done. It operates on key-value-pair data while the familiar Unix tools operate on integer-indexed fields: if the natural data structure for the latter is the array, then Miller’s natural data structure is the insertion-ordered hash map. This encompasses a variety of data formats, including but not limited to the familiar CSV, TSV, and JSON. (Miller can handle positionally-indexed data as a special case.)
https://github.com/johnkerl/miller
Celebrating 50 Years of Unix
https://www.bell-labs.com/var/articles/celebrating-50-years-unix/ [www.bell-labs.com]
2019-10-19 17:28
tags:
retro
unix
A lot of this folklore (including the gremlin) is going to be on display at the Unix 50 event. The archivists at Bell Labs have outdone themselves by pulling together a massive collection of artifacts taken from the labs where Unix was developed for over 30 years. I was able to photograph a few of these artifacts last year, but so much more will be exhibited at this event — including several items from the personal archives of some attendees.
Plus quite a few more links at https://www.bell-labs.com/unix50/
source: Dfly
Potential bypass of Runas user restrictions
https://www.sudo.ws/alerts/minus_1_uid.html [www.sudo.ws]
2019-10-14 20:38
tags:
auth
bugfix
exploit
security
unix
When sudo is configured to allow a user to run commands as an arbitrary user via the ALL keyword in a Runas specification, it is possible to run commands as root by specifying the user ID -1 or 4294967295.
Interesting combination of circumstances.
source: HN