aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/fs_context.c
diff options
context:
space:
mode:
authorScott Mayhew <smayhew@redhat.com>2020-04-02 17:20:44 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2020-04-02 18:37:13 -0400
commit529af90576cfa44aa107e9876e2ebaa053983986 (patch)
treeeeb5341e351a85d9664e3bb3ffedd0e58bc0e612 /fs/nfs/fs_context.c
parentNFS: Try to join page groups before an O_DIRECT retransmission (diff)
downloadlinux-dev-529af90576cfa44aa107e9876e2ebaa053983986.tar.xz
linux-dev-529af90576cfa44aa107e9876e2ebaa053983986.zip
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: Olga Kornievskaia <aglo@umich.edu> Signed-off-by: Scott Mayhew <smayhew@redhat.com> Fixes: e38bb238ed8c ("NFS: Convert mount option parsing to use functionality from fs_parser.h") Cc: stable@vger.kernel.org # v5.6 Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/fs_context.c')
-rw-r--r--fs/nfs/fs_context.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/nfs/fs_context.c b/fs/nfs/fs_context.c
index 566dd59570e6..ccc88be88d6a 100644
--- a/fs/nfs/fs_context.c
+++ b/fs/nfs/fs_context.c
@@ -190,6 +190,7 @@ static const struct constant_table nfs_vers_tokens[] = {
{ "4.0", Opt_vers_4_0 },
{ "4.1", Opt_vers_4_1 },
{ "4.2", Opt_vers_4_2 },
+ {}
};
enum {
@@ -202,13 +203,14 @@ enum {
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 },
{ "rdma6", Opt_xprt_rdma6 },
{ "tcp", Opt_xprt_tcp },
{ "tcp6", Opt_xprt_tcp6 },
{ "udp", Opt_xprt_udp },
{ "udp6", Opt_xprt_udp6 },
+ {}
};
enum {
@@ -239,6 +241,7 @@ static const struct constant_table nfs_secflavor_tokens[] = {
{ "spkm3i", Opt_sec_spkmi },
{ "spkm3p", Opt_sec_spkmp },
{ "sys", Opt_sec_sys },
+ {}
};
/*