draft-ietf-nfsv4-umask-05.txt   rfc8275.txt 
NFSv4 J. Fields Internet Engineering Task Force (IETF) J. Fields
Internet-Draft A. Gruenbacher Request for Comments: 8275 A. Gruenbacher
Intended status: Standards Track Red Hat Category: Standards Track Red Hat
Expires: March 3, 2018 August 30, 2017 ISSN: 2070-1721 December 2017
Allowing Inheritable NFSv4 Access Control Entries to Override the Umask Allowing Inheritable NFSv4 Access Control Entries to Override the Umask
draft-ietf-nfsv4-umask-05
Abstract Abstract
In many environments, inheritable NFSv4 Access Control Entries (ACEs) In many environments, inheritable NFSv4 Access Control Entries (ACEs)
can be rendered ineffective by the application of the per-process can be rendered ineffective by the application of the per-process
umask. This can be addressed by transmitting the umask and create file mode creation mask (umask). This can be addressed by
mode as separate pieces of data, allowing the server to make more transmitting the umask and create mode as separate pieces of data,
intelligent decisions about the permissions to set on new files. allowing the server to make more intelligent decisions about the
This document proposes a protocol extension which accomplishes that. permissions to set on new files. This document proposes a protocol
extension to accomplish that.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This is an Internet Standards Track document.
provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months This document is a product of the Internet Engineering Task Force
and may be updated, replaced, or obsoleted by other documents at any (IETF). It represents the consensus of the IETF community. It has
time. It is inappropriate to use Internet-Drafts as reference received public review and has been approved for publication by the
material or to cite them other than as "work in progress." Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in Section 2 of RFC 7841.
This Internet-Draft will expire on March 3, 2018. Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
https://www.rfc-editor.org/info/rfc8275.
Copyright Notice Copyright Notice
Copyright (c) 2017 IETF Trust and the persons identified as the Copyright (c) 2017 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Conventions Used in This Document . . . . . . . . . . . . . . 2 1. Problem Statement . . . . . . . . . . . . . . . . . . . . . . 2
2. Problem Statement . . . . . . . . . . . . . . . . . . . . . . 2 2. Conventions Used in This Document . . . . . . . . . . . . . . 3
3. Protocol Extension Considerations . . . . . . . . . . . . . . 3 3. Protocol Extension Considerations . . . . . . . . . . . . . . 3
4. XDR Extraction . . . . . . . . . . . . . . . . . . . . . . . 3 4. XDR Extraction . . . . . . . . . . . . . . . . . . . . . . . 3
5. mode_umask Attribute . . . . . . . . . . . . . . . . . . . . 4 5. The mode_umask Attribute . . . . . . . . . . . . . . . . . . 4
6. Security Considerations . . . . . . . . . . . . . . . . . . . 5 6. Security Considerations . . . . . . . . . . . . . . . . . . . 5
7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5
8. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 5
8.1. Normative References . . . . . . . . . . . . . . . . . . 5 8.1. Normative References . . . . . . . . . . . . . . . . . . 5
8.2. Informative References . . . . . . . . . . . . . . . . . 6 8.2. Informative References . . . . . . . . . . . . . . . . . 6
Appendix A. Acknowledgments . . . . . . . . . . . . . . . . . . 6 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 7
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 6 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 7
1. Conventions Used in This Document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119].
2. Problem Statement 1. Problem Statement
On Unix-like systems, each process is associated with a file mode On Unix-like systems, each process is associated with a file mode
creation mask (umask), which specifies which permissions must be creation mask (umask). The umask specifies which permissions must be
turned off when creating new file system objects. turned off when creating new file system objects.
When applying the mode, section 6.4.1.1 of [RFC7530] recommends that When applying the mode, Section 6.4.1.1 of [RFC7530] recommends that
servers SHOULD restrict permissions granted to any user or group servers SHOULD restrict permissions granted to any user or group
named in the Access Control List (ACL) to be no more than the named in the Access Control List (ACL) to be no more than the
permissions granted by the MODE4_RGRP, MODE4_WGRP, and MODE4_XGRP permissions granted by the MODE4_RGRP, MODE4_WGRP, and MODE4_XGRP
bits. Servers aiming to provide clients with Unix-like chmod bits. Servers aiming to provide clients with Unix-like chmod
behavior may also be motivated by the same requirements in [SUSv4]. behavior may also be motivated by the same requirements in [SUSv4].
(See the discussion of additional and alternate access control (See the discussion of additional and alternate access control
mechanisms in section "4.4 File Permissions" of that document.) mechanisms in "File Permissions", Section 4.4 of [SUSv4].)
On many existing installations, all ordinary users by default use the On many existing installations, all ordinary users use the same
same effective group ID. To prevent granting all users full access effective group ID by default. To prevent granting all users full
to each other's files, such installations usually default to a umask access to each other's files, such installations usually default to a
with very restrictive permissions. As a result, inherited ACL umask with very restrictive permissions. As a result, inherited ACL
entries (inheritable ACEs) describing the permissions to be granted entries (inheritable ACEs) describing the permissions to be granted
to named users and groups are often ignored. This makes inheritable to named users and groups are often ignored. This makes inheritable
ACEs useless in some common cases. ACEs useless in some common cases.
Linux solves this problem on local filesystems by ignoring the umask Linux solves this problem on local file systems by ignoring the umask
in the case the parent of the newly-created file has inheritable whenever a newly created file inherits ACEs from its parent; see
ACEs; see [LinuxACL]. [LinuxACL].
The same solution should work for NFS. However, the NFSv4 protocol The same solution should work for NFS. However, the NFSv4 protocol
does not currently give the client a way to transmit the umask of the does not currently give the client a way to transmit the umask of the
process opening a file. And clients have no way of atomically process opening a file. And clients have no way of atomically
checking for inheritable permissions and applying the umask only when checking for inheritable permissions and applying the umask only when
necessary. As a result, the server receives an OPEN with a mode necessary. As a result, the server receives an OPEN with a mode
attribute that already has the umask applied. attribute that already has the umask applied.
This document solves the problem by defining a new attribute which This document solves the problem by defining a new attribute that
allows the client to transmit umask and the mode specified at file allows the client to transmit umask and the mode specified at file
creation separately, allowing the client to ignore the umask in the creation separately, allowing the client to ignore the umask in the
presence of inheritable ACEs. At least in the Linux case, this presence of inheritable ACEs. At least in the Linux case, this
allows NFSv4 to provide the same semantics available using local allows NFSv4 to provide the same semantics available using local
access. access.
2. Conventions Used in This Document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in
BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here.
3. Protocol Extension Considerations 3. Protocol Extension Considerations
This document presents an extension to minor version 2 of the NFSv4 This document presents an extension to minor version 2 of the NFSv4
protocol as described in [nfsv4-versioning]. It describes a new protocol as described in [RFC8178]. It describes a new OPTIONAL
OPTIONAL feature. NFSv4.2 servers and clients implemented without feature. NFSv4.2 servers and clients implemented without knowledge
knowledge of this extension will continue to interoperate with of this extension will continue to interoperate with clients and
clients and servers that are aware of the extension (whether they servers that are aware of the extension (whether or not they support
support it or not). it).
Note that [RFC7862] does not define NFSv4.2 as non-extensible, so Note that [RFC7862] does not define NFSv4.2 as non-extensible, so
that it is considered by [nfsv4-versioning] to be an extensible minor [RFC8178] treats it as an extensible minor version. This Standards
version. As a result, upon publication of this document as a Track RFC extends NFSv4.2 but does not update [RFC7862] or [RFC7863].
Proposed Standard, the extension described herein will effectively be
part of NFSv4.2, even though this document does not update [RFC7862]
or [RFC7863].
4. XDR Extraction 4. XDR Extraction
The additional lines of external data representation (XDR) [RFC4506] The additional lines of External Data Representation (XDR) [RFC4506]
description embedded in this document can be extracted by feeding description embedded in this document can be extracted by feeding
this document into the following shell script: this document into the following shell script:
<CODE BEGINS> <CODE BEGINS>
#!/bin/sh #!/bin/sh
grep '^ *///' $* | sed 's?^ */// ??' | sed 's?^ *///$??' grep '^ *///' $* | sed 's?^ */// ??' | sed 's?^ *///$??'
<CODE ENDS> <CODE ENDS>
That is, if the above script is stored in a file called "extract.sh", That is, if the above script is stored in a file called "extract.sh",
and this document is in a file called "umask.txt", then the reader and this document is in a file called "umask.txt", then the reader
can do: can do:
sh extract.sh < umask.txt > umask.x sh extract.sh < umask.txt > umask.x
The effect of the script is to remove leading white space from each The effect of the script is to remove leading white space from each
line, plus a sentinel sequence of "///". line, plus a sentinel sequence of "///".
Once that extraction is done, these added lines need to be inserted Once that extraction is done, these added lines need to be inserted
into an appropiate base XDR of the generated XDR from [RFC7863], into an appropriate base XDR of the generated XDR from [RFC7863]
together with XDR from any additional extensions to be recognized by together with XDR from any additional extensions to be recognized by
the implementation. This will result in a ready-to-compile XDR file. the implementation. This will result in a ready-to-compile XDR file.
5. mode_umask Attribute 5. The mode_umask Attribute
<CODE BEGINS> <CODE BEGINS>
/// struct mode_umask4 { /// struct mode_umask4 {
/// mode4 mu_mode; /// mode4 mu_mode;
/// mode4 mu_umask; /// mode4 mu_umask;
/// }; /// };
/// ///
/// %/* /// %/*
/// % * New For UMASK /// % * New For UMASK
skipping to change at page 5, line 10 skipping to change at page 5, line 7
The mode_umask attribute is only meaningful for operations that The mode_umask attribute is only meaningful for operations that
create objects (CREATE and OPEN); in other operations that take create objects (CREATE and OPEN); in other operations that take
fattr4 arguments, the server MUST reject it with NFS4ERR_INVAL. fattr4 arguments, the server MUST reject it with NFS4ERR_INVAL.
The server MUST return NFS4ERR_INVAL if the client attempts to set The server MUST return NFS4ERR_INVAL if the client attempts to set
both mode and mode_umask in the same operation. both mode and mode_umask in the same operation.
When the server supports the mode_umask attribute, a client creating When the server supports the mode_umask attribute, a client creating
a file should use mode_umask in place of mode, with mu_mode set to a file should use mode_umask in place of mode, with mu_mode set to
the unmodified mode provided by the user, and mu_umask set to the the unmodified mode provided by the user and mu_umask set to the
umask of the requesting process. umask of the requesting process.
The server then uses mode_umask as follows: The server then uses mode_umask as follows:
o On a server that supports ACL attributes, if an object inherits o On a server that supports ACL attributes, if an object inherits
any ACEs from its parent directory, mu_mode SHOULD be used, and any ACEs from its parent directory, mu_mode SHOULD be used and
mu_umask ignored. mu_umask ignored.
o Otherwise, mu_umask MUST be used to limit the mode: all bits in o Otherwise, mu_umask MUST be used to limit the mode: all bits in
the mode MUST be turned off which are set in the umask; the mode the mode that are set in the unmask MUST be turned off; the mode
assigned to the new object becomes (mu_mode & ~mu_umask) instead. assigned to the new object becomes (mu_mode & ~mu_umask) instead.
6. Security Considerations 6. Security Considerations
The mode_umask attribute shifts to the server the decision about when The mode_umask attribute shifts to the server the decision about when
to apply the umask. Because the server MUST apply the umask if there to apply the umask. Because the server MUST apply the umask if there
are no inheritable permissions, the traditional semantics are are no inheritable permissions, the traditional semantics are
preserved in the absence of a permission inheritance mechanism. The preserved in the absence of a permission inheritance mechanism. The
only relaxation of permissions comes in the case servers follow the only relaxation of permissions comes in the case in which servers
recommendation that they ignore the umask in the presence of follow the recommendation that they ignore the umask in the presence
inheritable permissions. of inheritable permissions.
The practice of ignoring the umask when there are inheritable The practice of ignoring the umask when there are inheritable
permissions in the form of a "POSIX" default ACL is of long standing permissions in the form of a "POSIX" default ACL is of long standing
and has not given rise to security issues. The "POSIX" default ACL and has not given rise to security issues. The "POSIX" default ACL
mechanism and the mechanism for permission inheritance in NFSv4 are mechanism and the mechanism for permission inheritance in NFSv4 are
equivalent from a security perspective. equivalent from a security perspective.
7. IANA Considerations 7. IANA Considerations
This document does not require any actions by IANA. This document does not require any IANA actions.
8. References 8. References
8.1. Normative References 8.1. Normative References
[nfsv4-versioning]
Noveck, D., "Rules for NFSv4 Extensions and Minor
Versions", draft-ietf-nfsv4-versioning-08 (work in
progress), December 2016.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", March 1997. Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>.
[RFC4506] Eisler, M., "XDR: External Data Representation Standard", [RFC4506] Eisler, M., Ed., "XDR: External Data Representation
STD 67, RFC 4506, May 2006. Standard", STD 67, RFC 4506, DOI 10.17487/RFC4506, May
2006, <https://www.rfc-editor.org/info/rfc4506>.
[RFC7530] Haynes, T. and D. Noveck, "Network File System (NFS) [RFC7530] Haynes, T., Ed. and D. Noveck, Ed., "Network File System
version 4 Protocol", RFC 7530, March 2015. (NFS) Version 4 Protocol", RFC 7530, DOI 10.17487/RFC7530,
March 2015, <https://www.rfc-editor.org/info/rfc7530>.
[RFC7862] Haynes, T., "Network File System (NFS) Version 4 Minor [RFC7862] Haynes, T., "Network File System (NFS) Version 4 Minor
Version 2 Protocol", RFC 7862, November 2016. Version 2 Protocol", RFC 7862, DOI 10.17487/RFC7862,
November 2016, <https://www.rfc-editor.org/info/rfc7862>.
[RFC7863] Haynes, T., "Network File System (NFS) Version 4 Minor [RFC7863] Haynes, T., "Network File System (NFS) Version 4 Minor
Version 2 External Data Representation Standard (XDR) Version 2 External Data Representation Standard (XDR)
Description", RFC 7863, November 2016. Description", RFC 7863, DOI 10.17487/RFC7863, November
2016, <https://www.rfc-editor.org/info/rfc7863>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[RFC8178] Noveck, D., "Rules for NFSv4 Extensions and Minor
Versions", RFC 8178, DOI 10.17487/RFC8178, July 2017,
<https://www.rfc-editor.org/info/rfc8178>.
8.2. Informative References 8.2. Informative References
[LinuxACL] [LinuxACL] Gruenbacher, A., "ACL(5) - Access Control Lists", Linux
Gruenbacher, A., "ACL(5) - Access Control Lists", Linux man pages online, ACL(5), March 2002,
man pages ACL(5), March 2002, <http://kernel.org/doc/man- <http://kernel.org/doc/man-pages/online/pages/man5/
pages/online/pages/man5/acl.5.html>. acl.5.html>.
[SUSv4] The Open Group, "Single UNIX Specification Version 4", [SUSv4] The Open Group, "Single UNIX Specification, Version 4",
2013. 2013.
Appendix A. Acknowledgments Acknowledgments
Thanks to Trond Myklebust and Dave Noveck for the suggestion to Thanks to Trond Myklebust and Dave Noveck for their review and the
define this as a (mode, umask) pair rather than just umask. Thanks suggestion to define this as a (mode, umask) pair rather than just
for review to them and to Warren Kumari, Adam Roach, Spencer Dawkins, umask. Thanks to Warren Kumari, Adam Roach, Spencer Dawkins, Mike
Mike Kupfer, and Thomas Haynes for review, and to Thomas Haynes for Kupfer, and Thomas Haynes for their review and to Thomas Haynes for
XDR help. help with XDR.
Authors' Addresses Authors' Addresses
J. Bruce Fields J. Bruce Fields
Red Hat, Inc. Red Hat, Inc.
Email: bfields@redhat.com Email: bfields@redhat.com
Andreas Gruenbacher Andreas Gruenbacher
Red Hat, Inc. Red Hat, Inc.
 End of changes. 40 change blocks. 
89 lines changed or deleted 94 lines changed or added

This html diff was produced by rfcdiff 1.46. The latest version is available from http://tools.ietf.org/tools/rfcdiff/