DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] power: fix use-after-free in pstate code
@ 2021-04-07 15:56 Anatoly Burakov
  2021-04-07 16:10 ` David Hunt
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Anatoly Burakov @ 2021-04-07 15:56 UTC (permalink / raw)
  To: dev; +Cc: david.hunt, thomas

Previous fix has addressed the incorrect handling of `base_frequency`
file, but has added a use-after-free error due to the fact that all
further code paths will lead to an `fclose()` call at the end, so the
additional `fclose()` call right after processing the file was
unnecessary.

Coverity issue: 369901

Fixes: 8a5febaac4f7 ("power: fix P-state base frequency handling")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_power/power_pstate_cpufreq.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/librte_power/power_pstate_cpufreq.c b/lib/librte_power/power_pstate_cpufreq.c
index 1cb0e4d917..ec745153d3 100644
--- a/lib/librte_power/power_pstate_cpufreq.c
+++ b/lib/librte_power/power_pstate_cpufreq.c
@@ -220,7 +220,6 @@ power_init_for_setting_freq(struct pstate_power_info *pi)
 
 		base_ratio = strtoul(buf_base, NULL, POWER_CONVERT_TO_DECIMAL)
 				/ BUS_FREQ;
-		fclose(f_base);
 	}
 
 	/* Add MSR read to detect turbo status */
-- 
2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-04-15 21:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07 15:56 [dpdk-dev] [PATCH] power: fix use-after-free in pstate code Anatoly Burakov
2021-04-07 16:10 ` David Hunt
2021-04-15 21:29   ` Thomas Monjalon
2021-04-07 16:18 ` Liang Ma
2021-04-07 16:31 ` Burakov, Anatoly
2021-04-07 16:53   ` Burakov, Anatoly
2021-04-07 17:08     ` Liang Ma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).