History

Fix boundschecking fork for macos/SELINUX

lib/bcheck.c: - Use INIT_SEM for child process fork on macos tests/tests2/Makefile: - tcc -run does not work for fork due to SHARED mmap

herman ten brugge committed 6 years ago

Commit d55e5861 parent 61c0c852 files · +5 −1Browse files

Unified · Split

2 files
  1. lib/bcheck.c +4 −1
  2. tests/tests2/Makefile +1 −0
lib/bcheck.c+4−1
@@ -1376,7 +1376,10 @@ pid_t fork(void) · 1375 unmodified lines
13761376
13771377 WAIT_SEM();
13781378 retval = (*fork_redir)();
1379− POST_SEM();
1379+ if (retval == 0)
1380+ INIT_SEM();
1381+ else
1382+ POST_SEM();
13801383 return retval;
13811384 }
13821385 #endif
tests/tests2/Makefile+1−0
@@ -94,6 +94,7 @@ GEN-ALWAYS = · 93 unmodified lines
9494 ./a.exe
9595
9696 114_bound_signal.test: FLAGS += -b
97+114_bound_signal.test: NORUN = true # tcc -run does not support fork and -b and SELINUX
9798 115_bound_setjmp.test: FLAGS += -b
9899 116_bound_setjmp2.test: FLAGS += -b
99100 117_builtins.test: T1 = ( $(TCC) -run $1 && $(TCC) -b -run $1 )

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t