| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Performed a minor refactoring and removed a few trailing whitespaces.
ok anton@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
time_second(9) and time_uptime(9) are widely used in the kernel to
quickly get the system UTC or system uptime as a time_t. However,
time_t is 64-bit everywhere, so it is not generally safe to use them
on 32-bit platforms: you have a split-read problem if your hardware
cannot perform atomic 64-bit reads.
This patch replaces time_second(9) with gettime(9), a safer successor
interface, throughout the kernel. Similarly, time_uptime(9) is replaced
with getuptime(9).
There is a performance cost on 32-bit platforms in exchange for
eliminating the split-read problem: instead of two register reads you
now have a lockless read loop to pull the values from the timehands.
This is really not *too* bad in the grand scheme of things, but
compared to what we were doing before it is several times slower.
There is no performance cost on 64-bit (__LP64__) platforms.
With input from visa@, dlg@, and tedu@.
Several bugs squashed by visa@.
ok kettenis@
|
|
|
|
|
|
|
|
|
|
| |
as the same function could end up putting the thread to sleep. Allowing
another thread to free the shared memory segment, which in turns causes
a use-after-free.
With help from and ok millert@ visa@
Reported-by: syzbot+0fc1766671a9461de8a5@syzkaller.appspotmail.com
|
|
|
|
| |
ok kettenis@, semarie@, deraadt@
|
| |
|
|
|
|
|
|
| |
the copyin/copyout compat shims.
ok deraadt@ millert@ anton@
|
|
|
|
|
|
|
|
|
| |
shared memory segment. Otherwise, if copyin ends up sleeping it allows
another thread to remove the same segment leading to a use-after-free.
Feedback from kettenis@ and ok guenther@
Reported-by: syzbot+0de42c2e600a6dd3091d@syzkaller.appspotmail.com
|
| |
|
|
|
|
| |
ok bluhm@, visa@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the ioff argument to pool_init() is unused and has been for many
years, so this replaces it with an ipl argument. because the ipl
will be set on init we no longer need pool_setipl.
most of these changes have been done with coccinelle using the spatch
below. cocci sucks at formatting code though, so i fixed that by hand.
the manpage and subr_pool.c bits i did myself.
ok tedu@ jmatthew@
@ipl@
expression pp;
expression ipl;
expression s, a, o, f, m, p;
@@
-pool_init(pp, s, a, o, f, m, p);
-pool_setipl(pp, ipl);
+pool_init(pp, s, a, ipl, f, m, p);
|
|
|
|
| |
ok natano@
|
| |
|
|
|
|
|
|
|
| |
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.
ok tedu@ deraadt@
|
|
|
|
|
|
| |
flags, not mmap-style flags for UVM_MAPFLAG(). Remove the nonsensical
MAP_ANON|MAP_SHARED value and convert MAP_FIXED to UVM_FLAG_FIXED.
OK guenther@
|
|
|
|
| |
marker for which pools are not interrupt safe. ok dlg
|
|
|
|
|
|
| |
doesn't have all the values and therefore can't be used everywhere.
ok deraadt@ kettenis@
|
|
|
|
|
|
| |
eliminating the must-be-kept-in-sync UVM_INH_* macros
ok deraadt@ tedu@
|
| |
|
|
|
|
| |
ok deraadt@ tedu@
|
|
|
|
|
|
|
| |
PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h.
PROT_MASK is introduced as the one true way of extracting those bits.
Remove UVM_ADV_* wrapper, using the standard names.
ok doug guenther kettenis
|
| |
|
|
|
|
| |
after discussions with beck deraadt kettenis.
|
|
|
|
|
|
| |
pr->ps_mainproc->p_pid to get the PID.
ok matthew@
|
|
|
|
|
|
|
|
|
|
|
|
| |
no oks (it is really a pain to review properly)
extensively tested, I'm confident it'll be stable
'now is the time' from several icb inhabitants
Diff provides:
- ability to specify different allocators for different regions/maps
- a simpler implementation of the current allocator
- currently in compatibility mode: it will generate similar addresses
as the old allocator
|
|
|
|
|
|
|
|
|
|
|
|
| |
the IPC_RMID flag.
This is permitted as an extension beyond the standards and this is similar
to what other operating systems like linux do.
Because compat_linux(8) was emulating this already, remove that code
since now this is the default.
input from oga@, guenther@, jmc@, deraadt@
ok deraadt@
|
|
|
|
| |
outside the tree.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vmmap is designed to perform address space randomized allocations,
without letting fragmentation of the address space go through the roof.
Some highlights:
- kernel address space randomization
- proper implementation of guardpages
- roughly 10% system time reduction during kernel build
Tested by alot of people on tech@ and developers.
Theo's machines are still happy.
|
|
|
|
|
| |
This is more clear, and as thib pointed out, the default in softraid was
wrong. ok thib.
|
|
|
|
|
|
|
| |
to return pids, not thread ids, so record the former when performing
operations.
ok blambert
|
|
|
|
| |
help and ok miod@ thib@
|
|
|
|
| |
eyeballed and ok dlg@
|
|
|
|
|
|
|
|
|
|
|
| |
fold sys_shmat1() back into sys_shmat(), instead add flag for shmget(2)
to specify that later shmat(2) for the shared memory segment should succeed
even if the segment would be marked removed; use this to implement the
Linux-compatible semantics of shmat(2)
this fixes current opera with shm
ok millert
|
|
|
|
|
| |
etc to avoid confusion and for consistency with the *35 ones.
Remove *n2o functions that don't belong outside of compat.
|
|
|
|
|
|
|
| |
which also takes two function pointers for copyin/copyout. For the
real syscalls these are just the normal copyin/copyout functions.
For the compat routines, these are funtions that convert between
the new and old foo_ds structs automagically. OK deraadt@
|
|
|
|
|
|
|
|
| |
things such that code that only need a second-resolution uptime or wall
time, and used to get that from time.tv_secs or mono_time.tv_secs now get
this from separate time_t globals time_second and time_uptime.
ok art@ niklas@ nordin@
|
|
|
|
|
| |
Create new syscalls with the correct parameters and add compat versions
for the old ones under COMPAT_35.
|
| |
|
|
|
|
| |
OK deraadt@ tedu@ dhartmei@
|
| |
|
|
|
|
| |
our Linux compat should too. From marius aamodt eriksen
|
| |
|
|
|
|
| |
where applicable.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The first one is an mquery(2) syscall. It's for asking the VM system
about where to map things. It will be used by ld.so, read the man page
for details.
The second change is related and is a centralization of uvm_map hint
that all callers of uvm_map calculated. This will allow us to adjust
this hint on architectures that have segments for non-exec mappings.
deraadt@ drahn@ ok.
|
|
|
|
|
| |
cause id collisions (the macros in <sys/ipc.h> limit the index to 0xffff).
Prompted by a conversation with weingart@
|
|
|
|
|
| |
NetBSD and allow shmctl() to operate on shm segments that have been
marked for removal like other OSes do.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of allocating a static amount of memory for the data
structures via valloc() in allocsys(), allocate things dynamically
using pool(9) when possible and malloc(9) when not. The various
members of struct seminfo and struct shminfo are in kern.seminfo
and kern.shminfo respectively (not all members of kern.seminfo are
changable).
The data structures used still leave something to be desired but
things are not made worse in that respect by this commit.
|
|
|
|
|
|
|
|
| |
Also uvm_map returns KERN_* codes that are directly mapped to
errnos, so we can return them instead of doing some attempt to
translation.
drahn@ "I see no problem" pval@ "makes sense"
|