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 F238A45D07; Thu, 14 Nov 2024 19:45:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BE3924025D; Thu, 14 Nov 2024 19:45:03 +0100 (CET) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mails.dpdk.org (Postfix) with ESMTP id 0461842ECB for ; Thu, 14 Nov 2024 19:45:02 +0100 (CET) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-21145812538so8389425ad.0 for ; Thu, 14 Nov 2024 10:45:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731609902; x=1732214702; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wgWHoz2VMCZWR+QHi3SE2oETvk+acQdMzaUbGgHWZ+E=; b=RHX0xWgYftVGeQ0zJcVfeM4PYLBkksgS56ycJwAFNMpPy2hx2dlnOREH2ZfjR8eLb7 jaW3lZVKZ2bnHOienr2YOo82cyaXKjQqQ/KrcxJChWC9TKz1qHh2DDY5kYZt5rkkcs+h m6MDiizaXRiCqSAuQGNzs+FwlFPWor9XTqKLorgSxxk/nm03NyUqb45nQL7Dt30BAlVx vzUXPmcCSgXkTshUpzBGCIuG5jTZG3XN/GBlZ/cUq3kk342rMDoDTy4UBRdLWuu5+tnM 0GvelQLKJe7TJ/khiyU8FvWyISXg3xbWwYYcvS67zZE1gYgYH1llixFXA8BXsOJQTBH2 htyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731609902; x=1732214702; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wgWHoz2VMCZWR+QHi3SE2oETvk+acQdMzaUbGgHWZ+E=; b=bHahtFQcXDWojmez21zUIL6aHRvwmGr6ptWGygkmbqRpBpDyDT/omz3zBYJDdkcGJX NrG15pPlqvuz56HvmSw/DlAE8e9fmfyDgY9NL+O2B7tG6KTmKS+zyftufQuXIL6u7TG5 exriFxl52vVoDa17MZ3Ru3CGln81KCnWcHuvSLp09c1+Bk3yhEDGDgq6bxofVkouJlqf 8A/TMG9TGvl512Rdkf5cVtbI7xnFf2n1kl2rKZPf5Rnxwqgs8niOZlIPfjfVtVEs9tiA rZnkAARWekH5efQ7OFbhc3jfWYPz5VWz7H3u9gvuQTDzUkydWqdDf5gmda/elx7tM8vn wQmA== X-Gm-Message-State: AOJu0YybeHzzcs88OWL19rKkyGBABp/FtA8SxEfXHRuEE8iwnsq1+s7e AWpTsJdleTPofisJtsDCylRs5DLOZJ9OPa5E0wz21VCdAWXvWCKrFzUyEGNIigEhH6Zt9bQfSHX X21Y= X-Google-Smtp-Source: AGHT+IFSLXiyk5oDSmY0K13oknpgHdwFXO7u2+URRoN5G+MtkcpPcIHzGbeCwo1EV2whJM1ra3jaxw== X-Received: by 2002:a17:902:ce84:b0:211:31ac:89f7 with SMTP id d9443c01a7336-21183cebaf3mr313294335ad.26.1731609902039; Thu, 14 Nov 2024 10:45:02 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea06ef71a6sm1517611a91.8.2024.11.14.10.45.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 10:45:01 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v4 00/12] memset security fixes Date: Thu, 14 Nov 2024 10:43:22 -0800 Message-ID: <20241114184452.31854-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241114011129.451243-1-stephen@networkplumber.org> References: <20241114011129.451243-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 This series handles memset related bugs indentified by PVS Studio. The root cause is that Gcc and other compilers are free to optimize away memset called before free. Most of the places memset was being used like this were bogus; probably some developer debug habit, and can be safely removed. v4 - review feedback - remove more Napatech NIC unnecessary memset Stephen Hemminger (12): eal: introduce new secure memory fill eal: add new secure free function crypto/qat: force zero of keys crypto/qat: fix size calculation for memset crypto/qat: use secure memset bus/uacce: remove memset before free compress/octeontx: remove unnecessary memset test: remove unneeded memset net/ntnic: remove unnecessary void cast net/ntnic: check result of malloc net/ntnic: remove unnecessary memset devtools/cocci: add script to find problematic memset app/test/test_cmdline_cirbuf.c | 2 -- devtools/cocci/memset_free.cocci | 20 +++++++++++++ drivers/bus/uacce/uacce.c | 1 - drivers/compress/octeontx/otx_zip.c | 1 - drivers/compress/octeontx/otx_zip_pmd.c | 2 -- drivers/crypto/qat/qat_asym.c | 5 +--- drivers/crypto/qat/qat_sym_session.c | 27 +++++++++-------- drivers/net/ntnic/nim/i2c_nim.c | 2 +- drivers/net/ntnic/nthw/core/nthw_hif.c | 5 +--- drivers/net/ntnic/nthw/core/nthw_iic.c | 5 +--- drivers/net/ntnic/nthw/core/nthw_pcie3.c | 5 +--- drivers/net/ntnic/nthw/core/nthw_rpf.c | 5 +--- drivers/net/ntnic/nthw/core/nthw_sdc.c | 5 +--- drivers/net/ntnic/nthw/core/nthw_si5340.c | 5 +--- .../ntnic/nthw/flow_filter/flow_nthw_cat.c | 7 ++--- .../ntnic/nthw/flow_filter/flow_nthw_csu.c | 7 ++--- .../ntnic/nthw/flow_filter/flow_nthw_flm.c | 7 ++--- .../ntnic/nthw/flow_filter/flow_nthw_hfu.c | 7 ++--- .../ntnic/nthw/flow_filter/flow_nthw_hsh.c | 7 ++--- .../ntnic/nthw/flow_filter/flow_nthw_ifr.c | 2 +- .../ntnic/nthw/flow_filter/flow_nthw_info.c | 7 ++--- .../net/ntnic/nthw/flow_filter/flow_nthw_km.c | 7 ++--- .../ntnic/nthw/flow_filter/flow_nthw_pdb.c | 7 ++--- .../ntnic/nthw/flow_filter/flow_nthw_qsl.c | 7 ++--- .../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c | 7 ++--- .../ntnic/nthw/flow_filter/flow_nthw_slc_lr.c | 7 ++--- .../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c | 3 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_ins.c | 7 ++--- .../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c | 7 ++--- .../net/ntnic/nthw/model/nthw_fpga_model.c | 1 - drivers/net/ntnic/nthw/nthw_rac.c | 4 ++- drivers/net/ntnic/ntnic_ethdev.c | 2 +- lib/eal/common/rte_malloc.c | 30 +++++++++++++++---- lib/eal/include/rte_malloc.h | 18 +++++++++++ lib/eal/include/rte_string_fns.h | 27 +++++++++++++++++ lib/eal/version.map | 3 ++ 36 files changed, 146 insertions(+), 125 deletions(-) create mode 100644 devtools/cocci/memset_free.cocci -- 2.45.2