On Fri, Aug 16, 2024 at 10:25:52AM +0200, Christian Brauner wrote: > I don't think so. It is clear that the file descriptor table is unshared > and that fds are closed afterwards and that this can race with file > descriptors being inserted into the currently shared fdtable. Imho, > there's nothing to fix here. > > I also question whether any userspace out there has any such ordering > expectations between the two dup2()s and the close_range() call and > specifically whether we should even bother giving any such guarantees. Huh? It's not those dup2() vs unsharing; it's relative order of those dup2(). Hell, make that dup2(0, 1023); dup2(1023, 10); Do you agree that asynchronous code observing 10 already open, but 1023 still not open would be unexpected?