Commit Graph

9229 Commits

Author SHA1 Message Date
christos
a89334cd83 PR/50312: Robert Elz: Unconditionally include <sys/exec.h> to fix compilation
when PAX_ASLR is not defined.
2015-10-09 02:00:59 +00:00
christos
2210ed24e7 provide curthread for dtrace 2015-10-07 00:32:34 +00:00
christos
8c1b3fd3c9 Expose struct kauth_cred for the benefit of the debugger. I can't convince gcc
to produce debug info for the structure if it does not appear in more than
one source file.
2015-10-06 22:13:39 +00:00
christos
a3c9e9c899 CID/1325753: remove extra return. 2015-10-06 15:03:34 +00:00
christos
3415810083 PR/50295: clock_nanotime() should not set errno, but return the error. 2015-10-02 19:47:08 +00:00
christos
db70f1818e Change SDT (Statically Defined Tracing) probes to use link sets so that it
is easier to add probes. (From FreeBSD)
2015-10-02 16:54:15 +00:00
ozaki-r
05cf8927fd Add _KERNEL_OPT
It's needed for nbmake RUMP_LOCKDEBUG=yes.
2015-09-29 01:44:57 +00:00
maxv
9ed595918a Revamp the way processes are PaX'ed in the kernel. Sent on tech-kern@ two
months ago, but no one reviewed it - probably because it's not a trivial
change.

This change fixes the following bug: when loading a PaX'ed binary, the
kernel updates the PaX flag of the calling process before it makes sure
the new process is actually launched. If the kernel fails to launch the
new process, it does not restore the PaX flag of the calling process,
leaving it in an inconsistent state.

Actually, simply restoring it would be horrible as well, since in the
meantime another thread may have used the flag.

The solution is therefore: modify all the functions used by PaX so that
they take as argument the exec package instead of the lwp, and set the PaX
flag in the process *right before* launching the new process - it cannot
fail in the meantime.
2015-09-26 16:12:24 +00:00
christos
932cdb9b10 regen 2015-09-24 14:34:22 +00:00
christos
25f4925cd9 implementation of KERN_PROC_PATHNAME, some refactoring for KERN_PROC. 2015-09-24 14:33:01 +00:00
christos
a56c5627aa create an array of altsyscallnames, which are the syscall names that the
libc api uses. For example syscallnames[293] = "__sigprocmask14",
altsyscallnames[293] = "sigprocmask". This is so that things like dtrace
can use the system call names everyone uses. The array is sparse; if the
names were the same (or for compat names) they are not copied and the array
has NULL for them.
2015-09-24 14:30:52 +00:00
uebayasi
960ec2b2e8 Handle splash image generation better. 2015-09-14 01:40:03 +00:00
christos
32627ea0ec gcc does not detect initialization correctly on all platforms (hpcsh) 2015-09-12 18:30:46 +00:00
christos
e56eaf6411 - preserve the error number returned from copyin.
- preserve the original pathname in ep_kname, because this is what gets passed
  to userland in exec_script.c
2015-09-12 17:04:57 +00:00
christos
c8bd35c1f3 On non absolute exec pathnames, prepend the working directory if
possible so that we can provide in most situations the absolute
pathname in the AUX vector so that $ORIGIN works. The following
are implementation issues:
    1. deep path execs still don't work (can't provide path to the AUX vector)
    2. the returned path is not normalized (cosmetic)
2015-09-11 01:23:37 +00:00
uebayasi
185d99e39a Build conf/param.c normally. 2015-09-03 01:09:38 +00:00
ozaki-r
13b8e486ae Fix building kernels w/o ether 2015-08-31 16:46:14 +00:00
ozaki-r
879526da38 Hook up lltable/llentry with the kernel (and rumpkernel)
It is built and initialized on bootup, but there is no user for now.

Most codes in in.c are imported from FreeBSD as well as lltable/llentry.
2015-08-31 08:02:44 +00:00
uebayasi
c692eec272 Use makeoptions_COPY_SYMTAB via opt_copy_symtab.h in sources. Remove a hack
to set -DCOPY_SYMTAB from sys/conf/Makefile.kern.inc.  Remove unnecessary
dependencies too.
2015-08-30 01:46:02 +00:00
maxv
dd1f161320 Don't decrement the number of offline cpus if we fail to shut down one.
ok christos@, via tech-kern@
2015-08-29 12:24:00 +00:00
mlelstv
cc9526659d when querying randomness sources from position 'start' then skip 'start'
entries and not one less.
2015-08-29 10:00:19 +00:00
knakahara
bb29ae9814 fix interrupt_* stubs. reported by skrll@n.o 2015-08-28 07:18:39 +00:00
uebayasi
144fbf59d9 Constify a little. 2015-08-27 02:43:20 +00:00
pooka
7cc60ed4d8 Move a bunch of sysctl nodes from init_sysctl (kitchen sink sysctl file)
to init_sysctl_base (only base kernel defs).  Main motivation was to
fix sysconf(_SC_NPROCESSORS) for Rumprun.  As reported by neeraj on irc,
it returned -1 before this fix, so we were doing imaginary computing.
2015-08-25 14:52:31 +00:00
pooka
21ff215384 hw nodes do not go under the kern tree, so add new init routine for them 2015-08-25 14:32:34 +00:00
gson
42b8d69040 In ttywait_timo(), break out of loop on all errors, not just
EWOULDBLOCK, as ttywait() did prior to 1.265.
2015-08-25 12:55:30 +00:00
pooka
d8e04c9094 to garnish, dust with _KERNEL_OPT 2015-08-24 22:50:32 +00:00
pooka
1c4a50f192 sprinkle _KERNEL_OPT 2015-08-24 22:21:26 +00:00
pooka
b00f3c3b11 regen 2015-08-24 16:07:10 +00:00
pooka
e037806b6d <sys/mount.h> is necessary only with !RUMP_CLIENT, so include it only
in that case.  Fixes build for Hurd (which does not provide <sys/mount.h>)

