diff options
| author | Petr Vandrovec <petr@vandrovec.name> | 2016-11-07 15:11:29 -0500 |
|---|---|---|
| committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2016-11-07 16:11:29 -0500 |
| commit | 8ef3295530ddc969ea9a3f307d94df97fcbc0629 (patch) | |
| tree | 3c0e59bf61c4776fa97364bd0a30e13a410fdd02 | |
| parent | bb29dd84333a96f309c6d0f88b285b5b78927058 (diff) | |
NFS: Ignore connections that have cl_rpcclient uninitialized
cl_rpcclient starts as ERR_PTR(-EINVAL), and connections like that
are floating freely through the system. Most places check whether
pointer is valid before dereferencing it, but newly added code
in nfs_match_client does not.
Which causes crashes when more than one NFS mount point is present.
Signed-off-by: Petr Vandrovec <petr@vandrovec.name>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
| -rw-r--r-- | fs/nfs/client.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 7555ba889d1f..ebecfb8fba06 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
| @@ -314,7 +314,8 @@ static struct nfs_client *nfs_match_client(const struct nfs_client_initdata *dat | |||
| 314 | /* Match the full socket address */ | 314 | /* Match the full socket address */ |
| 315 | if (!rpc_cmp_addr_port(sap, clap)) | 315 | if (!rpc_cmp_addr_port(sap, clap)) |
| 316 | /* Match all xprt_switch full socket addresses */ | 316 | /* Match all xprt_switch full socket addresses */ |
| 317 | if (!rpc_clnt_xprt_switch_has_addr(clp->cl_rpcclient, | 317 | if (IS_ERR(clp->cl_rpcclient) || |
| 318 | !rpc_clnt_xprt_switch_has_addr(clp->cl_rpcclient, | ||
| 318 | sap)) | 319 | sap)) |
| 319 | continue; | 320 | continue; |
| 320 | 321 | ||
