[PATCH] net/ixgbe: fix null dereference on EEPROM write for E610
Bruce Richardson
bruce.richardson at intel.com
Mon Sep 28 12:36:22 CEST 2026
On Mon, Sep 28, 2026 at 12:50:54PM -0400, Sandeep Penigalapati wrote:
> E610 does not support EEPROM writes and leaves eeprom.ops.write_buffer
> as NULL. ixgbe_set_eeprom() calls this pointer without checking it,
> causing a NULL pointer dereference when a set-eeprom request is issued
> on an E610 port.
>
> Check the op for NULL and return -ENOTSUP instead.
>
> Fixes: 316637762a5f ("net/ixgbe/base: enable E610 device")
> Cc: stable at dpdk.org
>
> Signed-off-by: Sandeep Penigalapati <sandeep.penigalapati at intel.com>
> ---
> drivers/net/intel/ixgbe/ixgbe_ethdev.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.c b/drivers/net/intel/ixgbe/ixgbe_ethdev.c
> index 78e19f94c0..c653951858 100644
> --- a/drivers/net/intel/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.c
> @@ -7370,6 +7370,9 @@ ixgbe_set_eeprom(struct rte_eth_dev *dev,
>
> in_eeprom->magic = hw->vendor_id | (hw->device_id << 16);
>
> + if (eeprom->ops.write_buffer == NULL)
> + return -ENOTSUP;
> +
> return eeprom->ops.write_buffer(hw, first, length, data);
Fix looks correct.
However, I think that the check might be better moved up the function. I
would suggest putting this check right after the secondary process check,
and before the arg validation checks. I don't see any point in checking
args for something that we cannot do anyway, so on bad args to E610, I
think ENOTSUP is a better error code than EINVAL, since it's not going to
work even if the args are fixed.
> }
>
> --
> 2.27.0
>
More information about the stable
mailing list