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mVhZCsweGQ4LzB4ZjANCj4gWzxmZmZmZmZmZmIwNDlmMjlmPl0gcmV0X2Zyb21fZm9yaysweDFm LzB4NDANCj4gWzxmZmZmZmZmZmFmY2EzYjQwPl0gPyBrdGhyZWFkX2NyZWF0ZV9vbl9ub2RlKzB4 MWUwLzB4MWUwDQo+IENvZGU6IDAwIDAxIDAwIDAwIGYwIDBmIGMxIDM3IDgxIGM2IDAwIDAxIDAw IDAwIDQwIDg0IGY2IDc1IDAxIGMzIDU1IDQ4IDg5IGU1IGU4IGUyIDE5IDgzIGZmIDVkIGMzIDBm IDFmIDQ0IDAwIDAwIDMxIGMwIGJhIDAxIDAwIDAwIDAwIDxmMD4gMGYgYjEgMTcgODUgYzAgNzUg MDEgYzMgNTUgODkgYzYgNDggODkgZTUgZTggYzAgMDEgODMgZmYgNjYgDQo+ICJSSVAgIFs8ZmZm ZmZmZmZiMDQ5ZWVmYz5dIF9yYXdfc3Bpbl9sb2NrKzB4Yy8weDMwDQo+IA0KPiDigJTigJTigJQN Cg0K -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
> On 31 Oct 2016, at 18:46, Trond Myklebust <trondmy@primarydata.com> wrote: > > >> On Oct 30, 2016, at 21:18, Vitaliy Gusev <gusev.vitaliy@gmail.com> wrote: >> >> Hi. >> >> During some tests I’ve seen nfs-client crashes. It was just reading file via NFSv4.1 protocol. >> >> The panic message is below, fixing patch is attached. > > Why does this need to be fixed on the client? It looks like a server bug… In any case, the fix you propose is going to leave the client with broken open state. Do you like to get crash every time a remote side sends improper datas? I believe not. I proposed just ignore the flag OPEN4_RESULT_CONFIRM for nfs4.1+ clients. RFC5661 has description that allows a client to do that: o OPEN4_RESULT_CONFIRM is deprecated and MUST NOT be returned by an NFSv4.1 server. ——— Thanks, Vitaliy Gusev -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
> On Oct 31, 2016, at 13:31, Vitaliy Gusev <gusev.vitaliy@gmail.com> wrote: > > >> On 31 Oct 2016, at 18:46, Trond Myklebust <trondmy@primarydata.com> wrote: >> >> >>> On Oct 30, 2016, at 21:18, Vitaliy Gusev <gusev.vitaliy@gmail.com> wrote: >>> >>> Hi. >>> >>> During some tests I’ve seen nfs-client crashes. It was just reading file via NFSv4.1 protocol. >>> >>> The panic message is below, fixing patch is attached. >> >> Why does this need to be fixed on the client? It looks like a server bug… In any case, the fix you propose is going to leave the client with broken open state. > > Do you like to get crash every time a remote side sends improper datas? I believe not. There are a million other ways to screw a client over if your server is buggy or compromised. > > I proposed just ignore the flag OPEN4_RESULT_CONFIRM for nfs4.1+ clients. > RFC5661 has description that allows a client to do that: > > o OPEN4_RESULT_CONFIRM is deprecated and MUST NOT be returned by an > NFSv4.1 server. I know what the spec says. The point is that the client will leak memory, and fail to handle the situation correctly when the server returns OPEN4_RESULT_CONFIRM with or with the patch that you are proposing. The right thing to do here would rather be to print out a big fat warning to the user, and then possibly also to kill the mount.
> On 31 Oct 2016, at 20:54, Trond Myklebust <trondmy@primarydata.com> wrote: > >> >> On Oct 31, 2016, at 13:31, Vitaliy Gusev <gusev.vitaliy@gmail.com> wrote: >> Do you like to get crash every time a remote side sends improper datas? I believe not. > > There are a million other ways to screw a client over if your server is buggy or compromised. I agree, but crashes are not right way to work with incorrect datas and that’s why I reported problem. >> >> I proposed just ignore the flag OPEN4_RESULT_CONFIRM for nfs4.1+ clients. >> RFC5661 has description that allows a client to do that: >> >> o OPEN4_RESULT_CONFIRM is deprecated and MUST NOT be returned by an >> NFSv4.1 server. > > I know what the spec says. The point is that the client will leak memory, and fail to handle the situation correctly when the server returns OPEN4_RESULT_CONFIRM with or with the patch that you are proposing. > The right thing to do here would rather be to print out a big fat warning to the user, and then possibly also to kill the mount. That’s a good point. What if return error for OPEN operation instead of kill the mount? ——— Thanks, Vitaliy Gusev --- Vitaliy Gusev -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index a9dec32..054ce67 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -2023,6 +2023,9 @@ static int _nfs4_proc_open_confirm(struct nfs4_opendata *data) }; int status; + if (server->nfs_client->cl_mvops->minor_version != 0) + return 0; + nfs4_init_sequence(&data->c_arg.seq_args, &data->c_res.seq_res, 1); kref_get(&data->kref); data->rpc_done = 0;