]> git.ipfire.org Git - pakfire.git/commitdiff
file: Whitelist libgcc_so.* and libmvec.so.* from SSP check
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 24 Mar 2023 09:41:16 +0000 (09:41 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 24 Mar 2023 09:41:16 +0000 (09:41 +0000)
libgcc_s.so cannot be built with SSP, at least it will create some
problems linking start files later on.

libmvec should generally not be on here, but all the assembly magic
seems to confuse something so that it won't be linked okay.

Fixes: #13069
Fixes: #13070
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/file.c

index d375a9a75f93fd1d61dd3ebba8ab0a2472fb3775..f49e9a9aef8fbeee087b84711fe3ed4b834370d6 100644 (file)
@@ -2109,6 +2109,13 @@ static int __pakfire_file_check_ssp(
 }
 
 static int pakfire_file_check_ssp(struct pakfire_file* file) {
+       // This check will be skipped for these files
+       static const char* whitelist[] = {
+               "/usr/lib64/libgcc_s.so.*",
+               "/usr/lib64/libmvec.so.*",
+               NULL,
+       };
+
        // Do not perform this check for runtime linkers
        if (pakfire_file_matches_class(file, PAKFIRE_FILE_RUNTIME_LINKER))
                return 0;
@@ -2117,6 +2124,15 @@ static int pakfire_file_check_ssp(struct pakfire_file* file) {
        if (file->issues & PAKFIRE_FILE_MISSING_DEBUGINFO)
                return 0;
 
+       // Check if this file is whitelisted
+       for (const char** path = whitelist; *path; path++) {
+               if (pakfire_file_matches(file, *path)) {
+                       DEBUG(file->pakfire, "Skipping SSP check for whitelisted file %s\n",
+                               pakfire_file_get_path(file));
+                       return 0;
+               }
+       }
+
        return pakfire_file_open_elf(file, __pakfire_file_check_ssp, NULL);
 }