RSSAmplifier

Blog

Blog on blog.gnoack.org

Recent content on blog.gnoack.org

blog.gnoack.orgRSS feed ↗65 posts

Latest posts

Splitting a git commit

Splitting a git commit is now easy, using: 
 git history split ${REF}
 
 It will ask you hunk by hunk for the things to include in the first commit, and then bring up the editor for the first and second commit message. It couldn’t be simpler than that. 
 P.S.
The stack overflow question for splitting commits discusses the old and cumbersome approach. The 20th answer…

Hyper-Customized One-Off Software for Cheap

I discussed previously that AI projects have a short lifespan, on average . 
 This one is a related hypothesis,
which I believe we are starting to see in the AI-adjacent software engineering domain already,
and which might spill into other domains soon: 
 
 Hypothesis: 
With the changing economics of software creation,
we will see more software which is produced on…

AI-authored projects have a lower lifespan, on average


 The Lindy Effect 
is a theorized phenomenon by which the future life expectancy of some non-perishable thing, like a technology or an idea, is proportional to its current age. 
 
 The project age is now the first thing I check when people advertise their side projects on Hacker News. And for a surprising amount of projects, the age is less than a week. Which makes the expected…

The Catholic Church on Transhumanism


 I did not expect that I’d quote the Catholic Church on this blog.
But they do a good job at expressing the problems with Transhumanism. 
 From the Encyclical Letter Magnifica Humanitas 
(emphasis mine): 
 
 Underlying narratives: transhumanism and posthumanism 
 
 
 In an attempt to shed light on the cultural assumptions accompanying the ongoing digital…

Landlock Path Walk Inversion Experiment


 
 Objective 
 
 Hypothesis 
 
 Implementation 
 
 Measurements 
 
 Effects on Landlock code complexity 
 
 Effects on Performance 
 
 Noteworthy results: 
 
 
 
 
 
 Conclusion 
 
 Full results 
 
 fs_bench 
 
 net_bench 
 
 scoped_bench 
 
 
 
 Objective 
 Landlock…

Shell Tricks: Extract text between two regexes

To extract text between two regular expressions, use sed -n '/first_regex/second_regex/p' . 
 For instance, to ad-hoc extract the function definition of the test tsync_override_log_subdomains_off , use: 
 sed -n '/TEST_F(audit, tsync_override_log_subdomains_off)/,/^}/p' \
 tools/testing/selftests/landlock/audit_test.c
 
 This assumes that the function ends with a single } on an…

Landlock Multithreaded Policy Enforcement


 With Linux 7.0, Landlock gains the new LANDLOCK_RESTRICT_SELF_TSYNC feature . 
 With this new flag to the landlock_restrict_self(2) system call,
the Landlock policy enforcement is applied to the entire process 
rather than just the calling thread. (The naming is analogous to
the similarly named SECCOMP_FILTER_FLAG_TSYNC flag for Seccomp-BPF.) 
 The old workaround 
…

Nutella is in space

The big question for science is: Does it stay on the ground in the jar, or does it form floating lumps? 


Parameterized testing: You want Inputs and Outputs

Is your test in the business of calculating the expected output from the inputs? 
 Then your test is duplicating the logic from the code under test. 
 There is a reason why too much logic in tests is frowned upon :
