qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] 9pfs-local: open2() deletes existing data?
@ 2015-03-04 21:10 Michael Tokarev
  2015-03-05 18:02 ` Aneesh Kumar K.V
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Tokarev @ 2015-03-04 21:10 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: qemu-devel

I was looking at various interesting functions in hw/9pfs/virtio-9p-local.c
and noticed local_open2() which basically tries to open a file in a
filesystem, and if that is successful, it tries to set file credentials
using a configured mechanism, and if that fails, it deletes the file.

Now I wonder what happens if we tried to open an existing file but was
not able to set credentials for whatever reason -- eg, because the
underlying filesystem does not support xattrs, or whatever.  It looks
to me that we will remove the user file!

If that's the case, it looks like it is a very serious bug...

Thanks,

/mjt

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

* Re: [Qemu-devel] 9pfs-local: open2() deletes existing data?
  2015-03-04 21:10 [Qemu-devel] 9pfs-local: open2() deletes existing data? Michael Tokarev
@ 2015-03-05 18:02 ` Aneesh Kumar K.V
  0 siblings, 0 replies; 2+ messages in thread
From: Aneesh Kumar K.V @ 2015-03-05 18:02 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: qemu-devel

Michael Tokarev <mjt@tls.msk.ru> writes:

> I was looking at various interesting functions in hw/9pfs/virtio-9p-local.c
> and noticed local_open2() which basically tries to open a file in a
> filesystem, and if that is successful, it tries to set file credentials
> using a configured mechanism, and if that fails, it deletes the file.
>
> Now I wonder what happens if we tried to open an existing file but was
> not able to set credentials for whatever reason -- eg, because the
> underlying filesystem does not support xattrs, or whatever.  It looks
> to me that we will remove the user file!
>
> If that's the case, it looks like it is a very serious bug...

That callback is used for create. What is used for open is local_open()

-aneesh

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

end of thread, other threads:[~2015-03-05 18:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-04 21:10 [Qemu-devel] 9pfs-local: open2() deletes existing data? Michael Tokarev
2015-03-05 18:02 ` Aneesh Kumar K.V

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).