Message382618
The Linux kernel code is not sufficiently easy to follow to understand if it has this issue or if it pre-creates the dirent structures for all fds at opendir time for /proc/self/fd or if it is iterating through the list of fds in sorted order so an older closed fd will not interfere with its internal iteration.
Regardless, I've yet to knowingly witness a problem from this come up in practice. knowingly and yet being key words. :)
But I like the general theme of your patch to set CLOEXEC on all of the fd's rather than explicitly call close(fd) in the directory reading loop. |
|
Date |
User |
Action |
Args |
2020-12-07 03:11:12 | gregory.p.smith | set | recipients:
+ gregory.p.smith, pitrou, vstinner, neologix, serhiy.storchaka, sstewartgallus, iritkatriel |
2020-12-07 03:11:12 | gregory.p.smith | set | messageid: <1607310672.27.0.355468213304.issue21627@roundup.psfhosted.org> |
2020-12-07 03:11:12 | gregory.p.smith | link | issue21627 messages |
2020-12-07 03:11:11 | gregory.p.smith | create | |
|