From cbd3b113ac4536b5cb99e18a0ca4b125a8a73885 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 16 May 2026 20:33:32 -0700 Subject: [PATCH] lib/arm/cpu_features.c: Use O_CLOEXEC when opening files Best practice for libraries is to use O_CLOEXEC. --- lib/arm/cpu_features.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/arm/cpu_features.c b/lib/arm/cpu_features.c index 7b2584b7..a4008ca9 100644 --- a/lib/arm/cpu_features.c +++ b/lib/arm/cpu_features.c @@ -68,7 +68,7 @@ static void scan_auxv(unsigned long *hwcap, unsigned long *hwcap2) int filled = 0; int i; - fd = open("/proc/self/auxv", O_RDONLY); + fd = open("/proc/self/auxv", O_RDONLY | O_CLOEXEC); if (fd < 0) return; @@ -149,7 +149,7 @@ static bool arm64_cpu_is_neoverse_v_class(void) u32 part; fd = open("/sys/devices/system/cpu/cpu0/regs/identification/midr_el1", - O_RDONLY); + O_RDONLY | O_CLOEXEC); if (fd < 0) return false; do {