Commit Graph

3011 Commits

Author SHA1 Message Date
kamil
be61ec4715 Remove debug printf(3)
No functional change.

Sponsored by <The NetBSD Foundation>
2017-01-27 16:43:07 +00:00
kamil
71f5b91f6d Add new tests signal{9,10} in t_ptrace_wait{,3,4,6,id,pid}
signal9:
    Verify that masking SIGTRAP in tracee does not stop tracer from
    catching PTRACE_LWP_CREATE breakpoint

signal10:
    Verify that masking SIGTRAP in tracee does not stop tracer from
    catching PTRACE_LWP_EXIT breakpoint

Both tests are broken and linked with PR kern/51918.

Sponsored by <The NetBSD Foundation>
2017-01-27 16:35:47 +00:00
kamil
a7e8e90e67 Add new test signal8 in t_ptrace_wait{,3,4,6,id,pid}
signal8:
    Verify that masking SIGTRAP in tracee does not stop tracer from
    catching PTRACE_VFORK_DONE breakpoint

This test is marked as broken and linked with PR kern/51918.

Sponsored by <The NetBSD Foundation>
2017-01-27 16:06:23 +00:00
hannken
a9f23b81d0 Add test for read/write to readonly update mount. 2017-01-27 10:45:11 +00:00
nat
712047004e Revert to previous. Audio passes the test properly again. 2017-01-27 05:14:54 +00:00
kamil
fa3933b2b8 Add new tests signal[67] in t_ptrace_wait{4,6,id,pid}
signal6:
    Verify that masking SIGTRAP in tracee does not stop tracer from
    catching PTRACE_FORK breakpoint

signal7:
    Verify that masking SIGTRAP in tracee does not stop tracer from
    catching PTRACE_VFORK breakpoint

signal6 fails due to PR kern/51918
signal6 fails due to PR kern/51918 and PR kern/51630

Sponsored by <The NetBSD Foundation>
2017-01-27 00:34:52 +00:00
kamil
ac522b683c Add new test signal5 in t_ptrace_wait{,3,4,6,id,pid}
signal5:
    Verify that masking SIGTRAP in tracee does not stop tracer from
    catching exec() breakpoint

signal5 is failing and linked with PR kern/51918

Sponsored by <The NetBSD Foundation>
2017-01-26 22:46:19 +00:00
kamil
a34102a3aa Add new test signal4 in t_ptrace_wait{,3,4,6,id,pid}
signal4:
    Verify that masking SIGTRAP in tracee does not stop tracer from
    catching single step trap

signal4 is marked as failing and referenced with PR kern/51918.

Sponsored by <The NetBSD Foundation>
2017-01-26 22:32:48 +00:00
kamil
a17a9cedbb Add new tests signal[23] in t_ptrace_wait{,3,4,6,id,pid}
signal2:
    Verify that masking SIGTRAP in tracee stops tracer from
    catching this raised signal

signal3:
    Verify that masking SIGTRAP in tracee does not stop tracer from
    catching software breakpoints

signal3 is marked as failing and refrenced with PR kern/51918
Currently signal3 requires code for other architectures than x86_64

Sponsored by <The NetBSD Foundation>
2017-01-26 20:15:44 +00:00
kamil
7da544b6ff Add new test signal1 in t_ptrace_wait{,3,4,6,id,pid}
signal1:
    Verify that masking single unrelated signal does not stop tracer
    from catching other signals

Sponsored by <The NetBSD Foundation>
2017-01-26 17:03:21 +00:00
kamil
905db9de05 Add io_read_auxv1 in t_ptrace_wait{,3,4,6,id,pid}
io_read_auxv1:
    Verify PT_READ_AUXV called for tracee

Sponsored by <The NetBSD Foundation>
2017-01-25 17:01:57 +00:00
maya
1d815938de use isinf instead of isinff. this doesn't introduce a functional change -
isinf works for float as well, and is more portable.

from Ngie Cooper in PR bin/51838
2017-01-20 21:15:56 +00:00
ozaki-r
ac86ae25b9 Protect if_clone data with if_clone_mtx
To this end, carpattach needs to be delayed from RUMP_COMPONENT_NET to
RUMP_COMPONENT_NET_IF on rump_server. Otherwise mutex_enter via carpattach
for if_clone_mtx is called before mutex_init for it in ifinit1.
2017-01-20 08:35:33 +00:00
kamil
3a94491317 Use siginfo_t to validate tests/kernel/arch/amd64/t_ptrace_wait*
This change makes sure that the fired expected watchpoint with expected
property. It's done with PT_GET_SIGINFO and checking SIGTRAP codes.

