Skip to contentSkip to conversation

maintainership question about nfs-utils/util/mount

DISCUSSION Chuck Lever 2 participants 3 messages Jul 6, 2007 – Jul 16, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

I'm looking at nfs-utils/utils/mount in order to patch in support for passing a string of mount options to the kernel instead of an nfs_mount_data.

In mount.c, main() invokes nfsmount() in nfsmount.c. nfsmount() defines a structure on the stack called "data", then returns a pointer to "data" which is then passed to the kernel by main().

I think the only way this continues to work is that there are three 1024 character buffers defined in nfsmount()'s stack frame before "data," which places "data" far enough up the stack that subsequent function calls in main() don't smash it.

Although this doesn't cause bad behavior today, it needs to be fixed to prevent future changes from breaking things badly.

Also found an interesting error message in here:

permission died - no match for fstab

Should probably be "permission denied". I'm not really sure what "no match for fstab" means, but looking at the context, this message appears if a non-root user tries to mount something that isn't already listed in /etc/fstab.

What's the current blessed procedure for sending patches and fixes for this particular code? Mail to [email protected] (last touch rule, and author of mount.c) is rejected.

begin:vcard
fn:Chuck Lever
n:Lever;Chuck
org:Oracle Corporation;Corporate Architecture: Linux Projects Group adr:;;1015 Granger Avenue;Ann Arbor;MI;48104;USA email;internet:chuck dot lever at nospam oracle dot com title:Principal Member of Staff
tel;work:+1 248 614 5091
x-mozilla-html:FALSE
version:2.1
end:vcard

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#1 lore raw
Quoted 8 lines · On Fri, 06 Jul 2007 16:13:23 -0400 Chuck Lever <[email protected]> wrote:

I'm looking at nfs-utils/utils/mount in order to patch in support for passing a string of mount options to the kernel instead of an nfs_mount_data.

In mount.c, main() invokes nfsmount() in nfsmount.c. nfsmount() defines a structure on the stack called "data", then returns a pointer to "data" which is then passed to the kernel by main().

Quoted 8 lines

I think the only way this continues to work is that there are three 1024 character buffers defined in nfsmount()'s stack frame before "data," which places "data" far enough up the stack that subsequent function calls in main() don't smash it.

Although this doesn't cause bad behavior today, it needs to be fixed to prevent future changes from breaking things badly.

In the git tree I'm looking at, "data" is declared static. Does that protect it from getting smashed?

Quoted 13 lines

Also found an interesting error message in here:

permission died - no match for fstab

Should probably be "permission denied". I'm not really sure what "no match for fstab" means, but looking at the context, this message appears if a non-root user tries to mount something that isn't already listed in /etc/fstab.

What's the current blessed procedure for sending patches and fixes for this particular code? Mail to [email protected] (last touch rule, and author of mount.c) is rejected.

Signature · 10 lines
Jeff Layton <[email protected]>

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist  -  [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
#2 lore raw
Quoted 7 lines · Jeff Layton
Quoted 4 lines · On Fri, 06 Jul 2007 16:13:23 -0400 Chuck Lever <[email protected]> wrote:

I'm looking at nfs-utils/utils/mount in order to patch in support for passing a string of mount options to the kernel instead of an nfs_mount_data.

In mount.c, main() invokes nfsmount() in nfsmount.c. nfsmount() defines a structure on the stack called "data", then returns a pointer to "data" which is then passed to the kernel by main().

Quoted 7 lines
Quoted 4 lines

I think the only way this continues to work is that there are three 1024 character buffers defined in nfsmount()'s stack frame before "data," which places "data" far enough up the stack that subsequent function calls in main() don't smash it.

Although this doesn't cause bad behavior today, it needs to be fixed to prevent future changes from breaking things badly.

In the git tree I'm looking at, "data" is declared static. Does that protect it from getting smashed?

Yes. For some reason, I missed that entirely the first time I looked at it. Notice that nfs4_mount_data is also declared static in nfs4mount.c.

begin:vcard
fn:Chuck Lever
n:Lever;Chuck
org:Oracle Corporation;Corporate Architecture: Linux Projects Group adr:;;1015 Granger Avenue;Ann Arbor;MI;48104;USA title:Principal Member of Staff
tel;work:+1 248 614 5091
x-mozilla-html:FALSE
url:http://oss.oracle.com/~cel
version:2.1
end:vcard

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs