mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-24 19:40:21 +09:00
NFS: populate ->net in mount data when remounting
commit a914722f33 upstream.
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 <mguzik@redhat.com>
Cc: linux-nfs@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
This commit is contained in:
committed by
Kamal Mostafa
parent
113b135ebf
commit
e6468e9aa0
@@ -2167,6 +2167,7 @@ nfs_remount(struct super_block *sb, int *flags, char *raw_data)
|
||||
data->timeo = 10U * nfss->client->cl_timeout->to_initval / HZ;
|
||||
data->nfs_server.port = nfss->port;
|
||||
data->nfs_server.addrlen = nfss->nfs_client->cl_addrlen;
|
||||
data->net = current->nsproxy->net_ns;
|
||||
memcpy(&data->nfs_server.address, &nfss->nfs_client->cl_addr,
|
||||
data->nfs_server.addrlen);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user