Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2157026ybb; Thu, 2 Apr 2020 14:22:31 -0700 (PDT) X-Google-Smtp-Source: APiQypJfPMyDafJbMKcgdLiYu01NNRy3MTw7bvO8pdtYaU+PpfmaL6zplRI91v+ubRizB6O3+v93 X-Received: by 2002:aca:acd5:: with SMTP id v204mr795487oie.124.1585862551001; Thu, 02 Apr 2020 14:22:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585862550; cv=none; d=google.com; s=arc-20160816; b=Mtyo6D8w5YKIXfgjDMgpMnxBZG5/5hdmqVWfHL/2BsyymkDHvtciNhJdbOCwVdz/oh gpABc+ojzL3P5Rgs7eTiPkYGZmczp2FwGOJfFavRZlGt4EFnE40vue9Ig2EINVp7YzCE k3nLFCw+1Z7M6Ca79/Wv+PqVwgegXjR1Jxcqr0eMF0usYF83lPh7JqM3Uyo23iRQkYH8 wp5yorH66adfafdS7z6Rtp49UMesIZ/QiZddIY79P/bMlg05A5FS4jvc+jFGnrMvkQsh CljBAcAvoFBn2tClcbsGHKzCa3Oz2JeXX1vH0KD44oQCA/aWeXGoSaHO4dWqGmEgEnN/ baaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=TMahs0dFL+7jWby6jv8zkqEFyP7Kw+3r93qGDC+Fe98=; b=Pa8wYjCoJntVCTvf54aBzmvWXEK0/cgRKwHJaJJ0Bkn0j82uOzFxPW+NPcFluedluj sZkzuYmsjzBs3v9nv4AtgSdShDzGbiS67qRGtapkmXDlYsZtrmNUBzX7KLRfNzMENAPw qtoH4Aj+uCEEtK7zaZWlKOT3+y7Z5AXrOzq8jKADFpV8aeOyWl2CaG4nb8hbYoTFZypN 8kmE1c0VAmGJBChV5ThCl2TakDgHK9ZvhQX6gkiI6B/BqWacI7XY7mxTW/ObS3j1kNsp yaIRx0nkYHNPWj4rxiYHsVTxQikrn8yfu1n0FBXuxC4ZMt67ZUjNTZWWZD2zz+c+zyt0 SZFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aDeHBxB6; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f77si3223158oob.89.2020.04.02.14.22.19; Thu, 02 Apr 2020 14:22:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aDeHBxB6; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732600AbgDBVUv (ORCPT + 99 others); Thu, 2 Apr 2020 17:20:51 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:30942 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727412AbgDBVUv (ORCPT ); Thu, 2 Apr 2020 17:20:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585862449; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=TMahs0dFL+7jWby6jv8zkqEFyP7Kw+3r93qGDC+Fe98=; b=aDeHBxB601PgpRHhhFVPP5JETsui70mPSDjXgNvgF4Qwol6wbb+JVrAysSNoXnlYCuNwj5 /82LPd3V/E6kX9aTph/O9Gd4Yj4wSn9TiaWds6NrhvjeT8Y0mYdeEpc5kkJ0vT9WXZaSPZ 5/MPeNldoKdzWmJIm8lMG5nGhq8F++I= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-337-VeQgcmLlMHW4zcFrXfsjeQ-1; Thu, 02 Apr 2020 17:20:46 -0400 X-MC-Unique: VeQgcmLlMHW4zcFrXfsjeQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 050DE18A6EC7; Thu, 2 Apr 2020 21:20:45 +0000 (UTC) Received: from aion.usersys.redhat.com (ovpn-113-45.rdu2.redhat.com [10.10.113.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DD69A99E11; Thu, 2 Apr 2020 21:20:44 +0000 (UTC) Received: by aion.usersys.redhat.com (Postfix, from userid 1000) id 5D4841A02B4; Thu, 2 Apr 2020 17:20:44 -0400 (EDT) From: Scott Mayhew To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: aglo@umich.edu, linux-nfs@vger.kernel.org Subject: [PATCH] NFS: Fix a few constant_table array definitions Date: Thu, 2 Apr 2020 17:20:44 -0400 Message-Id: <20200402212044.10318-1-smayhew@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Content-Transfer-Encoding: quoted-printable Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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 Signed-off-by: Scott Mayhew --- fs/nfs/fs_context.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/nfs/fs_context.c b/fs/nfs/fs_context.c index e113fcb4bb4c..1c8d8bedf34e 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[] = =3D { { "4.0", Opt_vers_4_0 }, { "4.1", Opt_vers_4_1 }, { "4.2", Opt_vers_4_2 }, + {} }; =20 enum { @@ -202,13 +203,14 @@ enum { nr__Opt_xprt }; =20 -static const struct constant_table nfs_xprt_protocol_tokens[nr__Opt_xprt= ] =3D { +static const struct constant_table nfs_xprt_protocol_tokens[] =3D { { "rdma", Opt_xprt_rdma }, { "rdma6", Opt_xprt_rdma6 }, { "tcp", Opt_xprt_tcp }, { "tcp6", Opt_xprt_tcp6 }, { "udp", Opt_xprt_udp }, { "udp6", Opt_xprt_udp6 }, + {} }; =20 enum { @@ -239,6 +241,7 @@ static const struct constant_table nfs_secflavor_toke= ns[] =3D { { "spkm3i", Opt_sec_spkmi }, { "spkm3p", Opt_sec_spkmp }, { "sys", Opt_sec_sys }, + {} }; =20 /* --=20 2.25.1