nfsd: apply umask on fs without ACL support
authorJ. Bruce Fields <bfields@redhat.com>
Tue, 16 Jun 2020 20:43:18 +0000 (16:43 -0400)
committerSalvatore Bonaccorso <carnil@debian.org>
Wed, 24 Jun 2020 18:56:57 +0000 (19:56 +0100)
commitfafa71fd19969fe45495a3c6b76e59fc5ea00772
treec2f699a8c29e259727dbb3017c38ca37f511b8f4
parente75fd7bd98f1f6618f3eaaf8f8b590a037db2e15
nfsd: apply umask on fs without ACL support

Origin: http://git.linux-nfs.org/?p=bfields/linux.git;a=commit;h=22cf8419f1319ff87ec759d0ebdff4cbafaee832
Bug-Debian: https://bugs.debian.org/962254

The server is failing to apply the umask when creating new objects on
filesystems without ACL support.

To reproduce this, you need to use NFSv4.2 and a client and server
recent enough to support umask, and you need to export a filesystem that
lacks ACL support (for example, ext4 with the "noacl" mount option).

Filesystems with ACL support are expected to take care of the umask
themselves (usually by calling posix_acl_create).

For filesystems without ACL support, this is up to the caller of
vfs_create(), vfs_mknod(), or vfs_mkdir().

Reported-by: Elliott Mitchell <ehem+debian@m5p.com>
Reported-by: Salvatore Bonaccorso <carnil@debian.org>
Tested-by: Salvatore Bonaccorso <carnil@debian.org>
Fixes: 47057abde515 ("nfsd: add support for the umask attribute")
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name nfsd-apply-umask-on-fs-without-ACL-support.patch
fs/nfsd/vfs.c