File tree Expand file tree Collapse file tree 4 files changed +35
-8
lines changed Expand file tree Collapse file tree 4 files changed +35
-8
lines changed Original file line number Diff line number Diff line change 1
1
# SPDX-License-Identifier: GPL-2.0-or-later
2
2
3
- CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined -static-libasan $(KHDR_INCLUDES )
3
+ CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined $(KHDR_INCLUDES )
4
+
5
+ # gcc requires -static-libasan in order to ensure that Address Sanitizer's
6
+ # library is the first one loaded. However, clang already statically links the
7
+ # Address Sanitizer if -fsanitize is specified. Therefore, simply omit
8
+ # -static-libasan for clang builds.
9
+ ifeq ($(LLVM ) ,)
10
+ CFLAGS += -static-libasan
11
+ endif
12
+
4
13
TEST_GEN_PROGS := fchmodat2_test
5
14
6
15
include ../lib.mk
Original file line number Diff line number Diff line change @@ -125,8 +125,16 @@ static uint32_t old_root_id, old_parent_id;
125
125
126
126
static void cleanup_namespace (void )
127
127
{
128
- fchdir (orig_root );
129
- chroot ("." );
128
+ int ret ;
129
+
130
+ ret = fchdir (orig_root );
131
+ if (ret == -1 )
132
+ ksft_perror ("fchdir to original root" );
133
+
134
+ ret = chroot ("." );
135
+ if (ret == -1 )
136
+ ksft_perror ("chroot to original root" );
137
+
130
138
umount2 (root_mntpoint , MNT_DETACH );
131
139
rmdir (root_mntpoint );
132
140
}
Original file line number Diff line number Diff line change 1
1
# SPDX-License-Identifier: GPL-2.0-or-later
2
2
3
- CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined -static-libasan
3
+ CFLAGS += -Wall -O2 -g -fsanitize=address -fsanitize=undefined
4
4
TEST_GEN_PROGS := openat2_test resolve_test rename_attack_test
5
5
6
+ # gcc requires -static-libasan in order to ensure that Address Sanitizer's
7
+ # library is the first one loaded. However, clang already statically links the
8
+ # Address Sanitizer if -fsanitize is specified. Therefore, simply omit
9
+ # -static-libasan for clang builds.
10
+ ifeq ($(LLVM ) ,)
11
+ CFLAGS += -static-libasan
12
+ endif
13
+
14
+ LOCAL_HDRS += helpers.h
15
+
6
16
include ../lib.mk
7
17
8
- $(TEST_GEN_PROGS ) : helpers.c helpers.h
18
+ $(TEST_GEN_PROGS ) : helpers.c
Original file line number Diff line number Diff line change @@ -194,14 +194,14 @@ int main(int argc, char *argv[])
194
194
ksft_set_plan (7 );
195
195
196
196
ksft_print_msg ("Running on:\n" );
197
- ksft_print_msg ("" );
197
+ ksft_print_msg ("%s" , " " );
198
198
system ("uname -a" );
199
199
200
200
ksft_print_msg ("Current BPF sysctl settings:\n" );
201
201
/* Avoid using "sysctl" which may not be installed. */
202
- ksft_print_msg ("" );
202
+ ksft_print_msg ("%s" , " " );
203
203
system ("grep -H . /proc/sys/net/core/bpf_jit_enable" );
204
- ksft_print_msg ("" );
204
+ ksft_print_msg ("%s" , " " );
205
205
system ("grep -H . /proc/sys/net/core/bpf_jit_harden" );
206
206
207
207
affinity ();
You can’t perform that action at this time.
0 commit comments