leancrypto: drop redundant <linux/prctl.h> include

secure_execution_linux.c includes both <sys/prctl.h> and
<linux/prctl.h>; musl's <sys/prctl.h> already declares everything
needed, and including the raw uapi header afterwards redefines struct
prctl_mm_map.

AI-Generated: Uses Claude Code

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
Khem Raj committed 2026-09-29 09:57:23 -07:00
1 parent c65a95a35b
commit 4847409c77
2 files changed
+36

No files matched your search

@@ -0,0 +1,35 @@
From: Khem Raj <khem.raj@oss.qualcomm.com>
Date: Tue, 29 Sep 2026 02:14:39 +0000
Subject: [PATCH] secure_execution_linux: drop redundant linux/prctl.h include
<sys/prctl.h> alone already provides everything this file needs
(PR_SET_SPECULATION_CTRL, the PR_SPEC_* constants, and struct
prctl_mm_map on libcs that define it). Do not also include
<linux/prctl.h>: musl's <sys/prctl.h> defines struct prctl_mm_map
unconditionally, and <linux/prctl.h> defines the identical struct with
no compatibility guard against it, so including both is a hard
"redefinition of 'prctl_mm_map'" error.
Upstream-Status: Pending
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
diff --git a/internal/src/secure_execution_linux.c b/internal/src/secure_execution_linux.c
index 7264edf..df57a88 100644
--- a/internal/src/secure_execution_linux.c
+++ b/internal/src/secure_execution_linux.c
@@ -17,7 +17,14 @@
* DAMAGE.
*/
-#include <linux/prctl.h>
+/*
+ * <sys/prctl.h> alone already provides everything this file needs
+ * (PR_SET_SPECULATION_CTRL, the PR_SPEC_* constants, and on some libcs
+ * struct prctl_mm_map). Do not also include <linux/prctl.h>: musl's
+ * <sys/prctl.h> defines struct prctl_mm_map unconditionally, and
+ * <linux/prctl.h> defines the identical struct with no compatibility
+ * guard against it, so including both is a hard "redefinition" error.
+ */
#include <sys/prctl.h>
#include "ext_headers_internal.h"
@@ -13,6 +13,7 @@ LIC_FILES_CHKSUM = " \
SECTION = "libs"
SRC_URI = "git://github.com/smuellerDD/leancrypto.git;branch=master;protocol=https;tag=v${PV} \
file://leancrypto-tests.sh \
file://0001-secure_execution_linux-drop-redundant-linux-prctl.h-.patch \
"
SRCREV = "0110b781707c7bdde88482933811387b744d21eb"