Commit Graph

258310 Commits

Author SHA1 Message Date
christos bf7113376a Create a new bsd.hostinit.mk file and put the build definitions for all host
programs there; make all Makefiles that use bsd.hostprog.mk include it.
Namely turn off MKREPRO and don't make lint, man pages, info files etc.
Remove the Makefile.inc files that contained these same settings, and
remove the settings from Makefile.host
2018-05-01 19:59:42 +00:00
jmcneill 86f4652d7f Add support for Allwinner H6 CCU. 2018-05-01 19:53:14 +00:00
christos 7351a5d259 Add the netpgp lua bindings so that the compat build can build them. 2018-05-01 19:50:34 +00:00
christos 1c314fb9c7 Apply the same fixes from the regular tools dir:
PR/53238: Robert Elz: Disable MKREPRO in tools; the host compiler might
not support the necessary options. This is done thusly:

1. Create Makefile.inc and set MKREPRO=no in it. Change the Makefiles that
   include bsd.own.mk, to include bsd.init.mk which includes Makefile.inc
   first. This will also allow us to control other tools options from a
   single location if we need to.
2. Centralize NOMAN handling.

XXX: pullup-8
2018-05-01 17:42:00 +00:00
kamil 385d9c8955 Implement PTRACE_VFORK
Add support for tracing vfork(2) events in the context of ptrace(2).

This API covers other frontends to fork1(9) like posix_spawn(2) or clone(2),
if they cause parent to wait for exec(2) or exit(2) of the child.

Changes:
 - Add new argument to sigswitch() determining whether we need to acquire
   the proc_lock or whether it's already held.
 - Refactor fork1(9) for fork(2) and vfork(2)-like events.
   Call sigswitch() from fork(1) for forking or vforking parent, instead of
   emitting kpsignal(9). We need to emit the signal and suspend the parent,
   returning to user and relock proc_lock.
 - Add missing prototype for proc_stop_done() in kern_sig.c.
 - Make sigswitch a public function accessible from other kernel code
   including <sys/signalvar.h>.
 - Remove an entry about unimplemented PTRACE_VFORK in the ptrace(2) man page.
 - Permin PTRACE_VFORK in the ptrace(2) frontend for userland.
 - Remove expected failure for unimplemented PTRACE_VFORK tests in the ATF
   ptrace(2) test-suite.
 - Relax signal routing constraints under a debugger for a vfork(2)ed child.
   This intended to protect from signaling a parent of a vfork(2)ed child that
   called PT_TRACE_ME, but wrongly misrouted other signals in vfork(2)
   use-cases.

Add XXX comments about still existing problems and future enhancements:
 - correct vfork(2) + PT_TRACE_ME handling.
 - fork1(2) handling of scenarios when a process is collected in valid but
   rare cases.

All ATF ptrace(2) fork[1-8] and vfork[1-8] tests pass.

Fix PR kern/51630 by Kamil Rytarowski (myself).

Sponsored by <The NetBSD Foundation>
2018-05-01 16:37:23 +00:00
maya eddea7af1c GC private 802.11 rateset declarations, use the standard ones.
Build tested only.
2018-05-01 16:18:13 +00:00
maya 7f9869f85f Fix ALL configs following MPVERBOSE becoming a defparam
XXX i386 ALL kernel build is failing
2018-05-01 16:16:05 +00:00
kamil b9541a3a67 Add additional hardening in PT_TRACE_ME and PT_ATTACH
Prohibit:
 - calling PT_TRACE_ME by initproc (PID1),
 - calling PT_ATTACH by initproc (PID1).

PID1 and its parent cannot become a tracer.

Sponsored by <The NetBSD Foundation>
2018-05-01 14:09:53 +00:00
kamil ff43c343b5 Improve the proc_stoptrace() function
proc_stoptrace() is dedicated for emitting a syscall trap for a debugger,
either on entry or exit of the system function routine.

Changes:
 - Change an if() branch of an invalid condition of being traced by
   initproc (PID1) to KASSERT(9).
 - Assert that the current process has set appropriate flags (PSL_TRACED
   and PSL_SYSCALL).
 - Use ktrpoint(KTR_PSIG) and ktrpsig()/e_ktrpsig() in order to register
   the emitted signal for the ktrace(1) event debugging.

Example of the new output from kdump(1) for the syscall debugger traps,
containing SIGTRAP notification with TRAP_SCE and TRAP_SCX (around
the getpid(2) call).

