Project

General

Profile

Actions

Bug #465

closed

coreboot-toolchain builder reports failed build as succeeded

Added by Felix Singer about 1 year ago. Updated about 1 year ago.

Status:
Resolved
Priority:
High
Assignee:
-
Category:
Continuous integration
Start date:
03/01/2023
Due date:
% Done:

0%

Estimated time:

Description

When a build should fail, the coreboot-toolchain builder reports it as succeeded.

 * gcc-12.2.0.tar.xz
   o gcc-12.2.0_ada-musl_workaround.patch
   o gcc-12.2.0_asan_shadow_offset_callback.patch
The text leading up to this was:
--------------------------
|From 41a82fb711f3637b4b7f57756492b628058f9d5f Mon Sep 17 00:00:00 2001
|From: Harshit Sharma <harshitsharmajs@gmail.com>
|Date: Fri, 10 Jul 2020 13:06:08 -0700
|Subject: [PATCH] crossgcc: Enable GCC to get asan shadow offset at runtime
|
|Unlike Linux kernel which has a static shadow region layout, we have multiple stages in
|coreboot and thus require a different shadow offset address. Unfortunately, GCC currently
|only supports adding a static shadow offset at compile time using -fasan-shadow-offset flag.
|
|For this reason, we enable GCC to determine asan shadow offset address at runtime using a
|callback function named __asan_shadow_offset(). This supersedes the need to specify this
|address at compile time. GCC then makes use of this shadow offset to protect stack buffers
|by inserting red zones around them.
|
|Some other benefits of having this GCC patch are:
|a. We can place the shadow region in a separate linker section with all its advantages like
|   automatic fit insurance. This ensures if a platform doesn't have enough memory space to
|   hold shadow region, the build will fail. (However, if we use a fixed shadow offset on a
|   platform that actually doesn't have enough memory, it may still build without any errors.)
|b. We don't modify the memory layout compared to the current one, as we are placing the
|   shadow region at the end of the space already occupied by the program.
|c. We can be much more flexible later if needed (thinking of other stages like bootblock).
|d. Since we are appending the shadow buffer to the region already occupied, we make efficient
|   use of the limited memory available which is highly beneficial when using cache as ram.
|
|Further, we have made sure that if you compile you tree with ASan enabled but missed this
|patch, it will end up in the following compilation error:
|"invalid --param name 'asan-use-shadow-offset-callback'"
|So, you cannot accidentally enable the feature without having your compiler patched.
|
|[pgeorgi: Updated for gcc 11.1]
|
|Signed-off-by: Harshit Sharma <harshitsharmajs@gmail.com>
|Signed-off-by: Patrick Georgi <pgeorgi@google.com>
|
|diff --git a/gcc/asan.c b/gcc/asan.c
|index 235e21947..713bf994d 100644
|--- a/gcc/asan.c
|+++ b/gcc/asan.c
--------------------------
File to patch: 
Skip this patch? [y] 
1 out of 1 hunk ignored

Failed patches/gcc-12.2.0_asan_shadow_offset_callback.patch.
make[3]: *** [Makefile:20: build_gcc] Error 1
make[2]: *** [Makefile:36: build-i386] Error 2
make[1]: *** [Makefile:12: all] Error 2
make: *** [util/crossgcc/Makefile.inc:25: crossgcc] Error 2
+ true
+ export XGCCPATH=/cb-build/coreboot-toolchain.0/xgcc/bin
Actions #1

Updated by Felix Singer about 1 year ago

  • Priority changed from Normal to High
Actions #2

Updated by Felix Singer about 1 year ago

  • Status changed from New to Resolved
Actions

Also available in: Atom PDF