[Nix#8802] Nix exposes dmesg to the linux build sandbox by default #126

Open
opened 2024-03-16 06:45:02 +00:00 by lix-bot · 0 comments
Member

Upstream-Issue: NixOS/nix#8802

Describe the bug

The kernel log is available within the linux build sandbox.

Steps To Reproduce

  1. nix-build --expr 'with import <nixpkgs> {}; runCommand "d" {buildInputs=[util-linux];} "dmesg -w"'

or

  1. nix run --refresh --option extra-experimental-features 'nix-command flakes ca-derivations impure-derivations' github:tomberek/f/sockfault# SOME_SECRET_TO_INJECT

We can see that writing to and reading from dmesg allows for building a communication channel and a synchronization primitive. There are other more interesting things one might be able to do.

Expected behavior

Not sure if this is critical or if syslog/dmesg behavior is required anywhere else.

Additional context

Note that other ecosystems have dealt with this: https://github.com/containerd/containerd/pull/4491 and https://github.com/moby/moby/pull/37929

Ref: https://github.com/tomberek/f/tree/sockfault

Priorities

Add 👍 to issues you find important.

Upstream-Issue: https://git.lix.systems/NixOS/nix/issues/8802 **Describe the bug** The kernel log is available within the linux build sandbox. **Steps To Reproduce** 1. `nix-build --expr 'with import <nixpkgs> {}; runCommand "d" {buildInputs=[util-linux];} "dmesg -w"'` or 1. `nix run --refresh --option extra-experimental-features 'nix-command flakes ca-derivations impure-derivations' github:tomberek/f/sockfault# SOME_SECRET_TO_INJECT` We can see that writing to and reading from dmesg allows for building a communication channel and a synchronization primitive. There are other more interesting things one might be able to do. **Expected behavior** Not sure if this is critical or if syslog/dmesg behavior is required anywhere else. **Additional context** Note that other ecosystems have dealt with this: https://github.com/containerd/containerd/pull/4491 and https://github.com/moby/moby/pull/37929 Ref: https://github.com/tomberek/f/tree/sockfault **Priorities** Add :+1: to [issues you find important](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).
lix-bot added the
bug
imported
labels 2024-03-16 06:45:02 +00:00
jade added the
E/easy
E/help wanted
labels 2024-03-18 16:20:20 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#126
No description provided.