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 B888DA0A02 for ; Tue, 27 Apr 2021 15:57:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A25D7406A3; Tue, 27 Apr 2021 15:57:29 +0200 (CEST) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mails.dpdk.org (Postfix) with ESMTP id 0A8BB406A3 for ; Tue, 27 Apr 2021 15:57:29 +0200 (CEST) Received: by mail-wm1-f52.google.com with SMTP id p6-20020a05600c3586b029014131bbe5c7so3920807wmq.3 for ; Tue, 27 Apr 2021 06:57:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VfINqeiD86YITRTtfagZANV36qf1rp6DiIOWtDCBBSE=; b=XBqWUAQc3ySx8UIvb/OD2xx02WrSc3ZEI8iLzBCAhNYfi0PZfteHvawvu2751I2sKP kitaxB40mGTZNnsAMIohZlIOEGxCW0fr0aGjh/Kirh9DZSRBgkIpdYLcwzUwyaYbUkQB wW22ojnaIlN19qRZHXSOGQrFW0YtPah3KhTo2n2IfzTkfuGQLLfb9jLvF1D+5vuPrCNG gqF6saaPtd6s8LHbO97+L7ERDN5V9obrNx0MvXC89gx67+YYFZ90n5AdMChldl11cQ5d noG+7y4Ofl9qtg3P4XTfNkEufkw37wNsxC04onYNcIYfR9uX1Hn/Hi5D3MvOwddFBGbL HRAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VfINqeiD86YITRTtfagZANV36qf1rp6DiIOWtDCBBSE=; b=O5uR6/Q/hsI0a86HX5SJcIoAdDJDjuipy+1uCCh24My8yxvnr7QXKarMLJXBNdqfN8 w9boaWWVTck6+QEPlauJc5is6jdpYMykqGXUjpV1fZz8kPhcg1JCtt7TUaMtZ/kym2fb THyQQk6gebNfq6iQW0u1NmjvRLlB9+bV8gC0P8b4XVBK+2YjFYvJ5NViDHgMbvVKkb8s usGfSjZZrEr9jF1q9xlwnarPZR06JgldOcVdXSZPPDacbIlWbPFD9LlQcIA1qet/qAWC zJQfyv7F6AWeAVwJfFJZvZ6jY79M7qyoW5L7Z7SYhvCazBpMxilXP3TR+AWioBapbUMU rIcw== X-Gm-Message-State: AOAM533dnhZcHa7HXdh577ncFMtfaEnV2CJQNYcOdF3mPcslwDp0Rs90 TFKYuShzMVOPqpBGjwqCnf75HQ== X-Google-Smtp-Source: ABdhPJwgKe75WLuDsjMmhtnW7K+4F+z5STCOf85nvABnnuA6gIHOvn1gjaOhpNCqs8KnibrnEej2AA== X-Received: by 2002:a7b:cd85:: with SMTP id y5mr4492087wmj.93.1619531848815; Tue, 27 Apr 2021 06:57:28 -0700 (PDT) Received: from gojira.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id m14sm11760341wmi.39.2021.04.27.06.57.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 06:57:28 -0700 (PDT) From: Olivier Matz To: dev@dpdk.org Cc: Andrew Rybchenko , Pallantla Poornima , Wenwu Ma , Peng Zhihong , Aaron Conole , Thomas Monjalon , stable@dpdk.org Date: Tue, 27 Apr 2021 15:56:45 +0200 Message-Id: <20210427135646.871-1-olivier.matz@6wind.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210413200513.330399-1-wenwux.ma@intel.com> References: <20210413200513.330399-1-wenwux.ma@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v3 1/2] test/mempool: fix heap 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" The function rte_pktmbuf_init() expects that the mempool private area is large enough and was previously initialized by rte_pktmbuf_pool_init(), which is not the case. This causes the function rte_pktmbuf_priv_size() to return an unpredictable value, and this value is used as a size in a memset. Replace the mempool object initializer by my_obj_init(), which does not have this constraint, and fits the needs for this test. Fixes: 923ceaeac140 ("test/mempool: add unit test cases") Cc: stable@dpdk.org Signed-off-by: Wenwu Ma --- app/test/test_mempool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test/test_mempool.c b/app/test/test_mempool.c index 084842fdaa..3adadd6731 100644 --- a/app/test/test_mempool.c +++ b/app/test/test_mempool.c @@ -552,7 +552,7 @@ test_mempool(void) GOTO_ERR(ret, err); /* test to initialize mempool objects and memory */ - nb_objs = rte_mempool_obj_iter(mp_stack_mempool_iter, rte_pktmbuf_init, + nb_objs = rte_mempool_obj_iter(mp_stack_mempool_iter, my_obj_init, NULL); if (nb_objs == 0) GOTO_ERR(ret, err); -- 2.29.2