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 BF44645D07; Thu, 14 Nov 2024 19:46:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7E47442F1F; Thu, 14 Nov 2024 19:45:19 +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 BC44A42EEA for ; Thu, 14 Nov 2024 19:45:12 +0100 (CET) Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-2ea0bd709c0so623332a91.3 for ; Thu, 14 Nov 2024 10:45:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731609912; x=1732214712; 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=idTH83QPuPUB4nE7t7uOf3jgYu/jje9+dCnxy6EY5HI=; b=zqSulME3mwS3dYb7JN+uDG/6NN3riL1epyl3TMZ6993Z04HbbhNgIAGs8zJX8hbqxx rBPfDbpCQXWmfBp9naoGrI3quH5/59ihumDUDor3R9aNLP3IrOIEfQqDo6o/pLlo1imf y0cXkyok+23ii2A4z1LDVPC0+XpuisG7N/Kb2wfekCIO+007Z2V5e0NYUUbo/DYqPUaJ UVp3rOrw8riZ+FQEI3OBnh65hmc9WdoaBvHAfH31y6OB1hmGyNaEGlmr4jxY4WwxxsJA qLTuf1iYG5WSyYk/HpL9szKa74bXnoSB/5I08ss1Cc0H+LQlC256TjJW3pIWylA8QWhM uAjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731609912; x=1732214712; 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=idTH83QPuPUB4nE7t7uOf3jgYu/jje9+dCnxy6EY5HI=; b=HQp+QY+4xsBPfPmhwiLb1hg+N5v4+c77zYnGfdTacnk4GtEm91hyE8OZye0u5Ts7MQ VBW2u4JWThUbp0a7ZWmhUBgP5bxHKOXXNKY5DcuStMdMZINJKh/rbWc/k1EMwPxiUb5B t3LuE5SyEX8gMWeM59zCMifQv83Yo/7znZbp5tj7/EhoSGtxS/Ci432Dmcr59g8MTfHC UcIZkIe048+M0ZF7v3SWh+R0veCFC3x0c2p0VDQiVxRpO7KvU1JmXOBFsEbqUTkQ1AXi kvtwH/z4DQfGyQxzwauiatgO7taI02Kxhvsm2ebMyo3xGiYmWmIGecVPu3ukw23C4LFw VV4A== X-Gm-Message-State: AOJu0Yz0hfO25kfCQWnT1DI0h2yhZi+WK6IoccZApjcTt3NLe+P3mqtF XKnDCdd0HDjRZScuhseaDbiSHruAWsqktVb7xPakl5Jeefwfdq79q5dZePMtPPiwBp394QBUBqK 8TIU= X-Google-Smtp-Source: AGHT+IFZjCh9Yx6ysxQ7D9+Nsg5vq0O4UpzD1ubhDf036t39K662AS/0CgZJ4740fhfote6Xpro2AA== X-Received: by 2002:a17:90b:4f47:b0:2e2:af52:a7b7 with SMTP id 98e67ed59e1d1-2ea06ab3892mr3091127a91.34.1731609911997; Thu, 14 Nov 2024 10:45:11 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 10:45:11 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v4 12/12] devtools/cocci: add script to find problematic memset Date: Thu, 14 Nov 2024 10:43:34 -0800 Message-ID: <20241114184452.31854-13-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241114184452.31854-1-stephen@networkplumber.org> References: <20241114011129.451243-1-stephen@networkplumber.org> <20241114184452.31854-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 Script that converts memset before free into rte_memset_sensitive and memset before rte_free into rte_free_sensitive Signed-off-by: Stephen Hemminger --- devtools/cocci/memset_free.cocci | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 devtools/cocci/memset_free.cocci diff --git a/devtools/cocci/memset_free.cocci b/devtools/cocci/memset_free.cocci new file mode 100644 index 0000000000..834c5dbf2b --- /dev/null +++ b/devtools/cocci/memset_free.cocci @@ -0,0 +1,20 @@ +// Replace calls to memset before free +@@ +expression E, size; +@@ +( +- memset(E, 0, size); +- free(E); ++ rte_memset_sensitive(E, 0, size); ++ free(E); +) + +// replace to memset before rte_free +@@ +expression E, size; +@@ +( +- memset(E, 0, size); +- rte_free(E); ++ rte_free_sensitive(E); +) -- 2.45.2