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 0337B45CF9; Wed, 13 Nov 2024 19:09:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF92740A7A; Wed, 13 Nov 2024 19:09:30 +0100 (CET) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mails.dpdk.org (Postfix) with ESMTP id AF6A0406BC for ; Wed, 13 Nov 2024 19:09:28 +0100 (CET) Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-20cceb8d8b4so7592505ad.1 for ; Wed, 13 Nov 2024 10:09:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731521368; x=1732126168; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=CCjr8rUTGTh1G7jGdMdASb9udNc4P8sCzzj9DrLtRpE=; b=DFDvOZ/xlTIze7hfoNixeWTpqLeINRBi9Q6NLs3K7UH/yjZTHDFlFginN5IhcqF8Eg +BjRk4yf7Zv6Fczz2MX4Shs8TJwEYiVtqXRv/dRe7AAsyNrKF7AEMOnaQFhxwWKAPG2Z UPKvzc4u9KGFNlC66tVhKhzzzgvqF5oPnIfj2gKeLVSz20SRvE/5mdU40nCeUOoc9iBR tJU10pVNOxWK/I7Vu+5GPgLuT8EkTnDN/fqL5f063AbRPailapmcc3AV21o30Laisbpl 5GmvqpWMzQpB7DUaZz1yr8Hnt1zwecipqPWQEQqGMWz/wXP8RyMaMyDvrhl4X0UQygGF zFdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731521368; x=1732126168; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CCjr8rUTGTh1G7jGdMdASb9udNc4P8sCzzj9DrLtRpE=; b=UXuQsfrnzE/BaiF47LbEvOCS8UXONfUtxDTZfQ98OpSv+mjSeomNN97J2l3ljh6utH +e9UCTzgq01S9QK3IP3Jc1/OAHIvien1Cx0YJUdpCbjgOTVrlpfxt9yo5yVUWj6zQLzW ApQVEvylcKqwzE1h3uZuBkAFye5C6ZSOCGNKOsWXnfxsSLeoK44jjwTsOSeF9dyzToQ/ m+KBB1HD5fzyDuYt63L6m7nR5MoIRQKjG0rkJJNpnECbhOHZ1Bw65KlrVCTjwFsu6UUG ksMPbmGTujUgiad6RZQDWZaaHU0I1jqAuvfwgx+wHRYfP5b0Sj0vhhtRJfpKGL8mSnuE vgMw== X-Gm-Message-State: AOJu0YwRfjcEpde1+QTZ6ghjh0aA9wXYZCtn7PxczfABlQupomW+QIpV LEcq9Mz+hPYlIQcXpxLWCCGnI9Udbrv5ZIu9UggCr/mM6PCiHVKTomIwgIzmNaY= X-Google-Smtp-Source: AGHT+IFZEeZPDAUKalLBrQYf84+pqagldkPiH+KebRVvCe+vxXrTjNY65T/8G6oku6bE1N3AprdZKA== X-Received: by 2002:a17:902:f691:b0:20f:c225:f2a5 with SMTP id d9443c01a7336-211c0f1f1f3mr4939625ad.10.1731521367661; Wed, 13 Nov 2024 10:09:27 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21177e413aesm110833525ad.123.2024.11.13.10.09.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2024 10:09:27 -0800 (PST) Date: Wed, 13 Nov 2024 10:09:25 -0800 From: Stephen Hemminger To: Serhii Iliushyk Cc: dev@dpdk.org, mko-plv@napatech.com, ckm@napatech.com, andrew.rybchenko@oktetlabs.ru, ferruh.yigit@amd.com, Oleksandr Kolomeiets Subject: Re: [PATCH v3 15/50] net/ntnic: add hasher (HSH) flow module Message-ID: <20241113100925.0ec31ec7@hermes.local> In-Reply-To: <20241010141416.4063591-16-sil-plv@napatech.com> References: <20241006203728.330792-2-sil-plv@napatech.com> <20241010141416.4063591-1-sil-plv@napatech.com> <20241010141416.4063591-16-sil-plv@napatech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Thu, 10 Oct 2024 16:13:30 +0200 Serhii Iliushyk wrote: > + > +void hsh_nthw_delete(struct hsh_nthw *p) > +{ > + if (p) { > + (void)memset(p, 0, sizeof(*p)); > + free(p); > + } > +} This pattern of memset before free is repeated many times in ntnic and is problematic. The compiler is free to remove the memset because the object p is now dead and is common source of CVE's. This flagged in the PVS studio bug report https://pvs-studio.com/en/blog/posts/cpp/1183/ In this case the info in hsh_nthw does not contain secrets and therefore the memset should be removed. For cases where the data structure does contain secrets, the function memset_s() must be used.