All of lore.kernel.org
 help / color / mirror / Atom feed
* procfs/d_invalidate break userland
@ 2015-04-22 23:41 Mickaël Salaün
  2015-04-22 23:51 ` Al Viro
  0 siblings, 1 reply; 3+ messages in thread
From: Mickaël Salaün @ 2015-04-22 23:41 UTC (permalink / raw)
  To: Linux-Fsdevel, Eric W. Biederman, Al Viro, Miklos Szeredi
  Cc: Greg Kroah-Hartman

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]

Hi,

For your information, the commit bbd5192412fdedbae00888316bfe350bf89d0458 (proc: Update proc_flush_task_mnt to use d_invalidate), in the v3.17, break some userland use of procfs.

In a user namespace, I'm using /proc/<pid>/task/<tid>/fdinfo to mount a tmpfs, chdir into it, terminate the <tid> thread, and use the tmpfs as a private working directory for PID 1. This trick is useful to disconnect/d_drop a directory from the current file system and make it inaccessible to the other processes (kind of an O_TMPFILE for directory).

With the v3.17 this is no more possible because it's no more possible to mount anything in this tmpfs nor use the previously mounted file systems in this tmpfs.

The new d_invalidate is really good to lazily invalidate/umount an entire hierarchy but I'm not sure the intention was to remove this useful "feature" ;)

 Mickaël



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: procfs/d_invalidate break userland
  2015-04-22 23:41 procfs/d_invalidate break userland Mickaël Salaün
@ 2015-04-22 23:51 ` Al Viro
  2015-04-23  7:00   ` Mickaël Salaün
  0 siblings, 1 reply; 3+ messages in thread
From: Al Viro @ 2015-04-22 23:51 UTC (permalink / raw)
  To: Mickaël Salaün
  Cc: Linux-Fsdevel, Eric W. Biederman, Miklos Szeredi, Greg Kroah-Hartman

On Thu, Apr 23, 2015 at 01:41:02AM +0200, Mickaël Salaün wrote:
> Hi,
> 
> For your information, the commit bbd5192412fdedbae00888316bfe350bf89d0458 (proc: Update proc_flush_task_mnt to use d_invalidate), in the v3.17, break some userland use of procfs.
> 
> In a user namespace, I'm using /proc/<pid>/task/<tid>/fdinfo to mount a tmpfs, chdir into it, terminate the <tid> thread, and use the tmpfs as a private working directory for PID 1. This trick is useful to disconnect/d_drop a directory from the current file system and make it inaccessible to the other processes (kind of an O_TMPFILE for directory).
> 
> With the v3.17 this is no more possible because it's no more possible to mount anything in this tmpfs nor use the previously mounted file systems in this tmpfs.
> 
> The new d_invalidate is really good to lazily invalidate/umount an entire hierarchy but I'm not sure the intention was to remove this useful "feature" ;)

And what will happen if you mount stuff there and exit?  Dirty filesystem
after reboot?
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: procfs/d_invalidate break userland
  2015-04-22 23:51 ` Al Viro
@ 2015-04-23  7:00   ` Mickaël Salaün
  0 siblings, 0 replies; 3+ messages in thread
From: Mickaël Salaün @ 2015-04-23  7:00 UTC (permalink / raw)
  To: Al Viro
  Cc: Linux-Fsdevel, Eric W. Biederman, Miklos Szeredi, Greg Kroah-Hartman

[-- Attachment #1: Type: text/plain, Size: 1188 bytes --]


On 04/23/2015 01:51 AM, Al Viro wrote:
> On Thu, Apr 23, 2015 at 01:41:02AM +0200, Mickaël Salaün wrote:
>> Hi,
>>
>> For your information, the commit bbd5192412fdedbae00888316bfe350bf89d0458 (proc: Update proc_flush_task_mnt to use d_invalidate), in the v3.17, break some userland use of procfs.
>>
>> In a user namespace, I'm using /proc/<pid>/task/<tid>/fdinfo to mount a tmpfs, chdir into it, terminate the <tid> thread, and use the tmpfs as a private working directory for PID 1. This trick is useful to disconnect/d_drop a directory from the current file system and make it inaccessible to the other processes (kind of an O_TMPFILE for directory).
>>
>> With the v3.17 this is no more possible because it's no more possible to mount anything in this tmpfs nor use the previously mounted file systems in this tmpfs.
>>
>> The new d_invalidate is really good to lazily invalidate/umount an entire hierarchy but I'm not sure the intention was to remove this useful "feature" ;)
> 
> And what will happen if you mount stuff there and exit?  Dirty filesystem
> after reboot?
> 

I didn't notice any but only do tmpfs or bind mounts because of user namespace anyway.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-23  8:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-22 23:41 procfs/d_invalidate break userland Mickaël Salaün
2015-04-22 23:51 ` Al Viro
2015-04-23  7:00   ` Mickaël Salaün

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.