If you implement the same logic twice,
you are prone to repeat the same mistakes in the test which you already made in the real implementation . 
 for c in [
…

She sells Z-Shells at the Z-Shore

Mickaël’s FOSDEM talk about the Island sandboxing tool : 
 https://fosdem.org/2026/schedule/event/EW8M3R-island/ (with 📽️ video!) 
 The Island sandboxing tool comes with tight integration with the zsh , to make sandboxing a part of the everyday workflow. 
 When you use that integration, the directory that you are in determines the Landlock policy which is then applied to the…

Martin Luther King Day


 The time is overdue. Stevie Wonder is amazing. 🎉 


FOSDEM 2026: It is happening!

I will be at FOSDEM 2026 this year,
with a hunger for Belgian waffles
and a big bag of freshly printed Landlock stickers. 
 I am looking forward to meeting you all again there! 
 If you are dropping by, and want to chat in person, send me a note! 
 I am collecting links over at https://wiki.gnoack.org/FosdemTwentySix . (You might want to double check regarding a potential…

Google Big Sleep: Linux Vulnerabilities

I am excited to share that my team at Google,
Google Big Sleep,
has published the reports
for a few (now fixed) Linux kernel vulnerabilities: 
 
 BIGSLEEP-458654612 
 BIGSLEEP-462435176 
 BIGSLEEP-463332873 
 
 The full public list of issues discovered by Google Big Sleep
is at https://goo.gle/bigsleep . 


Lore links in mutt

The following script takes an email on stdin and constructs the associated lore.kernel.org link based on the email’s Message-ID header. The script copies the link to the Wayland clipboard and posts a notification. 
 The escaping story is not perfect, but at least it is secure. (It only supports the most common characters in the message ID, but then it also can’t accidentally be…

Listening on an ephemeral TCP port

The classic TCP client/server interaction 
 When a TCP client calls connect (2) , it usually gets assigned a port number from the ephemeral port range which is not used yet. 
 The server, on the other hand, usually calls bind (2) 
to set the port that it will listen on. 
 
 
 
 Server 
 
 
 
 socket() 
 
 
 
 bind() 
 
 
…

Integer overflow checking with C23

While I wasn&rsquo;t looking, C23 has standardized checked integer arithmetic functions , replacing the old &ldquo; __builtin_mul_overflow() &rdquo; compiler intrinsics that shipped with GCC and Clang . &#xA; #include <stdckdint.h>&#xA;bool ckd_add(type1 *result, type2 a, type3 b);&#xA;bool ckd_sub(type1 *result, type2 a, type3 b);&#xA;bool ckd_mul(type1 *result, type2 a, type3 b);&#xA; &#xA; The…

Landlock Your Vibe Coding

&#xA; We&rsquo;ve all heard the horror stories where an unsandboxed coding agent&#xA;deletes the user&rsquo;s entire home directory.&#xA;As a mitigation,&#xA;many vibe coding tools are now using Docker to contain the agent&rsquo;s actions. &#xA; Unfortunately, Docker is not a good tool to keep the vibe coding agents at bay .&#xA;To quote Docker&rsquo;s own documentation (emphasis mine): &#xA;…

Argument passing adventures

&#xA; When I posted about the Emacs mouse&#xA;bug in February, I&#xA;looked into the patch set again, and of course spotted more mistakes.&#xA; This&#xA;patch &#xA;simplifies and corrects some inconsistent logic in where&#xA; CAP_SYS_ADMIN was required. The change does not make a difference&#xA;for existing terminal mouse driver programs like GPM or Consolation,&#xA;but it is noteworthy for the…

I broke Emacs mouse support on the console

&#xA; I accidentally broke Emacs mouse support on the Linux console. o_O &#xA; The TIOCLINUX patch for disabling dangerous IOCTLs for the Linux&#xA;console driver ( background discussed on the&#xA;Wiki ) ended&#xA;up accidentally making the mouse cursor invisible on the Linux console&#xA;(the proper text mode one, not xterm). &#xA; I apologize for breaking this. We luckily found a patch for it and…

Git without a hosted platform

People have apparently started believing that in order to use git,&#xA;you&rsquo;d have to also have to host the project on Github or Gitlab: &#xA; &#xA; A few weeks ago, a friend told me that he keeps his pass password repository on Github. &#xA; Beej wrote a guide on git and the Github workflow is very prominent in it &#xA; I came home from FOSDEM with a Github and a Gitlab sticker, but not with…

Dan Bernstein on sandboxing

Thoughts on sandboxing, found via Aaron Swartz&rsquo;s&#xA;weblog , who in turn found it in&#xA; a writeup about Dan Bernstein&rsquo;s 2005 research&#xA;activities (at the end): &#xA; &#xA; The software installed on my newest home computer contains 78&#xA;million lines of C and C++ source code. Presumably there are&#xA;hundreds of thousands of bugs in this code. Removing all of those&#xA;bugs…

Upcoming conferences 2025 Q1

I will be attending the following conferences: &#xA; &#xA; Vintage Computer Festival Zurich , January 18-19, 2025 &#xA; FOSDEM 2025 , February 1-2, 2025&#xA; &#xA; I am collecting a few interesting talks over on the wiki &#xA; Obligatory Landlock talk: Sandbox IDs with Landlock &#xA; We have Landlock stickers this time :) &#xA; &#xA; &#xA; &#xA; If you happen to be at one of these venues,&#xA;if…

Talk: Update on Landlock: IOCTL support

📢 I gave a talk about the recent changes in Landlock and its new&#xA; support for restricting IOCTL&#xA;usage at the Linux&#xA;Security Summit Europe 2024 in Vienna: &#xA; &#xA; 🌍 Talk page &#xA;| 🎥 Video on YouTube &#xA;| 😎 We have stickers! &#xA; Talk Summary &#xA; &#xA; The Landlock security module lets Linux processes restrict what they&#xA;can do and puts developers in charge of defining…

Git: Multirepo patch set

In the context of Alejandro Colomar stepping down as a man-pages maintainer :(, I learned from him that&#xA;it is possible with git to create an email patch set that spans multiple target repositories.&#xA;Specifically, he pointed to a review thread by Jiri Olsa where this was done, and whose outline takes a similar shape to this (simplified): &#xA; &#xA; [PATCH proj v3 0/3] foobar: Add…

Upcoming talk at LSS Europe 2024

📢 I will give a talk about the recent changes in Landlock and its new&#xA; support for restricting IOCTL&#xA;usage at the Linux&#xA;Security Summit Europe 2024 in Vienna: &#xA; &#xA; The Landlock security module lets Linux processes restrict what they&#xA;can do and puts developers in charge of defining appropriate&#xA;sandboxing policies for their programs. We will give a brief&#xA;overview over…

Landlock IOCTL control in Linux 6.10

Landlock&rsquo;s IOCTL support for device&#xA;files has landed in&#xA;Linux 6.10 🚀. &#xA; I also merged the IOCTL support in the Go-Landlock&#xA;library ,&#xA;so you can easily play around with it already. &#xA; In other news, I started informally documenting Landlock usage in C on&#xA; my wiki on the LandlockUsage&#xA;page . &#xA;

LLM-generated docs are usually worthless

This has always been true, but it begs repeating: &#xA; Every docstring should provide additional information &#xA;about the thing that it is documenting,&#xA; which is not obvious from the thing&rsquo;s name and its type information. &#xA; &#xA; And the corollary: &#xA; If an LLM could generate the same docstring for you ,&#xA;based on the name and type information alone,&#xA; then the docstring…

Opening /proc/self/fd/1 is not the same as dup(1)

&#xA; &#xA; Introduction &#xA; &#xA; This feature is mis-documented &#xA; &#xA; /dev/fd/* behave different on other Unixes &#xA; &#xA; &#xA; &#xA; Part 1: An experiment! &#xA; &#xA; Duplicating the file descriptor using dup(2) &#xA; &#xA; Duplicating the file descriptor through /proc &#xA; &#xA; Other file types &#xA; &#xA; TCP Sockets: Can not be reopened through /proc &#xA; &#xA; Pipes: Can be…

Go-Landlock: Networking support

&#xA; In Linux 6.7, Konstantin Meskhidze introduced TCP Networking support&#xA;for Landlock. 🚀 I am happy to announce that Go-Landlock is one of the&#xA;first libraries using it, and it has a demo tool. &#xA; Demo &#xA; If you are running Linux 6.7 or higher and have Landlock enabled, you can try it out like this: &#xA; &#xA; &#xA; Install the tool to ~/go/bin : &#xA; go install…

Public tweets are not public, haha!

Twitter &#xA; &#xA; Posting: You can tweet, but the public can&rsquo;t read it 1 . &#xA; Reading: Most of my timeline is garbage. &#xA; &#xA; Mastodon &#xA; &#xA; Posting: Everything is quasi-public, and instance operators are all-knowing gods 2 . &#xA; Reading: All of my timeline is garbage. &#xA; &#xA; I&rsquo;m sad for Mastodon. It would have been an opportunity to reverse&#xA;the…

The Design of Mailprint

I wrote a tool, Mailprint ,&#xA;for printing out nice-looking emails from Mutt &#xA;and other classic Mail user agents. &#xA; (You might remember from the last article &#xA;that I have recently spent some time to polish my e-mail setup for kernel development.&#xA;While this is not the hip thing to do any more,&#xA;some of those mails are difficult to understand,&#xA;and I occasionally print them…

Lei, the Local Email Interface

Intro &#xA; When I came back to the email account where I first subscribed to LKML,&#xA;it was full . &#xA; But if you are anyway using a local email client like mutt ,&#xA;there is a better option than subscribing via email:&#xA;The lei program lets you import Linux mailing list archives into local maildirs: &#xA; &#xA; &#xA; &#xA; &#xA; public-inbox at &#xA; lore.kernel.org &#xA; &#xA; &#xA; 2.…

The empty Makefile is valid

This is less of a &ldquo;Today I learned&rdquo; article, but more like a Unix&#xA;trick that took me too long to realize. &#xA; Create a new directory with a hello world C program: &#xA; $ ls&#xA;$ cat > hello.c&#xA;#include <stdio.h>&#xA;&#xA;int main() {&#xA; puts("Hello, world!");&#xA; return 0;&#xA;}&#xA; &#xA; 💡 The empty or non-existent Makefile is a valid makefile for this C&#xA;program:…

Landlock: Best Effort mode

&#xA; &#xA; ABI versions and matching access rights &#xA; &#xA; The problem: Refer is different &#xA; &#xA; Implementation of best-effort fallback in C &#xA; &#xA; Common part: ABI version compatibility table &#xA; &#xA; Case 1: the sandboxed program does not need to reparent files &#xA; &#xA; Case 2: the sandboxed program needs to reparent files &#xA; &#xA; Case 3: Sometimes this, sometimes that…

Landlock truncation support in Linux 6.2

Linus Torvalds released Linux 6.2 yesterday, and this kernel release&#xA;supports restricting the truncate(2) and ftruncate(2) operations&#xA;with Landlock. (The kernel patch&#xA;set &#xA;has more information and discussion.) &#xA; You can try this out today with the&#xA; go-landlock library,&#xA;which already supports this feature. To forbid file truncation when&#xA;using go-landlock , update…

Why use Go-Landlock for sandboxing?

&#xA; &#xA; Motivation &#xA; &#xA; Philosophy &#xA; &#xA; The Landlock approach &#xA; &#xA; 1. Make it really easy to use &#xA; &#xA; 2. Make sandboxing enablement part of program initialization &#xA; &#xA; &#xA; &#xA; Other operating systems &#xA; &#xA; Other Linux sandboxing technologies &#xA; &#xA; &#xA; &#xA; How to use Go-Landlock &#xA; &#xA; Step 1: Make sure your kernel supports Landlock…

The feasibility of pledge() on Linux

So, there was a post by Justine Tunney &#xA;about her port of OpenBSD&rsquo;s&#xA; pledge() to her own libc, the&#xA; Cosmopolitan libc . &#xA; She is also calling out that previous attempts at this were flawed: &#xA; &#xA; There&rsquo;s been a few devs in the past who&rsquo;ve tried this. I&rsquo;m not going to name names, because most of these projects were never completed. [&hellip;] The…

XKB With Sway

This explains how to configure multiple keyboards in Sway, and how to&#xA;use advanced configuration when regular xkb_options are not enough. &#xA; Sway configuration &#xA; Luckily, Sway has great support for multiple keyboards with different&#xA;layouts, so it nicely adjusts to whatever keyboard you have plugged in&#xA;or can use separate configurations for a physical keyboard and the&#xA;laptop…

Error Handling Links

This is a collection of interesting literature on the subject of error&#xA;handling which I had collected to research my own blog post on the&#xA;subject a while ago. &#xA; &#xA; &#xA; &ldquo; A Philosophy of Software&#xA;Design &rdquo;&#xA;by John Ousterhout has a significant section on error handling that&#xA;I found worth a read. It takes a slightly different angle and gives&#xA;some good…

Sandboxing with Landlock

Linux 5.13 is going to include the unprivileged sandboxing feature&#xA;Landlock, which has been in the making for many years now. &#xA; Unprivileged means that you don&rsquo;t need special system-level&#xA;privileges like root or CAP_MAC_ADMIN to use it, as some other&#xA;Linux sandboxing mechanisms do. Philosophically speaking, you should&#xA;not need additional special privileges just to drop…

Writing Tests in Go

Tests should be correct by inspection &#xA;Tests require a different approach than normal code. We don't have&#xA;tests for tests, so tests need to be correct by inspection -- and the&#xA;main technique to achieve this is to get rid of the generality of the&#xA;production code, and exercise only very narrow and specific scenarios.&#xA; Decide what test to write &#xA; The goal of testing is to…

Don&#39;t check emptyness before loops

If your plan is to loop over a collection: You shouldn&rsquo;t check for it being non-empty first. &#xA; Don&rsquo;t do this: &#xA; if (!stuff.empty()) {&#xA; for (Item item : stuff) {&#xA; // ...&#xA; }&#xA;}&#xA; &#xA; Do this instead: &#xA; for (Item item : stuff) {&#xA; // ...&#xA;}&#xA; &#xA; Benefits: &#xA; &#xA; Shorter &#xA; Less nesting &#xA; Same performance &#xA; &#xA; I used to do this…

Go-style coroutines in the FN language

My toy Lisp fn is an inherently&#xA;single-threaded language, but with its built-in stack-inspection&#xA;capabilities, it&rsquo;s easy to build coroutines on top. &#xA; The&#xA; implementation &#xA;only has about 20 lines of code, including comments. This article&#xA;contains a simplified implementation in-line. In only rewrote some&#xA;comments to make more sense in context, and removed…

Rendering drawings with tuhirender

Recently, almost all my digital drawings were made with a Bamboo&#xA;Slate &#xA;tablet and Tuhi . It was good&#xA;fun to take Tuhi&rsquo;s drawing data and create my own renderer&#xA; tuhirender , which can be used&#xA;from the command line to produce some more advanced effects and tune&#xA;more of the rendering knobs. &#xA; tuhirender replaces Tuhi&rsquo;s own renderer by building on…

Go: Test Cleanup in Go 1.14

In Go 1.14, the new T.Cleanup() &#xA;function schedules defer-like work to be done after the current test.&#xA;This makes it possible to write very comfortable setup helper&#xA;functions: &#xA; func SetUpFrobnicator(t *testing.T) *frob.Frobnicator {&#xA; t.Helper()&#xA;&#xA; f := frob.New() // Do setup.&#xA; t.Cleanup(f.Close) // Schedule cleanup for later.&#xA; return f&#xA;}&#xA;&#xA;func…

Why Software Design?

The main technique in software design is this: You look at the&#xA;entirety of your system and you decompose it into pieces that are more&#xA;manageable and have clear interfaces. This approach is usually&#xA;referred to as modularization . &#xA; But what&rsquo;s the point of investing such an effort if in the end only&#xA;the externally visible properties of a software matter? &#xA; In his…

Go: Sharing templates across multiple pages

&#xA; &#xA; Renaissance gopher Johannes Gopherberg after inventing html/template &#xA; &#xA; I&rsquo;m using html/template much too seldom to remember how to&#xA;properly share common template blocks across multiple pages. Today I&#xA;had to figure it out for the second time. It&rsquo;s about time to document&#xA;it! &#xA; The approach presented here both (1) makes it possible to…

Go: Path simplification library

A few weeks ago, I got myself a Bamboo&#xA;Slate &#xA;tablet, and had a lot of fun playing around with the output. The Linux&#xA;software for talking to that device is&#xA; Tuhi , which is GUI driven, but&#xA;also dumps the raw point and pressure data in JSON format into a&#xA;directory. &#xA; As a side effect of playing around with that, I published a 2d path&#xA;simplification library which uses…

Go: The lack of generics

Go&rsquo;s lack of generics means that people can&rsquo;t overengineer in the way&#xA;they are used to, so they need to put more thought into their designs. &#xA; There are some use cases where abstractions with generics are better&#xA;to the current ones (e.g. the sort package), but by and large, in&#xA;other languages, people use them to build towers of abstractions which&#xA;you&rsquo;ll later…

The Setup-Cleanup problem

&#xA; &#xA; A fully automated cleanup strategy. &#xA; &#xA; This is a comparison of different programming idioms for performing&#xA;cleanup work. &#xA; Common use cases where this is used include: &#xA; &#xA; Locking and unlocking synchronization locks. &#xA; Opening and closing files. &#xA; Canceling asynchronous operations that aren&rsquo;t needed any more. &#xA; Allocation and deallocation.…