Article may be outdated

This article is 72 days old. Some details may have changed since publication.

Hacker News·6 min read·hard

Unix GC Remastered

M
mananaysiempre
Unix GC Remastered
AI Summary

This technical article explores the mechanics of the Unix garbage collector (GC) within the kernel, specifically focusing on how it manages socket references. It details a recent rewrite of the subsystem and discusses the risks of memory-related bugs like Use-After-Free.

Why it matters

Understanding kernel-level memory management is critical for maintaining system stability and security in Unix-based operating systems.

Dive DeeperCreate a free account to unlock

The AF_UNIX garbage collector is an interesting piece of the kernel. It exists because sockets can be sent with SCM_RIGHTS but they can become unreachable from user-space while still being kept alive by the kernel, which is not memory efficient; in this situation, the garbage collector intervenes to free them. Not long ago, the subsystem was rewritten from scratch on top of a graph/Strongly-Connected-Components model; but it is still bug prone. This post walks the rewrite end-to-end, and discusses a Use-After-Free bug.

Continue reading on Headlinne

Create a free account to read the full article.

Read full article →
technologyscience
Political Bias
Center
LeftLean LCenterLean RRight
Confidence: 95%

The content is purely technical and objective, focusing on kernel architecture.

Get smarter about the news

Sign up free for a feed built around what you actually care about, Dive Deeper research on any story, and the full text of every article.

Create free account

Already have an account? Sign in