from rmh@gnu.org
2015-08-24 16:05:46 +00:00
christos
a220b03041 we don't need ioconf.h if we don't have the ksyms pseudo-device 2015-08-21 06:55:25 +00:00
christos
758039df2d If we don't have a pseudo-device, we don't need the attach function. 2015-08-21 06:50:56 +00:00
uebayasi
520a795665 Move dev/ definitions out of files.kern. 2015-08-21 02:18:18 +00:00
christos
9e1f6b1ae6 include ioconf.h instead of locally declaring the prototype of the attach
function
2015-08-20 09:45:45 +00:00
uebayasi
bf97b90378 Mark pseudo attach unused arg with __unused. 2015-08-20 08:27:09 +00:00
gson
2a8f000c61 When closing a tty, limit the amount of time spent waiting for the
output to drain to five seconds so that exiting processes with
buffered output for a serial port blocked by flow control or a pty
that is not being read do not hang indefinitely.  Should fix PRs
kern/12534 and kern/17171.  This is an updated version of the change
of tty.c 1.263.
2015-08-19 12:02:55 +00:00
hannken
215f039197 Redo Rev. 1.30: Change vfs_vnode_iterator_next() to skip reclaiming
vnodes (VI_XLOCK set) without waiting and change vflush() to wait for
these vnodes.
2015-08-19 08:40:02 +00:00
uebayasi
fa089ff763 Convert pseudo attach functions to take no arguments, as some functions
(pppattach(), putterattach(), etc.) already do.  This means that pseudo
attach function will be able to become a constructor.
2015-08-18 13:46:20 +00:00
knakahara
a604df282c Add kernel code to support intrctl(8). 2015-08-17 06:16:02 +00:00
mlelstv
5661eb436a Refactor disk address calculation from physical block numbers in
the journal into a function. Make that function work correctly with
sector sizes != DEV_BSIZE when compiled outside the kernel (i.e.
fsck_ffs).
Fixes PR bin/45933
2015-08-09 07:40:59 +00:00
mlelstv
23ac79bdb2 KASSERT that magic pointers NOCRED and FSCRED are not dereferenced. 2015-08-08 07:53:51 +00:00
maxv
6a1d6f071c revert; but still fix the comment 2015-08-08 06:24:40 +00:00
uebayasi
d3d021fcc6 o Don't include sys/sched.h. Scheduler-related operation is done by
sleepq(9) via SOBJ_SLEEPQ_SORTED.

o Include sys/lwp.h instead of sys/proc.h.
2015-08-07 06:22:12 +00:00
riastradh
c5389a31f5 KNF (Khange Not Functional) 2015-08-05 16:51:09 +00:00
riastradh
3aafbe4261 Terminate message with newline. 2015-08-05 16:37:27 +00:00
maxv
22674dbcd0 stupid comment, and make sure we are not executing a lib 2015-08-05 15:58:01 +00:00
maxv
b36a7fd23d Some changes, to reduce a bit my tech-kern@ patch:
- move the P_PAX_ flags out of #ifdef PAX_ASLR in pax.h
 - add a generic pax_flags_active() function
 - fix a comment in exec_elf.c; interp is not static
 - KNF for return
 - rename pax_aslr() to pax_aslr_mmap()
 - rename pax_segvguard_cb() to pax_segvguard_cleanup_cb()
2015-08-04 18:28:09 +00:00
maxv
8a3764c147 Remove uvm_extern.h and exec.h (unused). 2015-08-04 12:44:04 +00:00
maxv
bc1457cb8c Small changes:
- remove the per-page stuff. It has been disabled for 10 years, and it is
   not implemented properly.
 - typo in comment
 - use KASSERT
2015-08-04 11:42:08 +00:00
christos
6fe583ecd6 1. mask fflags so we don't tack on whateve oflags were passed from userland
2. honor O_CLOEXEC, so the children of daemons that use cloning devices, don't
   end up with the parents descriptors
fd_clone and in general the fd approach of 'allocate' > 'play with guts' >
'attach' should be converted to be more constructor like.
XXX: pullup-{6,7}
2015-08-03 04:55:15 +00:00