public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: Ciara Loftus <ciara.loftus@intel.com>, <dev@dpdk.org>
Cc: <stable@dpdk.org>
Subject: Re: [PATCH] net/i40e: fix null dereference in raw flow item
Date: Mon, 9 Mar 2026 15:45:05 +0100	[thread overview]
Message-ID: <8e39752e-6430-49a5-a1fe-e92fbe4d6025@intel.com> (raw)
In-Reply-To: <20260309132802.3094565-1-ciara.loftus@intel.com>

On 3/9/2026 2:28 PM, Ciara Loftus wrote:
> When a RTE_FLOW_ITEM_TYPE_RAW item is used with a non-zero length
> and a NULL pattern pointer in either the spec or mask, a segfault
> occurs as the pattern bytes are accessed unconditionally in a loop.
> Add NULL checks for both spec->pattern and mask->pattern before entering
> the loop that uses those fields.
> 
> Bugzilla ID: 1155
> Fixes: 6ced3dd72f5f ("net/i40e: support flexible payload parsing for FDIR")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
> ---
>   drivers/net/intel/i40e/i40e_flow.c | 18 ++++++++++++++++++
>   1 file changed, 18 insertions(+)
> 
> diff --git a/drivers/net/intel/i40e/i40e_flow.c b/drivers/net/intel/i40e/i40e_flow.c
> index 2374b9bbca..6ad3013573 100644
> --- a/drivers/net/intel/i40e/i40e_flow.c
> +++ b/drivers/net/intel/i40e/i40e_flow.c
> @@ -2350,6 +2350,24 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
>   				return -rte_errno;
>   			}
>   
> +			if (raw_spec->length != 0) {
> +				if (raw_spec->pattern == NULL) {
> +					rte_flow_error_set(error, EINVAL,
> +							   RTE_FLOW_ERROR_TYPE_ITEM,
> +							   item,
> +							   "NULL RAW spec pattern");
> +					return -rte_errno;
> +				}
> +
> +				if (raw_mask->pattern == NULL) {
> +					rte_flow_error_set(error, EINVAL,
> +							   RTE_FLOW_ERROR_TYPE_ITEM,
> +							   item,
> +							   "NULL RAW mask pattern");
> +					return -rte_errno;
> +				}
> +			}
> +
>   			for (i = 0; i < raw_spec->length; i++) {
>   				j = i + next_dst_off;
>   				if (j >= RTE_ETH_FDIR_MAX_FLEXLEN ||

Maybe also check if raw_mask length matches raw_spec?

Otherwise,

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

  reply	other threads:[~2026-03-09 14:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-09 13:28 [PATCH] net/i40e: fix null dereference in raw flow item Ciara Loftus
2026-03-09 14:45 ` Burakov, Anatoly [this message]
2026-03-09 15:29 ` [PATCH v2] net/i40e: validate raw flow items before dereferencing Ciara Loftus
2026-03-11 15:21   ` Bruce Richardson
2026-03-11 17:24     ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e39752e-6430-49a5-a1fe-e92fbe4d6025@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=ciara.loftus@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox