Files
kernel-tenderloin-3.0/fs
Jeff Layton dbbef3cbde nfs: fix regression in handling of context= option in NFSv4
commit 8a0d551a59ac92d8ff048d6cb29d3a02073e81e8 upstream.

Setting the security context of a NFSv4 mount via the context= mount
option is currently broken. The NFSv4 codepath allocates a parsed
options struct, and then parses the mount options to fill it. It
eventually calls nfs4_remote_mount which calls security_init_mnt_opts.
That clobbers the lsm_opts struct that was populated earlier. This bug
also looks like it causes a small memory leak on each v4 mount where
context= is used.

Fix this by moving the initialization of the lsm_opts into
nfs_alloc_parsed_mount_data. Also, add a destructor for
nfs_parsed_mount_data to make it easier to free all of the allocations
hanging off of it, and to ensure that the security_free_mnt_opts is
called whenever security_init_mnt_opts is.

I believe this regression was introduced quite some time ago, probably
by commit c02d7adf.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-25 17:24:36 -08:00
..
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-05-19 16:55:28 +09:30
2011-07-17 23:20:29 -04:00
2011-12-21 12:57:44 -08:00
2011-11-11 09:35:59 -08:00
2011-06-20 17:53:24 -05:00
2011-03-31 11:26:23 -03:00
2012-01-06 14:13:52 -08:00
2011-03-31 11:26:23 -03:00
2011-06-03 18:24:58 -04:00
2011-04-14 16:06:56 -07:00
2011-07-17 23:21:35 -04:00
2011-07-06 12:15:16 -07:00
2011-07-06 10:41:13 -07:00
2011-05-26 10:01:43 -06:00
2011-05-23 19:58:53 +02:00
2011-06-03 18:24:58 -04:00