]> git.baikalelectronics.ru Git - kernel.git/commit
nfs_remount(): don't leak, don't ignore LSM options quietly
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 10 Dec 2018 22:30:41 +0000 (17:30 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 21 Dec 2018 16:47:19 +0000 (11:47 -0500)
commitefb3c95659559498fda14b9e347157fb479756ec
tree1949ceff7d2c7d417d8927420bb3b966e6d9cdbf
parent037a5a7394a1da3eba049782751c10e775587a76
nfs_remount(): don't leak, don't ignore LSM options quietly

* if mount(2) passes something like "context=foo" with MS_REMOUNT
in flags (/sbin/mount.nfs will _not_ do that - you need to issue
the syscall manually), you'll get leaked copies for LSM options.
The reason is that instead of nfs_{alloc,free}_parsed_mount_data()
nfs_remount() uses kzalloc/kfree, which lacks the needed cleanup.

* selinux options are not changed on remount (as for any other
fs), but in case of NFS the failure is quiet - they are not compared
to what we used to have, with complaint in case of attempted changes.
Trivially fixed by converting to use of security_sb_remount().

Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/nfs/super.c