mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Timo Savola <tsavola@movial.fi>
To: miklos@szeredi.hu
Cc: linux-kernel@vger.kernel.org, fuse-devel@lists.sourceforge.net
Subject: [PATCH] FUSE: Validate rootmode mount option
Date: Mon, 2 Apr 2007 23:47:54 +0300	[thread overview]
Message-ID: <20070402204749.GA11774@movial.fi> (raw)

If rootmode doesn't include any file type bits, we hit the BUG() in
fuse_init_inode.  Now EINVAL is returned.

Signed-off-by: Timo Savola <tsavola@movial.fi>
---
 fs/fuse/inode.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 5ab8e50..503c9cd 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -330,6 +330,8 @@ static int parse_fuse_opt(char *opt, struct fuse_mount_data *d, int is_bdev)
 		case OPT_ROOTMODE:
 			if (match_octal(&args[0], &value))
 				return 0;
+			if ((value & S_IFMT) == 0)
+				return 0;
 			d->rootmode = value;
 			d->rootmode_present = 1;
 			break;
-- 
1.4.4.4


             reply	other threads:[~2007-04-02 21:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-02 20:47 Timo Savola [this message]
2007-04-02 22:31 ` Miklos Szeredi

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=20070402204749.GA11774@movial.fi \
    --to=tsavola@movial.fi \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®