lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMi1Hd1xjHBhUM2gQ7Dhy6jQEAOgAwyQQyBoUHU+RztbYPrzcQ@mail.gmail.com>
Date:	Fri, 14 Aug 2015 15:23:23 +0530
From:	Amit Pundir <amit.pundir@...aro.org>
To:	Krzysztof Opasiak <k.opasiak@...sung.com>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-doc@...r.kernel.org, linux-api@...r.kernel.org,
	Mike Lockwood <lockwood@...roid.com>,
	Benoit Goby <benoit@...roid.com>,
	Colin Cross <ccross@...roid.com>,
	Arve Hjønnevåg <arve@...roid.com>,
	Peter Oh <poh@...adcom.com>,
	Greg Hackmann <ghackmann@...gle.com>,
	Badhri Jagan Sridharan <Badhri@...gle.com>,
	Android Kernel Team <kernel-team@...roid.com>,
	Jonathan Corbet <corbet@....net>, Felipe Balbi <balbi@...com>,
	Andrzej Pietrasiewicz <andrzej.p@...sung.com>,
	Laurent Pinchart <laurent.pinchart@...asonboard.com>,
	Yegor Yefremov <yegorslists@...glemail.com>,
	Philippe Reynes <tremyfr@...il.com>,
	John Stultz <john.stultz@...aro.org>,
	Sumit Semwal <sumit.semwal@...aro.org>
Subject: Re: [RFC][PATCH 1/2] usb: gadget: configfs: add MTP function

On 14 August 2015 at 02:11, Krzysztof Opasiak <k.opasiak@...sung.com> wrote:
>
>
> On 08/13/2015 09:57 PM, Greg Kroah-Hartman wrote:
>>
>> On Thu, Aug 13, 2015 at 09:34:46PM +0200, Krzysztof Opasiak wrote:
>>>
>>> Hello,
>>>
>>> On 08/13/2015 09:12 PM, Amit Pundir wrote:
>>>>
>>>> his MTP function is based on years of work originally done in the
>>>> Android kernel tree by:
>>>>      Mike Lockwood<lockwood@...roid.com>
>>>>      Benoit Goby<benoit@...roid.com>
>>>>      Colin Cross<ccross@...roid.com>
>>>>      Arve Hjønnevåg<arve@...roid.com>
>>>>      Peter Oh<poh@...adcom.com>
>>>>      Greg Hackmann<ghackmann@...gle.com>
>>>>      Badhri Jagan Sridharan<Badhri@...gle.com>
>>>> I've folded the series up to make it easier to review, and to provide
>>>> a coherent patch description.
>>>>
>>>> Post Gingerbread (Android v2.3), Android dropped USB Mass Storage
>>>> in favor of Media Transfer Protocal (MTP), which is widely used for
>>>> transferring media files to digital music players and similar
>>>> applications. This USB gadget function implements MTP functionalty.
>>>>
>>>> Historically this function has been a part of Android composite
>>>> gadget driver. Android composite driver was Android's solution
>>>> for dynamic gadget function switching prior to the ConfigFS gadget
>>>> being merged. There were failed few attempts in past
>>>> http://marc.info/?l=linux-usb&m=132451695808552  to upstream Android
>>>> composite driver as well. Now this Android MTP gadget function has been
>>>> re-implemented so as to be used as a generic ConfigFS function instead.
>>>>
>>>> Again, many thanks to Mike, Benoit, Colin, Arve, Peter, Greg and Badhri,
>>>> as they are the real authors of this work. However, I've folded their
>>>> patches together and modified it enough that I don't want them to be
>>>> blamed for any mistakes I've made condensing their patches down.
>>>>
>>>> Cc: Mike Lockwood<lockwood@...roid.com>
>>>> Cc: Benoit Goby<benoit@...roid.com>
>>>> Cc: Colin Cross<ccross@...roid.com>
>>>> Cc: Arve Hjønnevåg<arve@...roid.com>
>>>> Cc: Peter Oh<poh@...adcom.com>
>>>> Cc: Greg Hackmann<ghackmann@...gle.com>
>>>> Cc: Badhri Jagan Sridharan<Badhri@...gle.com>
>>>> Cc: Android Kernel Team<kernel-team@...roid.com>
>>>> Cc: Greg Kroah-Hartman<gregkh@...uxfoundation.org>
>>>> Cc: Jonathan Corbet<corbet@....net>
>>>> Cc: Felipe Balbi<balbi@...com>
>>>> Cc: Andrzej Pietrasiewicz<andrzej.p@...sung.com>
>>>> Cc: Laurent Pinchart<laurent.pinchart@...asonboard.com>
>>>> Cc: Yegor Yefremov<yegorslists@...glemail.com>
>>>> Cc: Philippe Reynes<tremyfr@...il.com>
>>>> Cc: John Stultz<john.stultz@...aro.org>
>>>> Cc: Sumit Semwal<sumit.semwal@...aro.org>
>>>> Signed-off-by: Amit Pundir<amit.pundir@...aro.org>
>>>
>>>
>>> In my humble opinion adding such function to Linux kernel doesn't make
>>> any
>>> sense. By design, MTP is a protocol which requires access to userspace
>>> features esp. file system. It is very important to run MTP daemon with
>>> suitable user and LSM label and many many other issues which should be
>>> handled by userspace access policy.
>>>
>>> Moreover this is not a fully functional USB function but only some
>>> interface
>>> which can be used by mtp-responder (mtp-daemon - call it as you like) to
>>> communicate with host. As we have FunctionFS which allows to implement
>>> any
>>> USB function in as a userspace service. As MTP nature is more related to
>>> userspace I think that porting MTP daemon to use this is a right way to
>>> go.
>>> This should be much more reasonable than adding new function which also
>>> requires daemon for proper working. So why add another interface while we
>>> can use a generic one?

Fairly valid point. I did see MTP mentioned in FunctionFS context in
Documentation/usb/functionfs.txt but I could not find an open
userpsace MTP daemon implementation based on F_FS to try.

>>
>>
>> Isn't there already a userspace MTP daemon that uses the existing
>> functionfs for usb gadgets?  I thought I remember seeing that
>> somewhere...
>>
>
> I've found some interesting link[2] which may mean that Sailfish OS guys has
> some mtp implementation with functionfs backend:
>
> <<<<< cite
>
> - /dev/mtp
> mtp functionfs rw,relatime
>
>>>>>> cite
>
> Started digging and got it!
>
> This looks like mtp with ffs backend:
>
> https://github.com/nemomobile/buteo-mtp

Thanks for the pointer. This "buteo-mtp" looks interesting.

Regards,
Amit Pundir

>
> Didn't tested, even didn't try to compile, no guarantee;)
>
> Footnotes:
> 1 -
> http://reviewjolla.blogspot.com/2014/06/techspecs-android-on-jolla-phone.html
>
>
> Best regards,
>
> --
> Krzysztof Opasiak
> Samsung R&D Institute Poland
> Samsung Electronics
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