From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Omer Katz <omer@kazuar-tech.com>, Bandan Das <bsd@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Filtering files passing through MTP devices
Date: Wed, 25 Apr 2018 10:56:57 +0100 [thread overview]
Message-ID: <20180425095657.GF30024@redhat.com> (raw)
In-Reply-To: <CAA-pg_qXZLDEHq6jMN_4GUrFvQgf0AS8Fs559JbucptK6_zrFw@mail.gmail.com>
On Mon, Apr 23, 2018 at 03:10:32PM +0000, Omer Katz wrote:
> Hi everyone,
>
> We have a use case that requires us to only allow certain files to pass
> through to the guest machine from USB storage devices.
>
> I was told on IRC that such a feature does not exist but the easiest way to
> achieve our goal is to contribute a patch the the MTP device driver since
> other drivers operate on a filesystem level instead of a file level which
> is what we need.
IMHO the easiest way to stop the guest accessing files is to simply not
put them in the directory that you are exporting the guest in the first
place. If you have a directory that has some files you don't want accessed
and can't remove them, then perhaps create a second directory and use
symlinks or hardlinks to pull in files from the original directory.
> The plan is to pass the contents of each file to a program through stdin
> and decide based on the exit code if the file should be allowed to pass
> through to the guest or not.
I can't say I like this idea. It is a really very inefficient and heavy
solution.
> Since this is the first time I'm contributing to QEMU I'd like some
> guidance to where the filtering code should be.
> https://github.com/qemu/qemu/blob/master/hw/usb/dev-mtp.c doesn't look that
> complicated but I still need to understand it better to continue.
> Furthermore, I need to know where to add such a command line option to
> point QEMU to the filtering program.
>
> Would such a patch be accepted if all the requirements above are met?
Can you explain the usage scenario you have in more details, rather than
just the high level abstract.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2018-04-25 9:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-23 15:10 [Qemu-devel] Filtering files passing through MTP devices Omer Katz
2018-04-25 9:56 ` Daniel P. Berrangé [this message]
2018-04-25 10:39 ` Omer Katz
2018-04-25 16:17 ` Bandan Das
2018-04-25 18:05 ` Omer Katz
2018-04-25 20:20 ` Bandan Das
2018-04-25 20:46 ` Omer Katz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180425095657.GF30024@redhat.com \
--to=berrange@redhat.com \
--cc=bsd@redhat.com \
--cc=kraxel@redhat.com \
--cc=omer@kazuar-tech.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).