Page MenuHomeFreeBSD

nullfs: add nounixbypass mount option
ClosedPublic

Authored by kib on Wed, Oct 8, 4:10 PM.
Tags
None
Referenced Files
F131698057: D52983.id163881.diff
Fri, Oct 10, 10:47 AM
F131691924: D52983.id163881.diff
Fri, Oct 10, 9:33 AM
F131676815: D52983.id163782.diff
Fri, Oct 10, 6:40 AM
F131676799: D52983.id.diff
Fri, Oct 10, 6:40 AM
F131647839: D52983.diff
Fri, Oct 10, 12:51 AM
Unknown Object (File)
Thu, Oct 9, 2:10 AM
Unknown Object (File)
Thu, Oct 9, 1:33 AM
Unknown Object (File)
Thu, Oct 9, 12:25 AM
Subscribers

Details

Summary
nullfs: add nounp_bypass mount option

The option, when set, disables bypassing the unix socket vnode down
to the lower mp, effectively preventing connection to nullfs unix
socket from being acceptable from the lower mp (and vice versa).

This is done by providing a vop vector that stops bypass for unp-related
VOPs.  I believe that VFS_VOP_VECTOR_REGISTER() does the right thing
there regardless of the order of initialization.


nullfs_mount: use symbols instead of string literals for cache mount options


nullfs: add helper testing for vnode belonging to nullfs mount


fs/nullfs/null.h: put first definition after headers include

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Wed, Oct 8, 4:10 PM

This should be documented in mount_nullfs.8. The implementation looks ok to me.

The name sounds a bit strange to me. The mount_nullfs terminology explains what "bypass" means, but it's still a bit unclear IMO. What do you think about unix_private, nounix_private?

This should be documented in mount_nullfs.8. The implementation looks ok to me.

I will after the patch is finalized.

The name sounds a bit strange to me. The mount_nullfs terminology explains what "bypass" means, but it's still a bit unclear IMO. What do you think about unix_private, nounix_private?

For me, 'private' is worse. What exactly is the scope where the socket becomes private? People would think about jails or whatever namespace restriction they intend, but not the pass from upper to lower.
I can rename user-visible option to unixbypass e.g.

In D52983#1210842, @kib wrote:

This should be documented in mount_nullfs.8. The implementation looks ok to me.

I will after the patch is finalized.

The name sounds a bit strange to me. The mount_nullfs terminology explains what "bypass" means, but it's still a bit unclear IMO. What do you think about unix_private, nounix_private?

For me, 'private' is worse. What exactly is the scope where the socket becomes private? People would think about jails or whatever namespace restriction they intend, but not the pass from upper to lower.
I can rename user-visible option to unixbypass e.g.

unixbypass or unix_bypass is ok with me.

Rename the option to 'unixbypass'.
Add documentation.

sbin/mount_nullfs/mount_nullfs.8
102 ↗(On Diff #163872)
118 ↗(On Diff #163872)
119 ↗(On Diff #163872)
122 ↗(On Diff #163872)
124 ↗(On Diff #163872)
sys/fs/nullfs/null.h
42

Rename the flag and VOP vector as well, to keep things consistent?

kib marked 6 inline comments as done.Thu, Oct 9, 10:31 PM
kib added inline comments.
sys/fs/nullfs/null.h
42

Internally the VOPs are called VOP_UNP_something, so I am consistent I think.

kib marked an inline comment as done.Thu, Oct 9, 10:31 PM
kib added inline comments.
sys/fs/nullfs/null.h
42

I can change if you insist, but unp is the established name in the kernel sources.

kib retitled this revision from nullfs: add nounp_bypass mount option to nullfs: add nounixbypass mount option.
This revision is now accepted and ready to land.Thu, Oct 9, 10:43 PM