A lot of Googling later, and I've landed on the following page:
https://patchwork.kernel.org/patch/2356101/
Apparently execve()
undos the sharing of the file descriptor table that I had set up with clone()
and the CLONE_FILES
flag (so any socket fd appearing after execve()
is called causes a copy-on-write of the table for the listening process A, rendering the change invisible to the other processes).
I was just unlucky enough that this behavior of execve()
is not yet documented in the current version of the manuals. Hence the above patch by Kevin Easton (thanks, Kevin). Also, thanks, Devolus for leading me in the right direction.