1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/renesas
Paul Barker 2e36c9fbc4 net: ravb: Fix RX byte accounting for jumbo packets
The RX byte accounting for jumbo packets was changed to fix a potential
use-after-free bug. However, that fix used the wrong variable and so
only accounted for the number of bytes in the final descriptor, not the
number of bytes in the whole packet.

To fix this, we can simply update our stats with the correct number of
bytes before calling napi_gro_receive().

Also rename pkt_len to desc_len in ravb_rx_gbeth() to avoid any future
confusion. The variable name pkt_len is correct in ravb_rx_rcar() as
that function does not handle packets spanning multiple descriptors.

Fixes: 5a5a3e564d ("ravb: Fix potential use-after-free in ravb_rx_gbeth()")
Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2024-04-18 11:34:28 +02:00
..
Kconfig net: ravb: Make reset controller support mandatory 2024-02-06 11:14:56 +01:00
Makefile net: ethernet: renesas: rcar_gen4_ptp: Break out to module 2023-11-23 12:02:49 +01:00
ravb.h ravb: Unify Rx ring maintenance code paths 2024-03-06 11:23:21 +00:00
ravb_main.c net: ravb: Fix RX byte accounting for jumbo packets 2024-04-18 11:34:28 +02:00
ravb_ptp.c ptp: ravb: convert to .adjfine and adjust_by_scaled_ppm 2022-10-31 11:14:16 +00:00
rcar_gen4_ptp.c net: ethernet: renesas: rcar_gen4_ptp: Break out to module 2023-11-23 12:02:49 +01:00
rcar_gen4_ptp.h net: ethernet: renesas: rcar_gen4_ptp: Get clock increment from clock rate 2023-11-23 12:02:49 +01:00
rswitch.c net: rswitch: Allow jumbo frames 2023-12-10 19:31:42 +00:00
rswitch.h net: rswitch: Allow jumbo frames 2023-12-10 19:31:42 +00:00
sh_eth.c kbuild: make -Woverride-init warnings more consistent 2024-03-31 11:32:26 +09:00
sh_eth.h Revert "sh_eth: remove open coded netif_running()" 2023-03-28 19:23:32 -07:00