1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389
|
<pre>Internet Engineering Task Force (IETF) J. Fields
Request for Comments: 8275 A. Gruenbacher
Category: Standards Track Red Hat
ISSN: 2070-1721 December 2017
Allowing Inheritable NFSv4 Access Control Entries to Override the Umask
Abstract
In many environments, inheritable NFSv4 Access Control Entries (ACEs)
can be rendered ineffective by the application of the per-process
file mode creation mask (umask). This can be addressed by
transmitting the umask and create mode as separate pieces of data,
allowing the server to make more intelligent decisions about the
permissions to set on new files. This document proposes a protocol
extension to accomplish that.
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in <a href="./rfc7841#section-2">Section 2 of RFC 7841</a>.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
<a href="https://www.rfc-editor.org/info/rfc8275">https://www.rfc-editor.org/info/rfc8275</a>.
Copyright Notice
Copyright (c) 2017 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
Provisions Relating to IETF Documents
(<a href="https://trustee.ietf.org/license-info">https://trustee.ietf.org/license-info</a>) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
<span class="grey">Fields & Gruenbacher Standards Track [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc8275">RFC 8275</a> NFSv4 Umask December 2017</span>
Table of Contents
<a href="#section-1">1</a>. Problem Statement . . . . . . . . . . . . . . . . . . . . . . <a href="#page-2">2</a>
<a href="#section-2">2</a>. Conventions Used in This Document . . . . . . . . . . . . . . <a href="#page-3">3</a>
<a href="#section-3">3</a>. Protocol Extension Considerations . . . . . . . . . . . . . . <a href="#page-3">3</a>
<a href="#section-4">4</a>. XDR Extraction . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-3">3</a>
<a href="#section-5">5</a>. The mode_umask Attribute . . . . . . . . . . . . . . . . . . <a href="#page-4">4</a>
<a href="#section-6">6</a>. Security Considerations . . . . . . . . . . . . . . . . . . . <a href="#page-5">5</a>
<a href="#section-7">7</a>. IANA Considerations . . . . . . . . . . . . . . . . . . . . . <a href="#page-5">5</a>
<a href="#section-8">8</a>. References . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-5">5</a>
<a href="#section-8.1">8.1</a>. Normative References . . . . . . . . . . . . . . . . . . <a href="#page-5">5</a>
<a href="#section-8.2">8.2</a>. Informative References . . . . . . . . . . . . . . . . . <a href="#page-6">6</a>
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-7">7</a>
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-7">7</a>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Problem Statement</span>
On Unix-like systems, each process is associated with a file mode
creation mask (umask). The umask specifies which permissions must be
turned off when creating new file system objects.
When applying the mode, <a href="./rfc7530#section-6.4.1.1">Section 6.4.1.1 of [RFC7530]</a> recommends that
servers SHOULD restrict permissions granted to any user or group
named in the Access Control List (ACL) to be no more than the
permissions granted by the MODE4_RGRP, MODE4_WGRP, and MODE4_XGRP
bits. Servers aiming to provide clients with Unix-like chmod
behavior may also be motivated by the same requirements in [<a href="#ref-SUSv4" title=""Single UNIX Specification, Version 4"">SUSv4</a>].
(See the discussion of additional and alternate access control
mechanisms in "File Permissions", Section 4.4 of [<a href="#ref-SUSv4" title=""Single UNIX Specification, Version 4"">SUSv4</a>].)
On many existing installations, all ordinary users use the same
effective group ID by default. To prevent granting all users full
access to each other's files, such installations usually default to a
umask with very restrictive permissions. As a result, inherited ACL
entries (inheritable ACEs) describing the permissions to be granted
to named users and groups are often ignored. This makes inheritable
ACEs useless in some common cases.
Linux solves this problem on local file systems by ignoring the umask
whenever a newly created file inherits ACEs from its parent; see
[<a href="#ref-LinuxACL" title=""ACL(5) - Access Control Lists"">LinuxACL</a>].
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
process opening a file. And clients have no way of atomically
checking for inheritable permissions and applying the umask only when
necessary. As a result, the server receives an OPEN with a mode
attribute that already has the umask applied.
<span class="grey">Fields & Gruenbacher Standards Track [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc8275">RFC 8275</a> NFSv4 Umask December 2017</span>
This document solves the problem by defining a new attribute that
allows the client to transmit umask and the mode specified at file
creation separately, allowing the client to ignore the umask in the
presence of inheritable ACEs. At least in the Linux case, this
allows NFSv4 to provide the same semantics available using local
access.
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Conventions Used in This Document</span>
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
<a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a> [<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>] [<a href="./rfc8174" title=""Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words"">RFC8174</a>] when, and only when, they appear in all
capitals, as shown here.
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Protocol Extension Considerations</span>
This document presents an extension to minor version 2 of the NFSv4
protocol as described in [<a href="./rfc8178" title=""Rules for NFSv4 Extensions and Minor Versions"">RFC8178</a>]. It describes a new OPTIONAL
feature. NFSv4.2 servers and clients implemented without knowledge
of this extension will continue to interoperate with clients and
servers that are aware of the extension (whether or not they support
it).
Note that [<a href="./rfc7862" title=""Network File System (NFS) Version 4 Minor Version 2 Protocol"">RFC7862</a>] does not define NFSv4.2 as non-extensible, so
[<a href="./rfc8178" title=""Rules for NFSv4 Extensions and Minor Versions"">RFC8178</a>] treats it as an extensible minor version. This Standards
Track RFC extends NFSv4.2 but does not update [<a href="./rfc7862" title=""Network File System (NFS) Version 4 Minor Version 2 Protocol"">RFC7862</a>] or [<a href="./rfc7863" title=""Network File System (NFS) Version 4 Minor Version 2 External Data Representation Standard (XDR) Description"">RFC7863</a>].
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. XDR Extraction</span>
The additional lines of External Data Representation (XDR) [<a href="./rfc4506" title=""XDR: External Data Representation Standard"">RFC4506</a>]
description embedded in this document can be extracted by feeding
this document into the following shell script:
<CODE BEGINS>
#!/bin/sh
grep '^ *///' $* | sed 's?^ */// ??' | sed 's?^ *///$??'
<CODE ENDS>
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
can do:
sh extract.sh < umask.txt > umask.x
<span class="grey">Fields & Gruenbacher Standards Track [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc8275">RFC 8275</a> NFSv4 Umask December 2017</span>
The effect of the script is to remove leading white space from each
line, plus a sentinel sequence of "///".
Once that extraction is done, these added lines need to be inserted
into an appropriate base XDR of the generated XDR from [<a href="./rfc7863" title=""Network File System (NFS) Version 4 Minor Version 2 External Data Representation Standard (XDR) Description"">RFC7863</a>]
together with XDR from any additional extensions to be recognized by
the implementation. This will result in a ready-to-compile XDR file.
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. The mode_umask Attribute</span>
<CODE BEGINS>
/// struct mode_umask4 {
/// mode4 mu_mode;
/// mode4 mu_umask;
/// };
///
/// %/*
/// % * New For UMASK
/// % */
/// const FATTR4_MODE_UMASK = 81;
<CODE ENDS>
+------------+----+-------------+-----+------------+
| Name | Id | Data Type | Acc | Defined in |
+------------+----+-------------+-----+------------+
| mode_umask | 81 | mode_umask4 | W | <a href="#section-5">Section 5</a> |
+------------+----+-------------+-----+------------+
Table 1
The NFSv4.2 mode_umask attribute is based on the umask and on the
mode bits specified at open time, which together determine the mode
of a newly created UNIX file. Only the nine low-order mode4 bits of
mu_umask are defined. A server MUST return NFS4ERR_INVAL if bits
other than those nine are set.
The mode_umask attribute is only meaningful for operations that
create objects (CREATE and OPEN); in other operations that take
fattr4 arguments, the server MUST reject it with NFS4ERR_INVAL.
The server MUST return NFS4ERR_INVAL if the client attempts to set
both mode and mode_umask in the same operation.
<span class="grey">Fields & Gruenbacher Standards Track [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc8275">RFC 8275</a> NFSv4 Umask December 2017</span>
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
the unmodified mode provided by the user and mu_umask set to the
umask of the requesting process.
The server then uses mode_umask as follows:
o On a server that supports ACL attributes, if an object inherits
any ACEs from its parent directory, mu_mode SHOULD be used and
mu_umask ignored.
o Otherwise, mu_umask MUST be used to limit the mode: all bits in
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.
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. Security Considerations</span>
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
are no inheritable permissions, the traditional semantics are
preserved in the absence of a permission inheritance mechanism. The
only relaxation of permissions comes in the case in which servers
follow the recommendation that they ignore the umask in the presence
of inheritable permissions.
The practice of ignoring the umask when there are inheritable
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
mechanism and the mechanism for permission inheritance in NFSv4 are
equivalent from a security perspective.
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. IANA Considerations</span>
This document does not require any IANA actions.
<span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. References</span>
<span class="h3"><a class="selflink" id="section-8.1" href="#section-8.1">8.1</a>. Normative References</span>
[<a id="ref-RFC2119">RFC2119</a>] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>,
DOI 10.17487/RFC2119, March 1997,
<<a href="https://www.rfc-editor.org/info/rfc2119">https://www.rfc-editor.org/info/rfc2119</a>>.
[<a id="ref-RFC4506">RFC4506</a>] Eisler, M., Ed., "XDR: External Data Representation
Standard", STD 67, <a href="./rfc4506">RFC 4506</a>, DOI 10.17487/RFC4506, May
2006, <<a href="https://www.rfc-editor.org/info/rfc4506">https://www.rfc-editor.org/info/rfc4506</a>>.
<span class="grey">Fields & Gruenbacher Standards Track [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc8275">RFC 8275</a> NFSv4 Umask December 2017</span>
[<a id="ref-RFC7530">RFC7530</a>] Haynes, T., Ed. and D. Noveck, Ed., "Network File System
(NFS) Version 4 Protocol", <a href="./rfc7530">RFC 7530</a>, DOI 10.17487/RFC7530,
March 2015, <<a href="https://www.rfc-editor.org/info/rfc7530">https://www.rfc-editor.org/info/rfc7530</a>>.
[<a id="ref-RFC7862">RFC7862</a>] Haynes, T., "Network File System (NFS) Version 4 Minor
Version 2 Protocol", <a href="./rfc7862">RFC 7862</a>, DOI 10.17487/RFC7862,
November 2016, <<a href="https://www.rfc-editor.org/info/rfc7862">https://www.rfc-editor.org/info/rfc7862</a>>.
[<a id="ref-RFC7863">RFC7863</a>] Haynes, T., "Network File System (NFS) Version 4 Minor
Version 2 External Data Representation Standard (XDR)
Description", <a href="./rfc7863">RFC 7863</a>, DOI 10.17487/RFC7863, November
2016, <<a href="https://www.rfc-editor.org/info/rfc7863">https://www.rfc-editor.org/info/rfc7863</a>>.
[<a id="ref-RFC8174">RFC8174</a>] Leiba, B., "Ambiguity of Uppercase vs Lowercase in <a href="./rfc2119">RFC</a>
<a href="./rfc2119">2119</a> Key Words", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc8174">RFC 8174</a>, DOI 10.17487/RFC8174,
May 2017, <<a href="https://www.rfc-editor.org/info/rfc8174">https://www.rfc-editor.org/info/rfc8174</a>>.
[<a id="ref-RFC8178">RFC8178</a>] Noveck, D., "Rules for NFSv4 Extensions and Minor
Versions", <a href="./rfc8178">RFC 8178</a>, DOI 10.17487/RFC8178, July 2017,
<<a href="https://www.rfc-editor.org/info/rfc8178">https://www.rfc-editor.org/info/rfc8178</a>>.
<span class="h3"><a class="selflink" id="section-8.2" href="#section-8.2">8.2</a>. Informative References</span>
[<a id="ref-LinuxACL">LinuxACL</a>] Gruenbacher, A., "ACL(5) - Access Control Lists", Linux
man pages online, ACL(5), March 2002,
<<a href="http://kernel.org/doc/man-pages/online/pages/man5/acl.5.html">http://kernel.org/doc/man-pages/online/pages/man5/</a>
<a href="http://kernel.org/doc/man-pages/online/pages/man5/acl.5.html">acl.5.html</a>>.
[<a id="ref-SUSv4">SUSv4</a>] The Open Group, "Single UNIX Specification, Version 4",
2013.
<span class="grey">Fields & Gruenbacher Standards Track [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc8275">RFC 8275</a> NFSv4 Umask December 2017</span>
Acknowledgments
Thanks to Trond Myklebust and Dave Noveck for their review and the
suggestion to define this as a (mode, umask) pair rather than just
umask. Thanks to Warren Kumari, Adam Roach, Spencer Dawkins, Mike
Kupfer, and Thomas Haynes for their review and to Thomas Haynes for
help with XDR.
Authors' Addresses
J. Bruce Fields
Red Hat, Inc.
Email: bfields@redhat.com
Andreas Gruenbacher
Red Hat, Inc.
Email: agruenba@redhat.com
Fields & Gruenbacher Standards Track [Page 7]
</pre>
|