All of lore.kernel.org
 help / color / mirror / Atom feed
* [Virtio-fs] [PATCH] virtiofsd: fix lo_do_lookup panic
@ 2019-06-06  7:16 Peng Tao
  2019-06-06  9:54 ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 3+ messages in thread
From: Peng Tao @ 2019-06-06  7:16 UTC (permalink / raw)
  To: virtio-fs; +Cc: Peng Tao

It needs to check for invalid parent dir.

Signed-off-by: Peng Tao <tao.peng@linux.alibaba.com>
---
 contrib/virtiofsd/passthrough_ll.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/contrib/virtiofsd/passthrough_ll.c b/contrib/virtiofsd/passthrough_ll.c
index 8a3adc9..f544387 100644
--- a/contrib/virtiofsd/passthrough_ll.c
+++ b/contrib/virtiofsd/passthrough_ll.c
@@ -640,6 +640,9 @@ static int lo_do_lookup(fuse_req_t req, fuse_ino_t parent, const char *name,
 	struct lo_data *lo = lo_data(req);
 	struct lo_inode *inode, *dir = lo_inode(req, parent);
 
+	if (dir == NULL)
+		return EBADF;
+
 	memset(e, 0, sizeof(*e));
 	e->attr_timeout = lo->timeout;
 	e->entry_timeout = lo->timeout;
-- 
1.8.3.1


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

* Re: [Virtio-fs] [PATCH] virtiofsd: fix lo_do_lookup panic
  2019-06-06  7:16 [Virtio-fs] [PATCH] virtiofsd: fix lo_do_lookup panic Peng Tao
@ 2019-06-06  9:54 ` Dr. David Alan Gilbert
  2019-06-06 16:52   ` Liu Bo
  0 siblings, 1 reply; 3+ messages in thread
From: Dr. David Alan Gilbert @ 2019-06-06  9:54 UTC (permalink / raw)
  To: Peng Tao; +Cc: virtio-fs

* Peng Tao (tao.peng@linux.alibaba.com) wrote:
> It needs to check for invalid parent dir.
> 
> Signed-off-by: Peng Tao <tao.peng@linux.alibaba.com>

This is the same as Liu Bo's patch from 23rd May; but there
was some discussion about what to do about open_by_handle_at.
Did we ever get an answer to that?

Dave

> ---
>  contrib/virtiofsd/passthrough_ll.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/contrib/virtiofsd/passthrough_ll.c b/contrib/virtiofsd/passthrough_ll.c
> index 8a3adc9..f544387 100644
> --- a/contrib/virtiofsd/passthrough_ll.c
> +++ b/contrib/virtiofsd/passthrough_ll.c
> @@ -640,6 +640,9 @@ static int lo_do_lookup(fuse_req_t req, fuse_ino_t parent, const char *name,
>  	struct lo_data *lo = lo_data(req);
>  	struct lo_inode *inode, *dir = lo_inode(req, parent);
>  
> +	if (dir == NULL)
> +		return EBADF;
> +
>  	memset(e, 0, sizeof(*e));
>  	e->attr_timeout = lo->timeout;
>  	e->entry_timeout = lo->timeout;
> -- 
> 1.8.3.1
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


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

* Re: [Virtio-fs] [PATCH] virtiofsd: fix lo_do_lookup panic
  2019-06-06  9:54 ` Dr. David Alan Gilbert
@ 2019-06-06 16:52   ` Liu Bo
  0 siblings, 0 replies; 3+ messages in thread
From: Liu Bo @ 2019-06-06 16:52 UTC (permalink / raw)
  To: Dr. David Alan Gilbert; +Cc: virtio-fs, Peng Tao

On Thu, Jun 06, 2019 at 10:54:29AM +0100, Dr. David Alan Gilbert wrote:
> * Peng Tao (tao.peng@linux.alibaba.com) wrote:
> > It needs to check for invalid parent dir.
> > 
> > Signed-off-by: Peng Tao <tao.peng@linux.alibaba.com>
> 
> This is the same as Liu Bo's patch from 23rd May; but there
> was some discussion about what to do about open_by_handle_at.
> Did we ever get an answer to that?

No answer yet, here we haven't got a usecase which is uing exportfs.

The discussion was related but not rejecting the patch, it's about
whether we should disable exportfs if we cannot support it well.

Peng's patch returns EBADF while mine was returning ENOENT, I'm OK
with either errno, up to you :-)

thanks,
-liubo
> 
> Dave
> 
> > ---
> >  contrib/virtiofsd/passthrough_ll.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/contrib/virtiofsd/passthrough_ll.c b/contrib/virtiofsd/passthrough_ll.c
> > index 8a3adc9..f544387 100644
> > --- a/contrib/virtiofsd/passthrough_ll.c
> > +++ b/contrib/virtiofsd/passthrough_ll.c
> > @@ -640,6 +640,9 @@ static int lo_do_lookup(fuse_req_t req, fuse_ino_t parent, const char *name,
> >  	struct lo_data *lo = lo_data(req);
> >  	struct lo_inode *inode, *dir = lo_inode(req, parent);
> >  
> > +	if (dir == NULL)
> > +		return EBADF;
> > +
> >  	memset(e, 0, sizeof(*e));
> >  	e->attr_timeout = lo->timeout;
> >  	e->entry_timeout = lo->timeout;
> > -- 
> > 1.8.3.1
> > 
> --
> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


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

end of thread, other threads:[~2019-06-06 16:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-06  7:16 [Virtio-fs] [PATCH] virtiofsd: fix lo_do_lookup panic Peng Tao
2019-06-06  9:54 ` Dr. David Alan Gilbert
2019-06-06 16:52   ` Liu Bo

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.