Skip to content

Commit

Permalink
NFS: populate ->net in mount data when remounting
Browse files Browse the repository at this point in the history
Otherwise the kernel oopses when remounting with IPv6 server because
net is dereferenced in dev_get_by_name.

Use net ns of current thread so that dev_get_by_name does not operate on
foreign ns. Changing the address is prohibited anyway so this should not
affect anything.

Signed-off-by: Mateusz Guzik <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected] # 3.4+
Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
Mateusz Guzik authored and trondmypd committed Jun 10, 2014
1 parent c5e20cb commit a914722
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/nfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -2260,6 +2260,7 @@ nfs_remount(struct super_block *sb, int *flags, char *raw_data)
data->nfs_server.addrlen = nfss->nfs_client->cl_addrlen;
data->version = nfsvers;
data->minorversion = nfss->nfs_client->cl_minorversion;
data->net = current->nsproxy->net_ns;
memcpy(&data->nfs_server.address, &nfss->nfs_client->cl_addr,
data->nfs_server.addrlen);

Expand Down

0 comments on commit a914722

Please sign in to comment.