47 Commits
Author SHA1 Message Date
Robert Swiecki 7b89f383f3 clang-format: IndentCaseLabels: false 2023-09-25 21:24:01 +02:00
Robert Swiecki 8c38013b70 make indent 2023-09-17 10:25:53 +02:00
David CARLIER 5625158934 set the current process as init process on FreeBSD. 2022-11-22 21:35:13 +00:00
David Carlier dfdc68f646 arch_getPC: netbsd arm64 support. 2021-11-11 19:05:01 +00:00
Robert Swiecki 918bdd95e9 respectful vocabulary: white->allow, black->block, master->main 2021-02-15 22:30:58 +01:00
Robert Swiecki f2d9a489ad make indent 2021-02-09 01:54:18 +01:00
Robert Swiecki f3ad76c8ee make indent 2020-12-18 02:51:08 +01:00
Robert Swiecki 03bbc2de98 make indent 2020-08-26 16:11:06 +02:00
Robert Swiecki fb133c8a39 make indent depend 2020-07-22 21:12:08 +02:00
Kamil Rytarowski 872ab1c0ff netbsd: Fix PC and SI_ADDR in arch_traceSaveData() 2020-07-01 11:16:30 +02:00
Robert Swiecki 5fa5d0a1ae make indent 2020-06-17 09:07:34 +02:00
Kamil Rytarowski 19a83f17bc Improve NetBSD compatibility
Stop using install -t as it is GNU specific. Replace it with a
portable construct.

Before reading with ptrace(2) from address 0x0, check whether
the VA0 is mappable into the process, as otherwise the ptrace(2)
call will return EINVAL.

Stop intercepting fork(2) events as they are ignored anyway.

Document PTRACE_POSIX_SPAWN events.

