Consider the following union mount:
mount -t overlay -o lowerdir=/.pre-foo/lower,upperdir=/.pre-foo/upper,workdir=/.pre-foo/work overlay /foo
I would like to obfuscate that /.pre-foo
to minimize the chance of some process to modify my underlying folders while the union is mounted. I could get it with the following "recursive" mount:
mount -t overlay -o lowerdir=/foo/lower,upperdir=/foo/upper,workdir=/foo/work overlay /foo
My question is: Is this safe? Is there any security and/or performance risk in mounting an overlay "recursively"?
lowerdir
,upperdir
andworkdir
be nested inside the mount point (/foo
, in this case)? (2) Is such nesting secure and performant? (3) After the mount is performed, will the nestedlowerdir
,upperdir
andworkdir
be hidden, protected, and only accessible through the "view" provided by the overlay?