From: Greg Kroah-Hartman Date: Sun, 11 Oct 2020 08:38:42 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v4.4.239~51 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6562ea4831b6f985d6c480a98f007fa9b9370c71;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: macsec-avoid-use-after-free-in-macsec_handle_frame.patch --- diff --git a/queue-4.9/macsec-avoid-use-after-free-in-macsec_handle_frame.patch b/queue-4.9/macsec-avoid-use-after-free-in-macsec_handle_frame.patch new file mode 100644 index 00000000000..665a61a1b5b --- /dev/null +++ b/queue-4.9/macsec-avoid-use-after-free-in-macsec_handle_frame.patch @@ -0,0 +1,45 @@ +From c7cc9200e9b4a2ac172e990ef1975cd42975dad6 Mon Sep 17 00:00:00 2001 +From: Eric Dumazet +Date: Wed, 7 Oct 2020 01:42:46 -0700 +Subject: macsec: avoid use-after-free in macsec_handle_frame() + +From: Eric Dumazet + +commit c7cc9200e9b4a2ac172e990ef1975cd42975dad6 upstream. + +De-referencing skb after call to gro_cells_receive() is not allowed. +We need to fetch skb->len earlier. + +Fixes: 5491e7c6b1a9 ("macsec: enable GRO and RPS on macsec devices") +Signed-off-by: Eric Dumazet +Cc: Paolo Abeni +Acked-by: Paolo Abeni +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/macsec.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/net/macsec.c ++++ b/drivers/net/macsec.c +@@ -1087,6 +1087,7 @@ static rx_handler_result_t macsec_handle + struct macsec_rx_sa *rx_sa; + struct macsec_rxh_data *rxd; + struct macsec_dev *macsec; ++ unsigned int len; + sci_t sci; + u32 pn; + bool cbit; +@@ -1242,9 +1243,10 @@ deliver: + macsec_rxsc_put(rx_sc); + + skb_orphan(skb); ++ len = skb->len; + ret = gro_cells_receive(&macsec->gro_cells, skb); + if (ret == NET_RX_SUCCESS) +- count_rx(dev, skb->len); ++ count_rx(dev, len); + else + macsec->secy.netdev->stats.rx_dropped++; + diff --git a/queue-4.9/series b/queue-4.9/series index 818166c68af..b4864042880 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -32,3 +32,4 @@ driver-core-fix-probe_count-imbalance-in-really_probe.patch perf-top-fix-stdio-interface-input-handling-with-glibc-2.28.patch mtd-rawnand-sunxi-fix-the-probe-error-path.patch ftrace-move-rcu-is-watching-check-after-recursion-check.patch +macsec-avoid-use-after-free-in-macsec_handle_frame.patch