On Thu, 15 Aug 2024 at 20:03, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote: > > It *can* actually happen - all it takes is close_range(2) decision > to trim the copied descriptor table made before the first dup2() > and actual copying done after both dup2() are done. I think this is fine. It's one of those "if user threads have no serialization, they get what they get" situations. IOW, I can't actually imagine that anybody would be affected by this in any sane real situation. If you unshare your file descriptors while another thread is modifying it, and you don't have any serialization in user space, you are doing odd things. Now, I'm not opposed to improving on this, but I do think this is a "stupis is as stupid does" kind of thing that we shouldn't care about. Linus