$ kdump /tmp/1.dat.qemu |grep 663
   588      1 t_ptrace_waitpid RET   fork 663/0x297
   663      1 t_ptrace_waitpid EMUL  "netbsd"
   663      1 t_ptrace_waitpid RET   fork 0
   663      1 t_ptrace_waitpid CALL  ptrace(PT_TRACE_ME,0,0,0)
   663      1 t_ptrace_waitpid RET   ptrace 0
   663      1 t_ptrace_waitpid CALL  _lwp_self
   663      1 t_ptrace_waitpid RET   _lwp_self 1
   663      1 t_ptrace_waitpid CALL  _lwp_kill(1,0x11)
   663      1 t_ptrace_waitpid RET   _lwp_kill 0
   588      1 t_ptrace_waitpid RET   __wait450 663/0x297
   663      1 t_ptrace_waitpid CALL  getpid
   588      1 t_ptrace_waitpid RET   __wait450 663/0x297
   663      1 t_ptrace_waitpid PSIG  SIGTRAP SIG_DFL: code=TRAP_SCE, addr=0x0, trap=0)
   663      1 t_ptrace_waitpid RET   getpid 663/0x297, 588/0x24c
   588      1 t_ptrace_waitpid RET   __wait450 663/0x297
   663      1 t_ptrace_waitpid PSIG  SIGTRAP SIG_DFL: code=TRAP_SCX, addr=0x0, trap=0)
   663      1 t_ptrace_waitpid CALL  exit(5)
   588      1 t_ptrace_waitpid RET   __wait450 663/0x297

Sponsored by <The NetBSD Foundation>
2018-05-01 13:48:38 +00:00
christos c0d10d8e3a Centralize NOMAN handling. 2018-05-01 12:38:39 +00:00
pgoyette 1691874436 Make MPVERBOSE a defparam rather than defflag. It has multiple
non-zero usages within mpacpi.c
2018-05-01 10:15:27 +00:00
ryo 9a660ec9ae fix define of CPU IDs
* fix incorrect CPU_ID of APM/APPLE
* add CPU_ID of SAMSUNG
* fix typo about BROADCOM
2018-05-01 10:10:31 +00:00
uwe a04344bae9 Fix missed s/vnconfig/vndconfig/ in an example. 2018-05-01 09:03:49 +00:00
martin 371d88511b Simplify and get rid of external "grep" dependency which is not available
on all install meadia.
Sugested by kre.
2018-05-01 09:01:45 +00:00
maxv aebb419bf1 Remove unused argument from udp4_espinudp, and remove unused includes. 2018-05-01 08:42:41 +00:00
maxv 69c944f0bf Remove some more dead code. 2018-05-01 08:34:08 +00:00
martin 88cbfee136 vnconfig has been renamed to vndconfig. Pointed out by kre. 2018-05-01 08:27:39 +00:00
maxv 187c068ea2 When IP6_EXTHDR_GET fails, return ENOBUFS, and don't log an error (HDROPS
is not supposed to be used here).
2018-05-01 08:27:13 +00:00
martin 72be6dafa1 Make the "gpt header" command return EXIT_FAILURE when no GPT is present.
This helps sysinst to tell a GPT labeled disk from others.
Very lazy version of a change proposed by kre.
2018-05-01 08:17:13 +00:00
maxv 84a7697bfe When the replay check fails, return EACCES instead of ENOBUFS. 2018-05-01 08:16:34 +00:00
maxv 82314dff45 Remove double include, opencrypto/xform.h is already included in
netipsec/xform.h.
2018-05-01 08:13:37 +00:00
maxv c802aa1f31 Remove unused. 2018-05-01 08:08:46 +00:00
maxv 86ac125b49 Remove now unused net_osdep.h includes, the other BSDs did the same. 2018-05-01 07:21:39 +00:00
maxv 0281c2ccfc Remove unused alias to tcpiphdr. 2018-05-01 07:07:00 +00:00
ragge 46b98f9cd0 Enable ffsv2 in boot. 2018-05-01 07:03:47 +00:00
maxv ba0005f35a Redefine the structure, not to rely on tcpiphdr. 2018-05-01 07:03:33 +00:00
maxv 218f7f4f8d Move if_name() from net_osdep.h to if.h. net_osdep.h is now unused and can
be removed - the other BSDs did the same.

