[PATCH net-next v2] net: airoha: Validate egress gdm port in airoha_ppe_foe_entry_prepare()
Andrew Lunn
andrew at lunn.ch
Sat Mar 15 06:58:18 PDT 2025
> Fix the issue validating egress gdm port in airoha_ppe_foe_entry_prepare
> routine.
A more interesting question is, why do you see an invalid port? Is the
hardware broken? Something not correctly configured? Are you just
papering over the crack?
> -static int airoha_ppe_foe_entry_prepare(struct airoha_foe_entry *hwe,
> +static int airoha_ppe_foe_entry_prepare(struct airoha_eth *eth,
> + struct airoha_foe_entry *hwe,
> struct net_device *dev, int type,
> struct airoha_flow_data *data,
> int l4proto)
> @@ -224,6 +225,11 @@ static int airoha_ppe_foe_entry_prepare(struct airoha_foe_entry *hwe,
> if (dev) {
> struct airoha_gdm_port *port = netdev_priv(dev);
If port is invalid, is dev also invalid? And if dev is invalid, could
dereferencing it to get priv cause an opps?
Andrew
More information about the linux-arm-kernel
mailing list