Commit 529af90576cfa44aa107e9876e2ebaa053983986

Authored by Scott Mayhew
Committed by Trond Myklebust
1 parent ed5d588fe4

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>

Showing 1 changed file with 4 additions and 1 deletions Side-by-side Diff

... ... @@ -190,6 +190,7 @@
190 190 { "4.0", Opt_vers_4_0 },
191 191 { "4.1", Opt_vers_4_1 },
192 192 { "4.2", Opt_vers_4_2 },
  193 + {}
193 194 };
194 195  
195 196 enum {
196 197  
... ... @@ -202,13 +203,14 @@
202 203 nr__Opt_xprt
203 204 };
204 205  
205   -static const struct constant_table nfs_xprt_protocol_tokens[nr__Opt_xprt] = {
  206 +static const struct constant_table nfs_xprt_protocol_tokens[] = {
206 207 { "rdma", Opt_xprt_rdma },
207 208 { "rdma6", Opt_xprt_rdma6 },
208 209 { "tcp", Opt_xprt_tcp },
209 210 { "tcp6", Opt_xprt_tcp6 },
210 211 { "udp", Opt_xprt_udp },
211 212 { "udp6", Opt_xprt_udp6 },
  213 + {}
212 214 };
213 215  
214 216 enum {
... ... @@ -239,6 +241,7 @@
239 241 { "spkm3i", Opt_sec_spkmi },
240 242 { "spkm3p", Opt_sec_spkmp },
241 243 { "sys", Opt_sec_sys },
  244 + {}
242 245 };
243 246  
244 247 /*