This is a note to let you know that I've just added the patch titled net: mscc: ocelot: properly reject destination IP keys in VCAP IS1 to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: net-mscc-ocelot-properly-reject-destination-ip-keys-in-vcap-is1.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From f1becbed411c6fa29d7ce3def3a1dcd4f63f2d74 Mon Sep 17 00:00:00 2001 From: Vladimir Oltean <vladimir.oltean@xxxxxxx> Date: Thu, 4 Mar 2021 12:29:43 +0200 Subject: net: mscc: ocelot: properly reject destination IP keys in VCAP IS1 From: Vladimir Oltean <vladimir.oltean@xxxxxxx> commit f1becbed411c6fa29d7ce3def3a1dcd4f63f2d74 upstream. An attempt is made to warn the user about the fact that VCAP IS1 cannot offload keys matching on destination IP (at least given the current half key format), but sadly that warning fails miserably in practice, due to the fact that it operates on an uninitialized "match" variable. We must first decode the keys from the flow rule. Fixes: 75944fda1dfe ("net: mscc: ocelot: offload ingress skbedit and vlan actions to VCAP IS1") Reported-by: Colin Ian King <colin.king@xxxxxxxxxxxxx> Signed-off-by: Vladimir Oltean <vladimir.oltean@xxxxxxx> Reviewed-by: Colin Ian King <colin.king@xxxxxxxxxxxxx> Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/net/ethernet/mscc/ocelot_flower.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/mscc/ocelot_flower.c +++ b/drivers/net/ethernet/mscc/ocelot_flower.c @@ -540,13 +540,14 @@ ocelot_flower_parse_key(struct ocelot *o return -EOPNOTSUPP; } + flow_rule_match_ipv4_addrs(rule, &match); + if (filter->block_id == VCAP_IS1 && *(u32 *)&match.mask->dst) { NL_SET_ERR_MSG_MOD(extack, "Key type S1_NORMAL cannot match on destination IP"); return -EOPNOTSUPP; } - flow_rule_match_ipv4_addrs(rule, &match); tmp = &filter->key.ipv4.sip.value.addr[0]; memcpy(tmp, &match.key->src, 4); Patches currently in stable-queue which might be from vladimir.oltean@xxxxxxx are queue-5.10/net-enetc-fix-incorrect-tpid-when-receiving-802.1ad-tagged-packets.patch queue-5.10/net-mscc-ocelot-properly-reject-destination-ip-keys-in-vcap-is1.patch queue-5.10/net-enetc-don-t-overwrite-the-rss-indirection-table-when-initializing.patch queue-5.10/net-enetc-keep-rx-ring-consumer-index-in-sync-with-hardware.patch queue-5.10/net-enetc-remove-bogus-write-to-sirxidr-from-enetc_setup_rxbdr.patch queue-5.10/net-dsa-sja1105-fix-sgmii-pcs-being-forced-to-speed_unknown-instead-of-speed_10.patch queue-5.10/net-enetc-allow-hardware-timestamping-on-tx-queues-with-tc-etf-enabled.patch queue-5.10/net-enetc-take-the-mdio-lock-only-once-per-napi-poll-cycle.patch queue-5.10/net-enetc-don-t-disable-vlan-filtering-in-iff_promisc-mode.patch queue-5.10/net-enetc-force-the-rgmii-speed-and-duplex-instead-of-operating-in-inband-mode.patch