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 77445A04A9; Tue, 25 Jan 2022 08:29:49 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B5BA4282D; Tue, 25 Jan 2022 08:29:49 +0100 (CET) Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by mails.dpdk.org (Postfix) with ESMTP id 90F9D4013F for ; Tue, 25 Jan 2022 08:29:47 +0100 (CET) Received: by mail-pj1-f47.google.com with SMTP id o64so19101694pjo.2 for ; Mon, 24 Jan 2022 23:29:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id; bh=wIiIkD3LejrFxtt5GR5OSQvO63Ru7jNCMos7Di5BjlE=; b=IIAllBXTkihBQoykYMisEz10Kh/xBSwyrLS+fjmFlJmnKKF5+71megDYlCoxLEUFLS jhOF0+P4PSWUKdibo1Lqs0Fjum0YoOsE+x3v7ARPKETNgW0FXyjHifXcf/aiGo8lwQAT mAEMQCPmbNeVHiRsrpg3XBM880+SpIfJi9+pc0PLi4hyinr5CNtXQNxq8AG95psc1uVs V17U4nOslG0Sy8fH0mndL1ZpdtmA3AiFFfCjxeKbXp2/owNeBT/DFZbp93c0FIng0Ycu +8YClTUeDqcvJW/J47HVH+17YOwzQtnT91tEpMyQ/gMzU92ScJw1vAKPN1Xxqt4kVMvd xbLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=wIiIkD3LejrFxtt5GR5OSQvO63Ru7jNCMos7Di5BjlE=; b=5zHnoz8sMvAp5Jm6qokIo/+EaK+CcF8IHrYERc38+7Sle/+AYAVwf/vi/GH1V6XvMg 3HidJMjqzjywzqVeTExv0apD17WaE0Ovo0xU6kDzC/dNUMjEr7U5DzSjrqu8SVFqrv8q aNdstkLZ1/mwW/mjjpP1vJIkxyR6rZynhvlIH3LRc6fZrge6o+U8SqNrl6NoTOOuDkOR Ts1uEcTXVVK9fu/2CzIfWsOUr/B5kxxzuSUIhcTWWkMcfoHR8tJddnukH+V5Ge73Hfj/ k3897hQGmQdWAY/t2dNRHjS9M/OydSIzlOCJ9Prdj6rJwFctE20AOquHoho9CZ0OPog0 o/7Q== X-Gm-Message-State: AOAM532MHxSlQHqbUi+7KyXaR5jB8XTju/0k45wkObGkVzLsYz3JZeSU z2Rak8XCOcCefMQCQReutrQ= X-Google-Smtp-Source: ABdhPJx63mGdC3s6N9RMZfeGTLFV6vuC+4/3JJqIw5vau9opX0CcpEbTptkoQmnM7Qy6/idWmndDSA== X-Received: by 2002:a17:902:ecc5:b0:14b:3d4c:450 with SMTP id a5-20020a170902ecc500b0014b3d4c0450mr11057652plh.22.1643095786832; Mon, 24 Jan 2022 23:29:46 -0800 (PST) Received: from localhost.localdomain ([223.223.179.210]) by smtp.gmail.com with ESMTPSA id 17sm18815430pfl.175.2022.01.24.23.29.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 23:29:46 -0800 (PST) From: Zhiheng Chen To: Konstantin Ananyev Cc: dev@dpdk.org, Zhiheng Chen Subject: [PATCH] examples/l3fwd-acl:memset the acl matching result array Date: Tue, 25 Jan 2022 07:29:15 +0000 Message-Id: <20220125072915.17083-1-chenzhiheng0227@gmail.com> X-Mailer: git-send-email 2.17.1 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 If we don't memset acl result array before matching, we can get arbitrary dirty data from memory. Signed-off-by: Zhiheng Chen --- examples/l3fwd-acl/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index 1fb1807235..7b9539b3ca 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -738,6 +738,9 @@ prepare_acl_parameter(struct rte_mbuf **pkts_in, struct acl_search_t *acl, acl->num_ipv4 = 0; acl->num_ipv6 = 0; + memset(acl->res_ipv4, 0, sizeof(acl->res_ipv4)); + memset(acl->res_ipv6, 0, sizeof(acl->res_ipv6)); + /* Prefetch first packets */ for (i = 0; i < PREFETCH_OFFSET && i < nb_rx; i++) { rte_prefetch0(rte_pktmbuf_mtod( -- 2.32.0