Re: [PATCH] usb: gadget: f_fs: OS descriptors support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 02 2014, David Laight <David.Laight@xxxxxxxxxx> wrote:
> From: Michal Nazarewicz
> ...
>> > Alternatively it shouldn't be 'packed', and a full audit of the
>> > other structures done to determine which ones can ever be misaligned
>> > and then determine whether that should actually be allowed.
>> 
>> All of the structures describe a wire protocol, whether we thing the
>> structure can be allowed or not is inconsequential since that's what is
>> being used.  All of those structures must be packed.
>
> That just isn't true.
> Just because a structure maps a protocol packet doesn't mean it has
> to be 'packed'.
> The TCP stack doesn't mark anything 'packed'.
> It relies on the ethernet driver correctly aligning receive messages.

Unfortunately in USB even if the message is correctly aligned, the
fields in descriptors do not have to be.  Furthermore, descriptors are
stacked one after another and they rarely are multiply of four (or even
two) bytes.  usb_config_descriptor for example is 9 bytes.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +--<mpn@xxxxxxxxxx>--<xmpp:mina86@xxxxxxxxxx>--ooO--(_)--Ooo--
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux