* [PATCH 2/3] fuse: check reserved node ID values
@ 2005-09-23 14:18 Miklos Szeredi
0 siblings, 0 replies; only message in thread
From: Miklos Szeredi @ 2005-09-23 14:18 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel
This patch checks reserved node ID values returned by lookup and
creation operations. In case one of the reserved values is sent,
return -EIO.
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Index: linux/fs/fuse/dir.c
===================================================================
--- linux.orig/fs/fuse/dir.c 2005-09-23 14:58:09.000000000 +0200
+++ linux/fs/fuse/dir.c 2005-09-23 15:22:37.000000000 +0200
@@ -96,6 +96,8 @@ static int fuse_lookup_iget(struct inode
fuse_lookup_init(req, dir, entry, &outarg);
request_send(fc, req);
err = req->out.h.error;
+ if (!err && (!outarg.nodeid || outarg.nodeid == FUSE_ROOT_ID))
+ err = -EIO;
if (!err) {
inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation,
&outarg.attr);
@@ -152,6 +154,10 @@ static int create_new_entry(struct fuse_
fuse_put_request(fc, req);
return err;
}
+ if (!outarg.nodeid || outarg.nodeid == FUSE_ROOT_ID) {
+ fuse_put_request(fc, req);
+ return -EIO;
+ }
inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation,
&outarg.attr);
if (!inode) {
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-09-23 14:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-23 14:18 [PATCH 2/3] fuse: check reserved node ID values Miklos Szeredi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).