Control: forcemerge 912180 1008240 On 2022-03-25 Johannes Schauer Marin Rodrigues <jo...@debian.org> wrote: > Quoting Trent W. Buck (2022-03-25 05:15:41) >> I see a quite odd behaviour where "find ... -type f" inside a >> customize hook is matching device files. As a simple test, "find >> /dev -type f" finds /dev/zero inside mmdebstrap, but not outside >> mmdebstrap.
> the unshared user doesn't have permissions to run mknod but we still need > devices like /dev/null in unshare mode. To solve this problem mmdebstrap > bind-mounts /dev/null to a real file. You can reproduce your findings without > mmdebstrap like so: > sudo touch null > sudo mount -t bind /dev/null null s/ -t / -o / > Now run your find and stat calls and you will get the same results as > you did inside mmdebstrap in unshare mode. So this behaviour is not > unique to the unshared user namespace but happens outside of it as > well if you bind-mount device nodes on files. FWIW this is a duplicate of 912180. Afaiu the upstream bug discussion find uses getdents() and avoids unecessary stats(). However linux returns incorrect information. The possible performance penalty might be huge. cu Andreas -- `What a good friend you are to him, Dr. Maturin. His other friends are so grateful to you.' `I sew his ears on from time to time, sure'