Discussed with Kengo (if.h suggested by him).
2018-05-01 06:50:06 +00:00
maxv a7d0cc8839 Fix the checks in compute_ipsec_pos, otherwise m_copydata could crash. I
already fixed half of the problem two months ago in rev1.67, back then I
thought it was not triggerable because each packet we emit is guaranteed
to have correctly formed IPv6 options; but it is actually triggerable via
IPv6 forwarding, we emit a packet we just received, and we don't sanitize
its options before invoking IPsec.

Since it would be wrong to just stop the iteration and continue the IPsec
processing, allow compute_ipsec_pos to fail, and when it does, drop the
packet entirely.
2018-05-01 05:42:26 +00:00
nonaka 3d708747ff gmake: Revert configure r1.2 and configure.in r1.2.
> gmake: Apply patch to support GLIBC glob interface v2
>
> http://git.savannah.gnu.org/cgit/make.git/commit/?id=48c8a116
>
> Fix a build failure on Ubuntu 18.04.

Don't apply an imcompatible license patch.
2018-05-01 00:39:58 +00:00
nonaka f39e32fc5f gmake: Revert dir.c r.1.2.
> gmake: Make this work with glibc glob interface v2
>
> http://git.savannah.gnu.org/cgit/make.git/commit/?id=193f1e81

Don't apply an imcompatible license patch.

Reported by kamil@n.o.
2018-05-01 00:36:57 +00:00
christos b2a8932dbe PR/53238: Robert Elz: Disable MKREPRO in tools; the host compiler might
not support the necessary options. This is done thusly:

1. Set MKREPRO=no in Makefile.host. This handles all the Makefiles that
   use it and don't include bsd.own.mk.
2. Create Makefile.inc and set MKREPRO=no in it. Change the Makefiles that
   include bsd.own.mk, to include bsd.init.mk which includes Makefile.inc
   first. This will also allow us to control other tools options from a
   single location if we need to.

XXX: pullup-8
2018-05-01 00:04:34 +00:00
sevan a492831e1e The secret key is required for decryption and signing. Indicate it by setting
the "need seckey" variable before calling init.
2018-04-30 22:17:46 +00:00
sevan b3cd80a889 Unbreak script for Lua 5.3.
This change breaks support for older releases of Lua but it is deemed ok.
2018-04-30 21:40:59 +00:00
sevan 53551a9acb netpgp(3lua) 2018-04-30 21:02:39 +00:00
jmcneill 76e891a854 titemp_match: filter on ia_addr for indirect config (device is expected at 0x4c) 2018-04-30 20:37:01 +00:00
jmcneill 45d3983956 tcakp_match: filter on ia_addr for indirect config (device is expected at 0x34) 2018-04-30 20:33:09 +00:00
jmcneill 4e68763978 act8846_match: filter on ia_addr (device is expected at 0x5a) 2018-04-30 20:26:09 +00:00
martin 07ee4691f0 Add missing netpgp.html (for new lua binding) 2018-04-30 09:59:09 +00:00
wiz dd78489d38 Fix copyright year. Fix whitespace, slightly improve wording. 2018-04-30 07:10:04 +00:00
ragge e2e66973ed Kernel linker support for vax. Now modules can be loaded again.
XXX - should keep modules on physical segment instead of in KVM.
2018-04-30 06:46:12 +00:00
htodd 1445257feb Fix typo in Makefile to fix build. 2018-04-30 05:23:08 +00:00
mlelstv 1e068e7704 add missing KERNEL_LOCK protection around autoconf calls.
Also replace NULL argument with curlwp for style.
2018-04-30 05:04:34 +00:00
nonaka a637d6f757 gmake: Make this work with glibc glob interface v2
http://git.savannah.gnu.org/cgit/make.git/commit/?id=193f1e81
2018-04-30 04:17:27 +00:00
maya f6441f73b5 Remove set but not used sc_flags.
Built tested only.
2018-04-30 01:14:07 +00:00
sevan 823aeb5398 Add a manual for netpgp(3lua) 2018-04-30 01:10:13 +00:00
sevan b05246b276 sign_file function expects 5 parameters, include the output filename. 2018-04-29 23:30:59 +00:00
sevan 06d8aeb822 Hello netpgp(3lua) 2018-04-29 19:47:34 +00:00
sevan 88f8705bc9 Add support for Lua 5.3 2018-04-29 19:34:57 +00:00
sevan c912c8ab8d Enable checking arguments for validity. 2018-04-29 19:31:38 +00:00
sevan 00192c93dd Utilise the passed output filename rather that using a hardcoded name 2018-04-29 19:28:11 +00:00