17:56:03 [illumos-gate] 16211 fexecve tests fail if output is redirected -- Andy Fiddaman 18:07:46 rmustacc: Follow up to my nvme question the other day, they were on a PI before that issue you pointed me to. 18:19:39 OK, great. Hopefully if they can update that should work. 18:22:16 Yeah, they did and reported that it's resolved. 18:44:33 Even better. 18:44:38 Glad it was that simple bahamat. 18:47:15 i was just saying earlier, the simples fixes are great :) 18:51:20 ... as i'm about to get dragged into iscsi hell (which is somewhat of a redundant term :P) 19:12:16 though speaking of which, i should probably add decoding of it to snoop 19:52:52 Ouch. The fexecve() change looks a lot more damaging than originally expected 19:53:45 When I looked at the review it was a simple wrapper, but turn your back for a moment and it's quite a different thing entirely 19:54:28 What's wrong? 19:54:37 And/or why is it damaging? 19:55:13 Special casing parts of the VFS namespace in the kernel isn't exactly a simple wrapper. 19:55:28 Given you're changing the semantics of what exec() meant. 19:59:28 If I understand the fallout on OI correctly, then a zone or chroot with a pre-change libc will fail 20:00:05 And one of my common zone usages is to run older/different illumos distros in zones 20:01:25 And while we've never said that would work, for it to fail without warning would be a surprise 20:02:36 I haven't actually tested this, just catching up on the mailing lists and looking at the final commit. 20:03:24 (Been slightly busy on the day job, which is currently porting Java back to Solaris/SPARC.) 20:12:02 ptribble: only if you use the OI-special "nlipkg" zones 20:12:16 which let libc in zones get out of sync with the kernel. 20:13:16 Uh, wait, you're letting libc and the kernel get out of sync? 20:13:56 I guess we've been operating under different assumptions. We definitely treat the constraint as libc and the kernel must be in sync. 20:14:08 You have ABI compat for user software definitely. 20:14:40 But if I'm running an OI or OmniOS or XStreamOS zone on Tribblix (or an older version of any on a current version), which has worked perfectly for years, then I get into trouble 20:14:43 I know this doesn't happen often, and it's certainly frustrating regardless. 20:15:07 Generally, as long as the zone is older than the host compatibility is just fine 20:15:16 That's definitely not always true for core software. 20:15:44 That is, the expectation is that the consolidation is in sync. At least from a design constraint perspective. 20:15:56 Otherwise you basically are requiring us to make the system call ABI and not libc static. 20:16:13 I get that it doesn't break often and I don't want to say won't fix as it's important we figure out stuff here. 20:16:48 But at least from a constraints we've told people in the past and committed to it's been around libc/kernel and similar things with unstable interfaces being in sync. 20:17:40 Admittidly the last super obvious case of this was the pipe system call changes many, many years ago. 20:18:11 There was a more recent one, when a structure used over a door between the kernel and dlmgmtd changed. 20:18:38 I thought that nlipkg zones (and ipkg in OmniOS, which is the equivalent), enforced a minimum set of packages to be in sync with the GZ 20:18:56 was completely unaware of this until today but OI has a "nlipkg" brand which evidently doesn't enforce enough: https://docs.openindiana.org/handbook/systems-administration/#zones 20:19:03 Yeah that's totally unsafe 20:19:51 I expect lots of subtle changes we've made in the last few years will _seem_ like they're working, too, while potentially causing a bunch of silent data corruption 20:20:05 (any time you rearrange a struct for an ioctl, etc) 20:20:26 I need to refresh my memory, but that's what these are all about: 20:20:26 https://github.com/omniosorg/illumos-omnios/blob/master/usr/src/pkg/manifests/system-library.p5m#L1308-L1309 20:21:02 Until right now, I thought these in the gate manifests too 20:21:30 *were 20:23:15 https://github.com/omniosorg/pkg5/blob/master/doc/dev-guide/chpt6.txt#L196-L219 20:25:35 I think if you want to be able to use zone images as-is you probably need to be a lot more like Solaris 10, basically: in your distribution, tightly manage releases and binary compatibility. Then you can make a brand like the s10 brand which is a mixture of replacing components that have changed, and doctoring system calls to create a kind of partial syscall stability against a specific era 20:26:22 But it is not really feasible to do that for an arbitrary set of foreign distributions that may have their own local patches, etc 20:28:14 What we're prototyping at Oxide is a little different from that. We have zone images, but we're treating them more like layers. The base system provides things like libc, and your zone image is an overlay on top of that of files that are _not_ base system files; e.g., your application, maybe a PostgreSQL client library, etc. 20:29:37 It's a bit like Docker, basically, except that instead of just depending on the kernel as an unseen artefact that happens to be outside your container, you're really depending on quite a lot of files and processes that are _inside_ your zone, but which didn't come from your image 20:29:55 The layered approach is how I've built production zones since day 1, essentially. 20:30:32 SmartOS does that too, with the caveat that you can't modify /usr so all of the zone-delivered software has to be in /opt instead etc 20:31:08 But the other use case is for building software against an older release, essentially the zone is like a sysroot rooted at /, so I can't modify the local libc 20:31:46 I think for that, you either need a built that understands how to use "gcc --sysroot" or similar: essentially a cross-compiler. Or, you need VMs running the older software release. 20:31:48 I'll have to look at the s10 change to see how hard it would be to mirror that 20:32:00 s/built/build process/ 20:32:16 I definitely tripped over just assuming that the old libc would run in the past with software with the pipe change. 20:32:30 It definitely sucks compared to the convenience, but I don't know a good way to solve it. 20:34:17 If you just want to unwind this specific change inside zones, the s10 brand is a good model, I think. e.g., here is a filter on pwrite() -- https://github.com/illumos/illumos-gate/blob/master/usr/src/lib/brand/solaris10/s10_brand/common/s10_brand.c#L711-L736 20:34:42 so it seems that the reason why you might want to do that is so that the build doesn't see new features in libc that wouldn't exist in the older system. 20:35:23 sysroots for that kind of thing are fine. The hard part is being able to *run* it. 20:35:28 but even if you had a magic linker that produced a filter that limited the new libc to just the endpoints visible in the old libc, there could still be new kernel behavior detectable by configure which would give you something that wouldn't work on the old kernel. 20:36:00 Yeah you have to cross-compile. Your software needs to know it's cross-compiling and cannot do run-time tests. 20:36:42 That's why we have https://github.com/illumos/sysroot -- originally so that the Rust project can build rustc/cargo/etc binaries that run on illumos, but because of their infrastructure requirements they do that build on a Linux machine. 20:37:17 So they have a cross-gcc and cross-binutils configured to use the headers and libraries from illumos/sysroot for building and linking. 20:37:27 (and their build does not use autotools) 20:38:20 I could imagine actually some option to ld that would make a binary as something you're not allowed to execute on this system 20:38:33 *mark a binary 20:38:39 yeah, either cross-compile or run in a VM. 20:38:48 so that if a cross build _accidentally_ tries to do a runtime tst 20:38:49 *test 20:38:56 you'd know about it; a core file etc 20:39:40 Or I suppose just mount your build directory noexec maybe, even? 20:40:44 Filesystem W^X mode - at mount time, choose either ro or noexec for all filesystems.. 20:41:19 haha 20:41:52 Yeah I guess you would need to make all the /tmp and /var/tmp stuff noexec too 20:42:21 alternatively, a procfs-based supervisor for a build that monitors all execs 20:45:42 or dtrace 20:47:26 You could do DTrace but you'd have to be careful to make sure there were no drops 20:47:46 Which are more likely the harder the machine is working on the build etc 20:53:45 just to get people on the same page, see: https://openindiana.org/pipermail/oi-dev/2024-January/033531.html and my (somewhat speculative) response at: https://openindiana.org/pipermail/oi-dev/2024-January/033532.html 20:56:56 I think that if OI add those self dependencies to package manifests, then nlipkg zones would also have received at least the key packages like system/library. It looks like danmcd added them to OmniOS when he added linked zones, but I don't know the history there. 20:57:20 sommerfeld - thanks for those emails links, I wasn't aware there was fallout from the change. 20:57:24 just as a sanity check, is there any good reason to use a semaphore like a mutex (e.g. init to 1)? 20:57:25 (speculative = I haven't reproduced it myself) 21:01:10 andyf: is there any good reason to not add those self-dependencies to illumos-gate? 21:01:21 it seems like the fact that you can't (easily) track who actually has the lock would be a downside, and I can't really think of any upside 21:02:11 I don't think so, no. Except that it becomes no longer possible to shoot yourself in the foot quite as easily. I'm hoping danmcd might have a bit more context on how they came to be in OmniOS, since I know the linked images landed there some time after OI 21:02:34 jbk: some people learned about semaphores first, and didn't move on to newer abstractions? 21:05:25 this is in the iscsi initiator code, i guess they didn't look at any of the other code in the module? 21:18:47 but, yeah, hba_sendtgts_semaphore looks like it could be a mutex. 21:19:27 (assuming that's what you're referring to..) 21:20:34 actually iscsid_config_semaphore 21:23:52 that one too. 21:28:58 new response from Stephan Althaus at: https://openindiana.org/pipermail/oi-dev/2024-January/033533.html 21:29:07 So early on ipkg zones (even upstream in Oracle Solaris) didn't properly link ngzs with GZs. 21:29:53 Once linked-images came along I asked Theo: "Do I keep ipkg unlinked or change it to match upstream?" He told me to keep them (presumably for least-surprise reasons). So I introduced `lipkg` into OmniOS. 21:52:26 see also https://www.hyrumslaw.com/: "With a sufficient number of users of an API, 21:52:26 it does not matter what you promise in the contract: 21:52:26 all observable behaviors of your system 21:52:26 will be depended on by somebody." 22:03:47 danmcd - I think I remember you asking us all on the mailing list too, at the time. 22:04:07 Oooh, there's receipts then.