Fix bugs and add security features to redbean

- Fix a regression with the previous change that broke redbean
- Add chroot(), resource limit, seccomp, and other stuff to redbean
- Write lots and lots of documentation
- Iron out more system call issues
This commit is contained in:
Justine Tunney 2022-04-18 00:01:26 -07:00
parent f1dfa4bdfa
commit 7166679620
182 changed files with 1855 additions and 918 deletions

View file

@ -194,7 +194,7 @@
#define kNtErrorEaListInconsistent 255
#define kNtErrorNoMoreItems 259
#define kNtErrorCannotCopy 266
#define kNtErrorDirectory 267
#define kNtErrorDirectory 267 /* EISDIR */
#define kNtErrorEasDidntFit 275
#define kNtErrorEaFileCorrupt 276
#define kNtErrorEaTableFull 277
@ -238,7 +238,7 @@
#define kNtErrorNotRedundantStorage 333
#define kNtErrorResidentFileNotSupported 334
#define kNtErrorCompressedFileNotSupported 335
#define kNtErrorDirectoryNotSupported 336 /* EISDIR */
#define kNtErrorDirectoryNotSupported 336
#define kNtErrorNotReadFromCopy 337
#define kNtErrorFtWriteFailure 338
#define kNtErrorFtDiScanRequired 339
@ -1102,7 +1102,7 @@
#define kNtErrorResourceTypeNotFound 1813
#define kNtErrorResourceNameNotFound 1814
#define kNtErrorResourceLangNotFound 1815
#define kNtErrorNotEnoughQuota 1816
#define kNtErrorNotEnoughQuota 1816 /* EDQUOT */
#define kNtErrorInvalidTime 1901
#define kNtErrorInvalidFormName 1902
#define kNtErrorInvalidFormSize 1903

View file

@ -0,0 +1,15 @@
.include "o/libc/nt/codegen.inc"
.imp kernel32,__imp_ExitThread,ExitThread,0
.text.windows
ExitThread:
push %rbp
mov %rsp,%rbp
.profilable
mov %rdi,%rcx
sub $32,%rsp
call *__imp_ExitThread(%rip)
leave
ret
.endfn ExitThread,globl
.previous

View file

@ -303,6 +303,7 @@ imp 'EnumerateLocalComputerNamesA' EnumerateLocalComputerNamesA kernel32 3
imp 'EraseTape' EraseTape kernel32 352
imp 'EscapeCommFunction' EscapeCommFunction kernel32 0
imp 'ExecuteUmsThread' ExecuteUmsThread kernel32 354
imp 'ExitThread' ExitThread kernel32 0 1
imp 'ExitProcess' ExitProcess kernel32 0 1 # a.k.a. RtlExitUserProcess
imp 'ExitVDM' ExitVDM kernel32 357
imp 'ExpandEnvironmentStrings' ExpandEnvironmentStringsW kernel32 0