DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Medvedkin, Vladimir" <vladimir.medvedkin@intel.com>
To: David Marchand <david.marchand@redhat.com>
Cc: dev <dev@dpdk.org>, "Wang, Yipeng1" <yipeng1.wang@intel.com>,
	"Gobriel, Sameh" <sameh.gobriel@intel.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	dpdk stable <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v3] test/hash: fix buffer overflow
Date: Tue, 19 Oct 2021 17:57:47 +0200
Message-ID: <21a6e602-1138-b8bb-e5c1-ff9c6c314c59@intel.com> (raw)
In-Reply-To: <CAJFAV8xZyJxcYSXDDFP5NRUw+_euUN_qLwXp2sNQhLkcgOU+Rw@mail.gmail.com>

Hi David,

On 19/10/2021 09:02, David Marchand wrote:
> On Fri, Oct 15, 2021 at 3:02 PM Medvedkin, Vladimir
> <vladimir.medvedkin@intel.com> wrote:
>>> I am confused.
>>> Does it mean that rte_jhash_32b is not compliant with rte_hash_create API?
>> I think so too, because despite the fact that the ABI is the same, the
>> API remains different with respect to the length argument.
> Sorry I don't follow you with "ABI is the same".
> Can you explain please?

I meant that rte_hash accepts:

/** Type of function that can be used for calculating the hash value. */
typedef uint32_t (*rte_hash_function)(const void *key, uint32_t key_len, 
  uint32_t init_val);

as a hash function. And signatures of rte_jhash() and rte_jhash_32b() 
are the same, but differ in the semantics of the "key_len" argument. 
Internally rte_hash passes a length of the key counted in bytes to this 
functions, so problems appears if configured hash function considers the 
key_len as something else than the size in bytes.

> I am not against the fix, but it seems to test something different
> than what an application using the hash library would do.
> Or if an application directly calls this hash function, maybe the unit
> test should not test it via rte_hash_create (which seems to defeat the
> abstraction).

I'd say that user should not use this hash function with rte_hash.
Yipeng, Sameh, Bruce,
what do you think?



  reply	other threads:[~2021-10-19 15:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-08 21:28 [dpdk-dev] [PATCH] " Vladimir Medvedkin
2021-10-11 11:03 ` David Marchand
2021-10-13 19:26   ` Medvedkin, Vladimir
2021-10-14  7:04     ` David Marchand
2021-10-14 17:46       ` Medvedkin, Vladimir
2021-10-13 19:27 ` [dpdk-dev] [PATCH v2] " Vladimir Medvedkin
2021-10-14  8:34   ` David Marchand
2021-10-14 17:47     ` Medvedkin, Vladimir
2021-10-14 17:48   ` [dpdk-dev] [PATCH v3] " Vladimir Medvedkin
2021-10-15  9:33     ` David Marchand
2021-10-15 13:02       ` Medvedkin, Vladimir
2021-10-19  7:02         ` David Marchand
2021-10-19 15:57           ` Medvedkin, Vladimir [this message]
2021-10-20 19:54             ` David Marchand
2021-10-20 20:49               ` Wang, Yipeng1
2021-10-21  7:40     ` David Marchand

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:

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

  git send-email \
    --in-reply-to=21a6e602-1138-b8bb-e5c1-ff9c6c314c59@intel.com \
    --to=vladimir.medvedkin@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=sameh.gobriel@intel.com \
    --cc=stable@dpdk.org \
    --cc=yipeng1.wang@intel.com \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git