Commit 529af905 authored by Scott Mayhew's avatar Scott Mayhew Committed by Trond Myklebust

NFS: Fix a few constant_table array definitions

nfs_vers_tokens, nfs_xprt_protocol_tokens, and nfs_secflavor_tokens were
all missing an empty item at the end of the array, allowing
lookup_constant() to potentially walk off the end and trigger and oops.
Reported-by: default avatarOlga Kornievskaia <aglo@umich.edu>
Signed-off-by: default avatarScott Mayhew <smayhew@redhat.com>
Fixes: e38bb238 ("NFS: Convert mount option parsing to use functionality from fs_parser.h")
Cc: stable@vger.kernel.org # v5.6
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent ed5d588f
...@@ -190,6 +190,7 @@ static const struct constant_table nfs_vers_tokens[] = { ...@@ -190,6 +190,7 @@ static const struct constant_table nfs_vers_tokens[] = {
{ "4.0", Opt_vers_4_0 }, { "4.0", Opt_vers_4_0 },
{ "4.1", Opt_vers_4_1 }, { "4.1", Opt_vers_4_1 },
{ "4.2", Opt_vers_4_2 }, { "4.2", Opt_vers_4_2 },
{}
}; };
enum { enum {
...@@ -202,13 +203,14 @@ enum { ...@@ -202,13 +203,14 @@ enum {
nr__Opt_xprt nr__Opt_xprt
}; };
static const struct constant_table nfs_xprt_protocol_tokens[nr__Opt_xprt] = { static const struct constant_table nfs_xprt_protocol_tokens[] = {
{ "rdma", Opt_xprt_rdma }, { "rdma", Opt_xprt_rdma },
{ "rdma6", Opt_xprt_rdma6 }, { "rdma6", Opt_xprt_rdma6 },
{ "tcp", Opt_xprt_tcp }, { "tcp", Opt_xprt_tcp },
{ "tcp6", Opt_xprt_tcp6 }, { "tcp6", Opt_xprt_tcp6 },
{ "udp", Opt_xprt_udp }, { "udp", Opt_xprt_udp },
{ "udp6", Opt_xprt_udp6 }, { "udp6", Opt_xprt_udp6 },
{}
}; };
enum { enum {
...@@ -239,6 +241,7 @@ static const struct constant_table nfs_secflavor_tokens[] = { ...@@ -239,6 +241,7 @@ static const struct constant_table nfs_secflavor_tokens[] = {
{ "spkm3i", Opt_sec_spkmi }, { "spkm3i", Opt_sec_spkmi },
{ "spkm3p", Opt_sec_spkmp }, { "spkm3p", Opt_sec_spkmp },
{ "sys", Opt_sec_sys }, { "sys", Opt_sec_sys },
{}
}; };
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment