!lymvtcwDJ7ZA9Npq:lix.systems

Lix Development

417 Members
(Technical) development of Lix, the package manager, a Nix implementation. Please be mindful of ongoing technical conversations in this channel.140 Servers

Load older messages


SenderMessageTime
15 Jul 2025
@raitobezarius:matrix.orgraitobezarius (DECT: 7248)If a parent directory is replaced with a symlink between the call to getdents and the call to openat, the next openat call will operate on the unexpected directory…18:00:14
@raitobezarius:matrix.orgraitobezarius (DECT: 7248)So yeah, you could just symlink /tmp/SOMETHING18:00:37
@raitobezarius:matrix.orgraitobezarius (DECT: 7248)But honestly, in the case of /nix/var/nix/builds18:00:58
@raitobezarius:matrix.orgraitobezarius (DECT: 7248)What are you going to delete?18:01:07
@raitobezarius:matrix.orgraitobezarius (DECT: 7248) /nix/var/nix ? 18:01:10
@raitobezarius:matrix.orgraitobezarius (DECT: 7248) or /nix/var/nix/builds ? 18:01:16
@raitobezarius:matrix.orgraitobezarius (DECT: 7248)doesn't matter that much?18:01:19
@raitobezarius:matrix.orgraitobezarius (DECT: 7248) You cannot recreate because it's stronger security than living in /tmp, right? 18:01:31
@aloisw:julia0815.dealoiswI'm talking about the fallback, where you can still empty /tmp and it's the same as before except you have to create two directories?18:01:51
@raitobezarius:matrix.orgraitobezarius (DECT: 7248)Indeed, the fallback logic does that18:02:00
@raitobezarius:matrix.orgraitobezarius (DECT: 7248)Maybe the takeaway is that fallback is a bad idea18:02:12
@aloisw:julia0815.dealoisw/nix/var/nix/builds is of course unaffected because no component is world writable.18:02:18
@raitobezarius:matrix.orgraitobezarius (DECT: 7248)But we are running in an impossible tension when it comes to that logic18:02:19
@raitobezarius:matrix.orgraitobezarius (DECT: 7248) The fallback logic exist when you run Nix as an unprivileged user that cannot mutate /nix/var/nix/builds 18:02:37
@raitobezarius:matrix.orgraitobezarius (DECT: 7248)What this points out to is probably that the build directory should live in the user private tmp?18:03:01
@raitobezarius:matrix.orgraitobezarius (DECT: 7248) So, /run/user/$UID ? 18:03:11
@raitobezarius:matrix.orgraitobezarius (DECT: 7248)How about this?18:03:28
@raitobezarius:matrix.orgraitobezarius (DECT: 7248) Fallback logic tries to go for /run/user/$UID first then fallback to /tmp 18:03:38
@raitobezarius:matrix.orgraitobezarius (DECT: 7248)The tmp fallback seems inevitable for… other platforms than Linux/systemd I suppose?18:03:48
@raitobezarius:matrix.orgraitobezarius (DECT: 7248)
In reply to @me:indeednotjames.com
uh sure, can look into this if jade is currently away/afk
(go ahead)
18:04:45
@raitobezarius:matrix.orgraitobezarius (DECT: 7248)
In reply to @raitobezarius:matrix.org
The fallback logic exist when you run Nix as an unprivileged user that cannot mutate /nix/var/nix/builds
And to finish my reasoning: either you have a nice location that you know has no world writable component, but you need to find one that makes sense for the user and is writable for you, either you don't and the world writable locations are not too bad for that?
18:05:24
@raitobezarius:matrix.orgraitobezarius (DECT: 7248)The best is the former, the worse is the latter18:05:53
@aloisw:julia0815.dealoisw
In reply to @raitobezarius:matrix.org
Fallback logic tries to go for /run/user/$UID first then fallback to /tmp

Is it big enough?

tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=4045880k,nr_inodes=1011470,mode=700,uid=1000,gid=100)
18:09:30
@raitobezarius:matrix.orgraitobezarius (DECT: 7248)that's my concern as well…18:09:44
@raitobezarius:matrix.orgraitobezarius (DECT: 7248)but can be fixe18:09:46
@raitobezarius:matrix.orgraitobezarius (DECT: 7248)* but can be fixed18:09:47
@raitobezarius:matrix.orgraitobezarius (DECT: 7248)and also supposed to stage only builds that cannot go via /nix/var/nix/builds18:09:54
@aloisw:julia0815.dealoiswAgreed, the hardening also seems a lot more important in the privileged case anyway.18:13:13
@aloisw:julia0815.dealoiswOr maybe not, given that the arbitrary directory delete may not come from Lix? But I fail to come up with a reasonable threat model here in any case.18:14:39
@aloisw:julia0815.dealoiswAlso we might need to nest the build directory in a not world-executable path to prevent the builder from allowing external processes to place sockets into it?18:18:52

Show newer messages


Back to Room ListRoom Version: 10