Menu

1 / 7

Unix GC Remastered – Moe's VR blog

Hacker News·5 months ago
#HBtTdcoc
#mohandacherir#define#include#vertex#struct
Reading 0:00
15s threshold

Introduction

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.

AF_UNIX Garbage Collector — Background

A per-subsystem garbage collector is responsible for reclaiming kernel objects that can no longer be reached through user-space handles.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.