Commit Graph

3000 Commits

Author SHA1 Message Date
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
christos
f3f1ae73bf PR/51862: Ngie Cooper: don't leak buf 2017-01-13 21:16:38 +00:00
christos
1b5bdd34e2 PR/51860: Ngie Cooper: don't leak fd 2017-01-13 21:15:57 +00:00
christos
f4c1dfe02d PR/51857: Ngie Cooper: mark signo __unused for -Wunused 2017-01-13 21:15:14 +00:00
agc
a5445b4eea also terminate 2 other statements properly 2017-01-13 21:09:12 +00:00
agc
56556fc2dc terminate the statement properly 2017-01-13 21:00:59 +00:00
christos
35c57c2fc8 PR/51858: Ngie Cooper: don't leak buf 2017-01-13 20:46:15 +00:00
christos
93538aec95 PR/51856: Ngie Cooper: add limits.h for INT_MAX 2017-01-13 20:44:45 +00:00
christos
26e010503c PR/51847: Ngie Cooper: More error checks, add __unused 2017-01-13 20:44:10 +00:00
christos
666a964a93 PR/51855: Ngie Cooper: fix leaks 2017-01-13 20:43:11 +00:00
christos
86d82e08a1 PR/51853: Ngie Cooper: add limits.h for MAXPATHLEN in FreeBSD 2017-01-13 20:42:36 +00:00
christos
10ef6baaf5 PR/51854: Ngie Cooper: sys/socket.h include and check result from socket(2) 2017-01-13 20:41:50 +00:00