mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] FUSE: Validate rootmode mount option
@ 2007-04-02 20:47 Timo Savola
  2007-04-02 22:31 ` Miklos Szeredi
  0 siblings, 1 reply; 2+ messages in thread
From: Timo Savola @ 2007-04-02 20:47 UTC (permalink / raw)
  To: miklos; +Cc: linux-kernel, fuse-devel

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-04-02 22:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-02 20:47 [PATCH] FUSE: Validate rootmode mount option Timo Savola
2007-04-02 22:31 ` Miklos Szeredi

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®