[U-Boot] [PATCH 2/2] net: designware: clear padding bytes
Simon Goldschmidt
simon.k.r.goldschmidt at gmail.com
Sat Nov 24 19:08:10 UTC 2018
On 17.11.2018 17:03, Joe Hershberger wrote:
> On Sat, Nov 17, 2018 at 3:26 AM Simon Goldschmidt
> <simon.k.r.goldschmidt at gmail.com> wrote:
>> Short frames are padded to the minimum allowed size of 60 bytes.
>> However, the designware driver sends old data in these padding bytes.
>> It is common practice to zero out these padding bytes ro prevent
>> leaking memory contents to other hosts.
>>
>> Fix the padding code to zero out the padded bytes at the end.
>>
>> Tested on socfpga gen5.
>>
>> Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt at gmail.com>
> Acked-by: Joe Hershberger <joe.hershberger at ni.com>
Having searched through the code, there are other drivers that increase
the length to 60 bytes but don't zero out the padding.
Would it be better to do this in eth_send()? That would ensure every
driver does it. I don't know the U-Boot net stack too well, but maybe we
could even do the minimum length check in eth_send()?
Regards,
Simon
More information about the U-Boot
mailing list