diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2011-08-24 10:20:17 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-29 14:33:03 -0700 |
commit | 54535f716d3f635179a8033a8dab6306ef5cb90e (patch) | |
tree | bd4f3403ca8c696dbc8937b9ff568f22b51f61ec | |
parent | af0f7f669e9cb671422111246d71c37f5d18252c (diff) |
fuse: check size of FUSE_NOTIFY_INVAL_ENTRY message
commit c2183d1e9b3f313dd8ba2b1b0197c8d9fb86a7ae upstream.
FUSE_NOTIFY_INVAL_ENTRY didn't check the length of the write so the
message processing could overrun and result in a "kernel BUG at
fs/fuse/dev.c:629!"
Reported-by: Han-Wen Nienhuys <hanwenn@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | fs/fuse/dev.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 51d9e33d634..5cbeb74854f 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -899,6 +899,10 @@ static int fuse_notify_inval_entry(struct fuse_conn *fc, unsigned int size, if (outarg.namelen > FUSE_NAME_MAX) goto err; + err = -EINVAL; + if (size != sizeof(outarg) + outarg.namelen + 1) + goto err; + name.name = buf; name.len = outarg.namelen; err = fuse_copy_one(cs, buf, outarg.namelen + 1); |