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 57059A0C4B for ; Thu, 21 Oct 2021 09:41:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 482F440142; Thu, 21 Oct 2021 09:41:12 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 7C654411A2 for ; Thu, 21 Oct 2021 09:41:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634802070; 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=Wq6jcVy1vD/5zFqjQZtUhVCntyRrb8RhufReXMyxjdlOzs6DRoCcoUfaeyj7vZw4wi4mSC E5gAiYucpT3WJFQPDzhrgSk2OIyfW9bpiKI27hgCuLaaeiBJbG7oJjsKAj9uuWMWPxTukK b9kvVzhCj+gdhGMMLY2ulKGeOYFiL9E= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-570-p-t4YQ-DObW6kK3ObSUqDA-1; Thu, 21 Oct 2021 03:40:57 -0400 X-MC-Unique: p-t4YQ-DObW6kK3ObSUqDA-1 Received: by mail-lj1-f199.google.com with SMTP id 132-20020a2e058a000000b00210aeaca823so2499604ljf.10 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=Btq3v44xQbewK+Jw/Z2JmYwWZKU9iKSZIPznOia64GFA9GJ/YKVZvg4l43iLDm2jTU SFDESNdnYN8ExN+jpTF0443bum1RcqzFW+6AUe8xpmFUSBfM2yDhsgzoTbXgAmySYZjb 6jp7N3giDvqkoWRMt3gUF5cOqZ/vQRoLLAsd0SKcep4PinEGrMmK7oZuMkXsxVA/cVVJ Qmkpdstrk/L4kxeMBkSuTSU14U97WkFzap1MNWtrv2hRUp75EdxtCtfsCsm2ZdhuXNjs cWife0TXICtFMD4Eb/eo7B3WXI6+U1LNfo2SR2VQszVE4SLnaYs1nbNNAdSpyFcKLNgQ 9qjQ== X-Gm-Message-State: AOAM532BMmLb1L8ppQDjQoAq7zjK3Y5KQDQIvX58CJ4KI6ESmSMYENWj uW1CIrl2sLuTaogWTBJzPJiQCu+c73JQeUO56OwW7rL9zM6SL1HCdkRgUY2Fx9nl5ou0/oJcq8q rGUDfIgSnWDoxxb/tlYdaDHY= X-Received: by 2002:a19:c514:: with SMTP id w20mr4033672lfe.265.1634802056271; 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-stable] [PATCH v3] test/hash: fix buffer overflow X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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