All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob Copeland <me@bobcopeland.com>
To: akpm@linux-foundation.org
Cc: linux-fsdevel@vger.kernel.org,
	Sasha Levin <sasha.levin@oracle.com>,
	stable@vger.kernel.org, Bob Copeland <me@bobcopeland.com>
Subject: [PATCH 1/4] fs, omfs: add NULL terminator in the end up the token list
Date: Mon, 18 May 2015 07:34:35 -0400	[thread overview]
Message-ID: <1431948878-3756-2-git-send-email-me@bobcopeland.com> (raw)
In-Reply-To: <1431948878-3756-1-git-send-email-me@bobcopeland.com>

From: Sasha Levin <sasha.levin@oracle.com>

match_token() expects a NULL terminator at the end of the token list so that
it would know where to stop. Not having one causes it to overrun to invalid
memory.

In practice, passing a mount option that omfs didn't recognize would sometimes
panic the system.

Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
---
 fs/omfs/inode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c
index 138321b0c6c2..70d4191cf33d 100644
--- a/fs/omfs/inode.c
+++ b/fs/omfs/inode.c
@@ -359,7 +359,7 @@ nomem:
 }
 
 enum {
-	Opt_uid, Opt_gid, Opt_umask, Opt_dmask, Opt_fmask
+	Opt_uid, Opt_gid, Opt_umask, Opt_dmask, Opt_fmask, Opt_err
 };
 
 static const match_table_t tokens = {
@@ -368,6 +368,7 @@ static const match_table_t tokens = {
 	{Opt_umask, "umask=%o"},
 	{Opt_dmask, "dmask=%o"},
 	{Opt_fmask, "fmask=%o"},
+	{Opt_err, NULL},
 };
 
 static int parse_options(char *options, struct omfs_sb_info *sbi)
-- 
2.1.4


  reply	other threads:[~2015-05-18 11:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18 11:34 [PATCH 0/4] OMFS fixes Bob Copeland
2015-05-18 11:34 ` Bob Copeland [this message]
2015-05-18 11:34 ` [PATCH 2/4] omfs: set error return when d_make_root() fails Bob Copeland
2015-05-18 11:34 ` [PATCH 3/4] omfs: fix sign confusion for bitmap loop counter Bob Copeland
2015-05-18 11:34 ` [PATCH 4/4] omfs: fix potential integer overflow in allocator Bob Copeland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1431948878-3756-2-git-send-email-me@bobcopeland.com \
    --to=me@bobcopeland.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=sasha.levin@oracle.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.