Does Bing have a buffer overflow?
A few days ago, I was doing some Typescript work and went to search for a specific NPM package that I needed the docs for. I generally use DuckDuckGo these days, so I popped in my search and got back some results. These results were a bit odd: Having made a living off of writing C for a few years, I don’t like it when we get random looking byte strings in outputs. We’ve all seen the likes of (Heart|Cloud)Bleed and know that those random byte strings could be anything. Searching further, it’s not just the package I was searching for that has this issue (https://archive.is/gURQv, archived from the original): ...
Is there a space for Serverless applications in the Open Source world?
I’m procrastinating writing my Monitorama talk, so here’s something that I’ve been thinking about for a while: Is there a space for Serverless applications in the Open Source world? We’ve built up a huge ecosystem of tooling to help us run serverless applications. We have platforms, we have observability, we even have databases, kv stores, queues, and everything else that we could possibly want to deploy an application. So why are there no open source serverless applications? ...
Let's build an OS: WTF is /etc/gshadow
Every now and then on my OS journey I find weird things. Today is one of those days. When implementing my login system, I was looking at the standard login files - /etc/group, /etc/passwd, and /etc/shadow. Those are all well known and normal, right? Well imagine my surprise when a file I’ve never heard of popped up: /etc/gshadow. For the uninitiated, on Linux you have a set of groups that your user is a member. You can see them with id: ...
Let's build an OS: crypt(3) is a bit weird
Let’s go on an adventure. I’ve learnt a lot more Rust over the last year, and I want to get back into writing properly, so my plan is to write a Linux Operating System. While writing it, I’ll be taking notes in my repo - https://github.com/sinkingpoint/qos/tree/main/notes . And every now and then formalising them into more structured blog posts over here, once I’ve learnt enough to make something interesting. Recently, I went about implementing a login system for our operating system. I had a general idea of how to do this - users are stored in /etc/passwd, password hashes are stores in /etc/shadow, so we should read a username and password from the terminal, check the password against the password hash, and log the user in if it’s correct. Sounds simple enough, right? Well… there’s a surprising amount of complexity in that “check the password against the password hash” step, and to reveal it we’re going to have to talk about crypt(3). ...
Rabbithole: Shell Pipelines
In prepping for the next part of my OS journey (writing an init system!), I found a need to add pipelining to my shell. This entry is a quick jaunt into how that works. All the code we break down here can be found here. What actually is a pipe? Before we talk about a pipeline, it’s useful to know what a pipe is. Fundementally, a pipe is two File Descriptors (read: files, yes it’s a bit more complicated but bear with me), where what is written to one end of the pipe is readable in the other. Note that this isn’t a two way communication - one file descriptor is the input, and one is the output. ...
Let's build an OS: Mounting a disk
Let’s go on an adventure. I’ve learnt a lot more Rust over the last year, and I want to get back into writing properly, so my plan is to write a Linux Operating System. While writing it, I’ll be taking notes in my repo - https://github.com/sinkingpoint/qos/tree/main/notes . And every now and then formalising them into more structured blog posts over here, once I’ve learnt enough to make something interesting. I had intended this entry to be a simple one. I really did. We were going to use the nix binding of the mount function to create a tiny binary that takes a device and a mount point and mounts it. Literally three lines of code. ...
Let's build an OS: A basic shell
Let’s go on an adventure. I’ve learnt a lot more Rust over the last year, and I want to get back into writing properly, so my plan is to write a Linux Operating System. While writing it, I’ll be taking notes in my repo - https://github.com/sinkingpoint/qos/tree/main/notes . And every now and then formalising them into more structured blog posts over here, once I’ve learnt enough to make something interesting. I love a good shell. There’s really nothing better than the raw control of your computer that a shell unlocks. Running programs that do things is all well and good, but man, being able to get a good REPL going? Nothing better. ...
Rabbithole: A weird CPIO discrepancy
We learnt previously that an initramfs in Linux is a “CPIO archive”, so I set out to write something that can read and write them, in order to learn more about the format. What I found was an interesting discrepancy between how GNU cpio and the Linux Kernel parse CPIO files. It seems pretty innocuous, but I thought I’d document it for posterity. The CPIO header CPIO is an exceedingly simple format. At its heart, CPIO archives are a list of entries where each entry comprises a header, a file name, and the file data. The header itself is basically a stat output: ...
Let's build an OS: Booting Something
Let’s go on an adventure. I’ve learnt a lot more Rust over the last year, and I want to get back into writing properly, so my plan is to write a Linux Operating System. While writing it, I’ll be taking notes in my repo - https://github.com/sinkingpoint/qos/tree/main/notes . And every now and then formalising them into more structured blog posts over here, once I’ve learnt enough to make something interesting. Welcome to the first of such formalisations: Getting something booting. ...
A look at RISON: Kibana's weird URL encoding
If you’ve used the ELK stack, you’ve probably had the joy of trying to share a Kibana URL with someone. If you were naive enough to just copy the link from your browser (rather than creating a shortlink), you’re faced with something that looks like this monstrosity: https://kibana/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))&_a=(columns:!(_source),filters:!(),index:ea073d70-8ed6-11ea-88e9-39648e0749be,interval:auto,query:(language:lucene,query:'machine:%20164%20AND%20service:%20fun-times'),sort:!()) Discover is right Kibana URL, although we may have a bit of trepidation over what we’ve just discovered, because what are those ?_g and ?_a parameters? ...