Sponsored by <The NetBSD Foundation>
2017-01-18 05:14:34 +00:00
kamil
4e1719ea5b Refactor ptrace_watchpoint structure to allow extensions
Add new field pw_type in the ptrace_watchpoint structure.

amd64 and i386 offer the current set of watchpoints as
PTRACE_PW_TYPE_DBREGS.

On other archs than x86, there are readily available different types of
hardware assisted watchpoints like for code-only or data-only registers on
ARM. Also in future there is an option to implement MMU-based watchpoints
and future per-port or per-cpu extensions.

Next step is to alter this interface on x86 to generate SIGTRAP with
si_code TRAP_HWWTRAP with additional information on occurred event:
 - which watchpoint fired,
 - additional watchpoint-type specific information, like on amd64 with
   PTRACE_PW_TYPE_DBREGS.:
   * only watchpoint fired
   * watchpoint fired and single step occurred

Adjust ATF tests for the pw_type change.

Sponsored by <The NetBSD Foundation>
2017-01-16 21:35:59 +00:00
christos
acb4286257 beware of your shadow 2017-01-16 19:07:06 +00:00
christos
7eebfad669 PR/51894: Ngie Cooper: Use /dev/zero to read instead of stdin 2017-01-16 16:35:57 +00:00
christos
6d9b7137e8 PR/51893: Ngie Cooper: prevent toolchain from optimizing out memset call 2017-01-16 16:34:24 +00:00
christos
424ba067d9 PR/51892: Ngie Cooper: add __unused to osi in the sigaction handler 2017-01-16 16:32:13 +00:00
christos
f8bd60ee57 PR/51891: Ngie Cooper: use sys/disklabel.h instead of machine/disklabel.h 2017-01-16 16:31:05 +00:00
christos
78c0e08e9b PR/51885: Ngie Cooper: Add delays to avoid races. 2017-01-16 16:29:54 +00:00
christos
2d6ff91c6a PR/51884: Ngie Cooper: Include and message fixes 2017-01-16 16:29:19 +00:00
christos
9ac9a14dec PR/51886: Ngie Cooper: Use _exit instead of exit 2017-01-16 16:28:27 +00:00
christos
75e7228cd4 PR/51887: Ngie Cooper: Include and error message fixes 2017-01-16 16:27:43 +00:00
christos
138b5d077b PR/51890: Ngie Cooper: include and error message fixes. 2017-01-16 16:27:06 +00:00
christos
ab92520e8c PR/51888: Ngie Cooper: more error checking, missing includes 2017-01-16 16:23:41 +00:00
christos
17284898e1 PR/51889: Ngie Cooper: add sys/time.h 2017-01-16 16:22:22 +00:00
ozaki-r
cc5766bfdd Rewrite tests for CARP in a shell script instead of C
The new shell script enables us to modify/add tests easily.
2017-01-16 08:18:11 +00:00
christos
2162d23666 PR/51874: Ngie Cooper: Add __unused to signal handlers 2017-01-14 21:08:17 +00:00
christos
32eb699ff6 PR/51873: Ngie Cooper: add util.h #include 2017-01-14 20:59:23 +00:00
christos
468d6e2ffc PR/51872: Ngie Cooper: call sem_unlink after :basic and :child 2017-01-14 20:58:20 +00:00
christos
153621e321 PR/51871: Ngie Cooper: add fcntl.h for O_* fcntl/open constants 2017-01-14 20:57:24 +00:00
christos
dcc3af2fc9 PR/51868: Ngie Cooper: mkfifo does not return an fd 2017-01-14 20:55:26 +00:00
christos
5f5a00ced0 PR/51867: Ngie Cooper: misc cleanups 2017-01-14 20:52:42 +00:00
christos
80210e1441 Pr/51866: Ngie Cooper: fix leak and release limit on memory to prevent
false positives with mlock/mmap
2017-01-14 20:51:13 +00:00
christos
cd517fb06c PR/51815: Ngie Cooper: don't leak dlopen'ed handle 2017-01-14 20:49:24 +00:00
christos
b318113857 PR/51825: Ngie Cooper: use the non _ version of the macro 2017-01-14 20:47:41 +00:00
christos
c3359ffa01 PR/51876: Ngie Cooper: kyua 0.11 $TMPDIR fixes 2017-01-14 20:45:16 +00:00
christos
8684dbb301 PR/51875: Ngie Cooper: portability fixes 2017-01-14 20:43:52 +00:00
kamil
ac2c008382 Add additional check for pe_report_event in lwp_{create,exit}1
This caught bug that currently PTRACE_LWP_EXIT is reported as
PTRACE_LWP_CREATE.

