From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AE661A0C4B; Thu, 21 Oct 2021 09:41:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6EEFD410E2; Thu, 21 Oct 2021 09:41:08 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 73D7340142 for ; Thu, 21 Oct 2021 09:41:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634802066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=88E9XGVM+8u8XFkMcAdIZgte+esI3UNvOa4VuJStHgg=; b=IB0tm4G1iDmN807A01A1Qc7tEu+kopHUxFdwtzPveTxrEB5grdKIiBPtolRmGXDJ8fA3+3 BLN2FiWuXVCAWFYtSYuXq2zF+oLk1D0OZqxlz1yxMC4IGlH//v32U8mJfFRqHQIYJaL0qS 8F9c8Oe1fvRFkahGfHDlH0+sPSBItBc= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-123-k_Uqcqm4PKSkbIqKCQgz0g-1; Thu, 21 Oct 2021 03:40:57 -0400 X-MC-Unique: k_Uqcqm4PKSkbIqKCQgz0g-1 Received: by mail-lj1-f197.google.com with SMTP id w9-20020a2e9989000000b00210af61ebbdso2499407lji.2 for ; Thu, 21 Oct 2021 00:40:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=88E9XGVM+8u8XFkMcAdIZgte+esI3UNvOa4VuJStHgg=; b=voiN/+fMlH6GVsZMdxoSRMpjMp/q3k3QNwYA0FwivVJq4oqyyk/rpo86mQzkWfgAIx jROzRL7KjiZ3CaNzLbYTBfA7TQGE1e0vRKyuDHktB+7HXS5s7qZ66R2IPEJ0fSKmdGOC MwBTzTUHLyvy4EjX0KPbFTpEUvp3lvF4HABt0jP+ig4lLktHbwFhnHKqkavhTpwNI96+ YqjEAA7F0Wuz8ftTe3EsGhUuv+0fVZgVVRGXaM8DeBm7VOyNxnt4km0Y8ZIH2N1G2sSO NC1mf0ZYKVT0MKWfuIzwpesYmW/A8uYNXOL2zmGir+ulmEKoOGjlbwD+dg4yvEnQNPfZ tJTw== X-Gm-Message-State: AOAM530gYveCrhsJayYPxlLJTnER5vJGX9A2mfTLYVK1R2ay86vYtQ1G jpk8phnXwZf+Ndjk+bT2uO0wCSdDnIlDgTOw0NlHWns03iZsiS69eS29mvREu3fxj45rXNEONdR DSWKCe33EyVqcw2mDYKY= X-Received: by 2002:a19:c514:: with SMTP id w20mr4033656lfe.265.1634802056111; Thu, 21 Oct 2021 00:40:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKiq4knMYE2AVvCDC+bGsL25nA/kkWlImFxx1eQKxN3v+J+R2DHgPbGsgy7qKfOKA+rfzRIcGqcdOIJ7quuak= X-Received: by 2002:a19:c514:: with SMTP id w20mr4033640lfe.265.1634802055935; Thu, 21 Oct 2021 00:40:55 -0700 (PDT) MIME-Version: 1.0 References: <1634153265-193315-1-git-send-email-vladimir.medvedkin@intel.com> <1634233699-197151-1-git-send-email-vladimir.medvedkin@intel.com> In-Reply-To: <1634233699-197151-1-git-send-email-vladimir.medvedkin@intel.com> From: David Marchand Date: Thu, 21 Oct 2021 09:40:44 +0200 Message-ID: To: Vladimir Medvedkin Cc: dev , "Wang, Yipeng1" , "Gobriel, Sameh" , Bruce Richardson , dpdk stable Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v3] test/hash: fix buffer overflow X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Oct 14, 2021 at 7:55 PM Vladimir Medvedkin wrote: > > This patch fixes buffer overflow reported by ASAN, > please reference https://bugs.dpdk.org/show_bug.cgi?id=818 > > Some tests for the rte_hash table use the rte_jhash_32b() as > the hash function. This hash function interprets the length > argument in units of 4 bytes. > > This patch adds a wrapper function around rte_jhash_32b() > to reflect API differences regarding the length argument, > effectively dividing it by 4. > > For some tests rte_jhash() is used with keys of length not > a multiple of 4 bytes. From the rte_jhash() documentation: > If input key is not aligned to four byte boundaries or a > multiple of four bytes in length, the memory region just > after may be read (but not used in the computation). > > This patch increases the size of the proto field of the > flow_key struct up to uint32_t. > > Bugzilla ID: 818 > Fixes: af75078fece3 ("first public release") > Cc: stable@dpdk.org > > Signed-off-by: Vladimir Medvedkin Acked-by: Yipeng Wang Removed a few comments in code (about previous size of flow_key struct), and applied. Thanks. -- David Marchand