[U-Boot] [PATCH 6/8] net: ravb: Fix "left shift in type int" undefined behavior

Marek Vasut marek.vasut at gmail.com
Mon Aug 20 08:05:48 UTC 2018


On 08/20/2018 02:00 AM, Eugeniu Rosca wrote:
> Running "tftp" on R-Car H3 Salvator-X with CONFIG_UBSAN=y results in:
> 
[...]
>
> =====================================================================
> UBSAN: Undefined behaviour in drivers/net/ravb.c:205:20
> left shift of 12 by 28 places cannot be represented in type 'int'
> =====================================================================
> host 192.168.2.11 is alive
> 
> There are two issues behind:
>  - calculating RAVB_DESC_DT_* bitfields
>  - assembling MAC address from its char components
> 
> Fix both.

Nice

Acked-by: Marek Vasut <marek.vasut at gmail.com>

btw sh_eth.c might have similar issue .

> Fixes: 8ae51b6f324e ("net: ravb: Add Renesas Ethernet RAVB driver")
> Signed-off-by: Eugeniu Rosca <erosca at de.adit-jv.com>
[...]
-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list