Use PT_SET_SIGPASS to disable notifying the parent about
uninteresting signals. The only interesting ones are crash signals,
SIGABRT and SIGSYS. Everything else is directly passed to the
traced process.
2020-06-11 14:37:57 +02:00
Robert Swiecki 649e48630a subproc: simpler subproc_StatusToStr()) 2020-05-05 20:24:41 +02:00
Robert Swiecki 7c881b3c53 netbsd: unused arg 2020-05-04 13:42:23 +02:00
Robert Swiecki bbb476eec9 New directives in .clang-format 2020-04-29 16:14:09 +02:00
Robert Swiecki e13b2fc9af netbsd: netbsd-specific run_t is not needed 2020-04-25 14:44:30 +02:00
Robert Swiecki 773c933853 all: rename linux/netbsd to arch_linux/arch_netbsd as -std=gnu11 complains about linux as an identifier 2020-04-23 23:22:28 +02:00
Robert Swiecki 6c70071872 all: use struct dynfile_t inside run_t 2020-03-25 16:17:41 +01:00
Robert Swiecki 365ca5be86 arch: move arch.c logging to subproc.c 2020-01-20 16:00:45 +01:00
Robert Swiecki 9d11e5aeb7 subproc: move argument generation to subproc.c 2020-01-20 00:50:54 +01:00
Robert Swiecki 36ddc3bbc4 */arch.c: fix https://github.com/google/honggfuzz/issues/302 - check ret value of strstr 2020-01-19 20:08:01 +01:00
Robert Swiecki 58874e1098 netbsd: generate report 2019-12-05 16:46:14 +01:00
Robert Swiecki 9eafcc6813 report: move report generating to report.c 2019-12-05 15:53:39 +01:00
Robert Swiecki 1586d05ebb netbsd: use funcs_t from sanitizers.h 2019-12-04 23:28:30 +01:00
Robert Swiecki 749eea52e3 sanitizers: move arch_hashCallstack to sanitizers 2019-12-04 21:17:50 +01:00
Robert Swiecki 199428ed6f sanitizers/linux: remove monitorSIGABRT convention: now SIGABRT is always monitored. For Android another option will be implemented to avoid extensive SIGABRT system logging - 'kill upon SIGABRT' 2019-12-04 17:45:12 +01:00
Robert Swiecki 657bf2d13b netbsd: remove socketfuzzer from this arch (never tested) 2019-09-22 08:26:18 +02:00
Robert Swiecki e46d5f31fa No need to use a special signal to emulate SIGUSR1 2019-09-03 14:03:26 +02:00
Robert Swiecki d0baec1f78 arch: use shorter form of concatenating strings 2019-08-28 17:34:30 +02:00
Robert Swiecki 65880af52e */arch.c: use _HF_INPUT_FD instead of run->dynamicFileFd b/c the latter if O_CLOEXEC 2019-08-28 13:06:29 +02:00
Robert Swiecki 99559afa16 subproc: allow to use ___FILE___ and -s with persistent mode 2019-08-27 22:45:02 +02:00
Robert Swiecki bbc55ad54a netbsd/mac: use EINTR loop for wait 2019-02-19 08:52:56 +01:00
Robert Swiecki 64d52436fd create a signal thread to distribute SIGCHLD as SIGUSR1 2019-02-14 23:02:13 +01:00
Robert Swiecki a95a8f8e3a netbsd: wait for the whole session, should catch all fork'd processes 2019-02-10 15:37:27 +01:00
Robert Swiecki 185565714e netbsd: wait logic 2019-02-10 14:53:02 +01:00
Robert Swiecki 91a61ec103 time limit checks based on USR1 2019-02-10 11:52:28 +01:00
Robert Swiecki 9e30850dfa netbsd: netbsd doesn't use sigsuspend 2019-01-30 23:31:05 +01:00
Robert Swiecki f6e0f9278d netbsd: some fixes for netbsd 8 2019-01-30 19:09:41 +01:00
Robert Swiecki 12738cd034 netbsd: make it compile again 2019-01-30 16:35:53 +01:00
Robert Swiecki 98e2337238 ALL: remove -p (pid), simplify the subproc state machine. NetBSD will stop working for some time, will be fixed in the coming days 2019-01-30 11:50:18 +01:00
Robert Swiecki 8267c77c0b sancov: remove, since it's old (clang-4), slower, and requires complex code. Android seems to be supporting in-process counters now 2018-08-23 23:21:40 +02:00
Robert Swiecki 38ce20c4c4 netbsd/linux: unwind correct includes 2018-08-21 21:20:48 +02:00
Robert Swiecki d60975a8ca netbsd: include with prefix 2018-08-21 20:10:08 +02:00
Kamil Rytarowski bde3da8d7a NetBSD related fixups
Add more mentions of NetBSD in README.md.
Correct dependency file in Makefile linux/unwind.h -> netbsd/unwind.h.
Restore removed include <sys/types.h> in netbsd/arch.c and netbsd/trace.h
and decorate it with clang-format attributes.
2018-08-20 11:29:45 +02:00
Robert Swiecki 518d4d2cc0 make indent depend 2018-08-19 04:12:35 +02:00
Kamil Rytarowski e84db36007 Fixes for fuzzing on NetBSD with concurrent fuzzer-threads
Do not support fuzzing forkees and vforkees. Doing so is non-trivial
in the current design of the fuzzer, as there is need to call wait(2)
function dedicated for every forkee and vforkee in a thread. In the
context of fuzzing in multiple instances of multiple processes this
means that there is need a redesign of the threading/process model
and wait(2)ing every tracee with a dedicated thread or iteration step
in a loop (perhaps try kqueue(2)/kevent(2)?).

A wait(2)-like function called for WAIT_ANY caused gathering reports
from other fuzzer-threads and in the result abnormal hangs.

While there, do not discard SIGTRAP that is emitted by user, and pass
this signal to the tracee.
2018-08-17 04:26:51 +02:00
Kamil Rytarowski 45a1cf406b Add ptrace(2) backend for NetBSD
Model this code after existing Linux backend and try to keep differences
to minimum.

Features and design choices, compared to the Linux code:
 - capstone dependency as a disassembler
 - no bfd support
 - -D_KERNTYPES for register_t type
 - no clone() support
 - no disable ASLR switch (personality)
 - no libunwind support, there is no port of HP libunwind version
 - no hardware assisted profiling aid support
 - traditional PT_ATTACH in place of 'seize' operation
 - poll(2) detecting of signals, instead of sigtimedwait(2) which
   didn't work for unknown reasons
 - no cross-ABI support (i386 on amd64 host)
 - currently only amd64 and i386 support

Missing or incomplete features are subject for improvement.

Tested with NetBSD/amd64 8.99.23
2018-08-15 06:26:26 +02:00