From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Yang, Qiming" <qiming.yang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "stable@dpdk.org" <stable@dpdk.org>
Subject: RE: [PATCH v2] net/ice: fix data length check
Date: Fri, 9 Jun 2023 01:50:35 +0000 [thread overview]
Message-ID: <DM4PR11MB5994C459AB028A350104F56FD751A@DM4PR11MB5994.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20230523103509.2918185-1-qi.z.zhang@intel.com>
> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Tuesday, May 23, 2023 6:35 PM
> To: Yang, Qiming <qiming.yang@intel.com>
> Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; stable@dpdk.org
> Subject: [PATCH v2] net/ice: fix data length check
>
> In TSO, It is possible mbuf->data_len exceed mtu.
> Fixed the incorrect data length check in ice_prep_pkts.
>
> Fixes: ccf33dccf7aa ("net/ice: check illegal packet sizes")
> Cc: stable@dpdk.org
>
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
> v2:
> - fix build warning
>
> drivers/net/ice/ice_rxtx.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index
> 560c1a4af7..cd0e61c85f 100644
> --- a/drivers/net/ice/ice_rxtx.c
> +++ b/drivers/net/ice/ice_rxtx.c
> @@ -3669,9 +3669,6 @@ ice_prep_pkts(__rte_unused void *tx_queue,
> struct rte_mbuf **tx_pkts,
> int i, ret;
> uint64_t ol_flags;
> struct rte_mbuf *m;
> - struct ice_tx_queue *txq = tx_queue;
> - struct rte_eth_dev *dev = &rte_eth_devices[txq->port_id];
> - uint16_t max_frame_size = dev->data->mtu + ICE_ETH_OVERHEAD;
>
> for (i = 0; i < nb_pkts; i++) {
> m = tx_pkts[i];
> @@ -3690,7 +3687,7 @@ ice_prep_pkts(__rte_unused void *tx_queue,
> struct rte_mbuf **tx_pkts,
>
> /* check the data_len in mbuf */
> if (m->data_len < ICE_TX_MIN_PKT_LEN ||
> - m->data_len > max_frame_size) {
> + m->data_len > ICE_FRAME_SIZE_MAX) {
This is wrong, actually check max_frame_size guarantee the data_len not exceed the buffer size.
Rejected.
> rte_errno = EINVAL;
> PMD_DRV_LOG(ERR, "INVALID mbuf: bad
> data_len=[%hu]", m->data_len);
> return i;
> --
> 2.31.1
prev parent reply other threads:[~2023-06-09 1:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-22 18:14 [PATCH] " Qi Zhang
2023-05-23 10:35 ` [PATCH v2] " Qi Zhang
2023-06-09 1:50 ` Zhang, Qi Z [this message]
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=DM4PR11MB5994C459AB028A350104F56FD751A@DM4PR11MB5994.namprd11.prod.outlook.com \
--to=qi.z.zhang@intel.com \
--cc=dev@dpdk.org \
--cc=qiming.yang@intel.com \
--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;
as well as URLs for NNTP newsgroup(s).