ANDROID: modpost: generate protected exports

These are symbols that unsigned modules may not export.

* kernel/module/internal.h - declares protected exports
* modpost generates protected-exports.c - defines protected exports

Bug: 393366754
Change-Id: I3e6d630542875e35754126e64bc279313fc131b9
Signed-off-by: Sid Nayyar <sidnayyar@google.com>
This commit is contained in:
Sid Nayyar
2025-01-30 09:49:53 -08:00
parent 54bfd8db38
commit 48559833d1
3 changed files with 77 additions and 1 deletions
+8
View File
@@ -420,3 +420,11 @@ static inline int same_magic(const char *amagic, const char *bmagic, bool has_cr
return strcmp(amagic, bmagic) == 0;
}
#endif /* CONFIG_MODVERSIONS */
#ifdef CONFIG_MODULE_SIG_PROTECT
extern const char *const protected_symbol_exports[];
extern size_t protected_symbol_exports_count;
#else
#define protected_symbol_exports NULL
#define protected_symbol_exports_count 0UL
#endif