Sponsored by <The NetBSD Foundation>
2017-01-14 19:17:10 +00:00
kamil
6413a1acf0 Introduce PTRACE_LWP_{CREATE,EXIT} in ptrace(2) and TRAP_LWP in siginfo(5)
Add interface in ptrace(2) to track thread (LWP) events:
 - birth,
 - termination.

The purpose of this thread is to keep track of the current thread state in
a tracee and apply e.g. per-thread designed hardware assisted watchpoints.

This interface reuses the EVENT_MASK and PROCESS_STATE interface, and
shares it with PTRACE_FORK, PTRACE_VFORK and PTRACE_VFORK_DONE.

Change the following structure:

typedef struct ptrace_state {
        int     pe_report_event;
        pid_t   pe_other_pid;
} ptrace_state_t;

to

typedef struct ptrace_state {
        int     pe_report_event;
        union {
                pid_t   _pe_other_pid;
                lwpid_t _pe_lwp;
        } _option;
} ptrace_state_t;

#define pe_other_pid    _option._pe_other_pid
#define pe_lwp          _option._pe_lwp

This keeps size of ptrace_state_t unchanged as both pid_t and lwpid_t are
defined as int32_t-like integer. This change does not break existing
prebuilt software and has minimal effect on necessity for source-code
changes. In summary, this change should be binary compatible and shouldn't
break build of existing software.


Introduce new siginfo(5) type for LWP events under the SIGTRAP signal:
TRAP_LWP. This change will help debuggers to distinguish exact source of
SIGTRAP.


Add two basic t_ptrace_wait* tests:
lwp_create1:
    Verify that 1 LWP creation is intercepted by ptrace(2) with
    EVENT_MASK set to PTRACE_LWP_CREATE

lwp_exit1:
    Verify that 1 LWP creation is intercepted by ptrace(2) with
    EVENT_MASK set to PTRACE_LWP_EXIT

All tests are passing.


Surfing the previous kernel ABI bump to 7.99.59 for PTRACE_VFORK{,_DONE}.

Sponsored by <The NetBSD Foundation>
2017-01-14 06:36:52 +00:00
kamil
14d6312469 Add new tests eventmask[34] in t_ptrace_wait{,3,4,6,id,pid}
eventmask3:
    Verify that PTRACE_VFORK in EVENT_MASK is preserved

eventmask4:
    Verify that PTRACE_VFORK_DONE in EVENT_MASK is preserved

Currently eventmask3 is failing and marked with PR kern/51630

Sponsored by <The NetBSD Foundation>
2017-01-14 04:37:55 +00:00
pgoyette
ea3582b27e Set FILESBUILD=yes to actually run the creation script for the file.
Should fix the build by creating a file which install can then find.
2017-01-14 03:59:58 +00:00
christos
0ac9d4eb29 better name 2017-01-14 01:33:32 +00:00
christos
6a94a0768f PR/51832: Ngie Cooper:
- limit memory to 64M
- error msg fixes
- includes fixes
2017-01-14 00:50:56 +00:00
christos
81da05f641 Do things in a less intrusive way. 2017-01-14 00:33:19 +00:00
kamil
c35cdcf1bb Update t_ptrace_wait* tests for added support for PTRACE_VFORK{,_DONE}
PTRACE_VFORK and PTRACE_VFORK_DONE are now parts of <sys/ptrace.h>.

PTRACE_VFORK tests are still failing as the support for it is currently
a stub.

Sponsored by <The NetBSD Foundation>
2017-01-13 23:22:12 +00:00
christos
c54cb81102 Don't play with "../.." in includes for h_macros.h; deal with it centrally.
Minor fixes.
2017-01-13 21:30:39 +00:00
christos
6e9c6546e8 PR/51859: Ngie Cooper: use closefrom/restore RLIMIT_NOFILE when done 2017-01-13 21:19:45 +00:00
christos
9398a6c8c6 PR/51861: Ngie Cooper: Sprinkle __unused, mark __dead, _exit(). 2017-01-13 21:18:33 +00:00