summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
...
* MFC r304808:kib2016-09-011-2/+7
| | | | | | Prevent leak of URWLOCK_READ_WAITERS flag for urwlocks. PR: 211947
* MFC 303855:markj2016-08-311-2/+14
| | | | | | Handle races with listening socket close when connecting a unix socket. PR: 211531
* MFC r304184:badger2016-08-301-1/+1
| | | | | | | | | | | | | | sem_post(): wake up the sleeper only after adjusting has_waiters If the caller of sem_post() wakes up a thread sleeping via sem_wait() before it clears the has_waiters flag, the caller of sem_wait() has no way of knowing when it is safe to destroy the semaphore and reuse the memory. This is because the caller of sem_post() may be interrupted between the wake step and the clearing of has_waiters. It will then write into the has_waiters flag in userspace after being preempted for some unknown amount of time. Approved by: vangyzen (mentor) Sponsored by: Dell Inc.
* MFC r303426:kib2016-08-275-63/+55
| | | | | Rewrite subr_sleepqueue.c use of callouts to not depend on the specifics of callout KPI.
* MFC r303425:kib2016-08-271-42/+53
| | | | | | | Add callout_when(9). MFC r303919: Fix indentation.
* MFC r264388 (by davide):kib2016-08-274-12/+12
| | | | | | | | | | | | | Define SBT_MAX. MFC r267896 (by davide): Improve r264388. MFC note. The SBT_MAX definition already existed on stable/10, but without the refinement from r267896. Also, consumers of SBT_MAX were not converted, since r264388 was not merged properly. Reviewed by: mav
* MFC r304286:kib2016-08-241-6/+1
| | | | Remove duplicated code.
* MFC r304440, r304487:markj2016-08-223-6/+7
| | | | Fix some handling of P2_PTRACE_FSTP.
* MFC r304174:kib2016-08-221-1/+0
| | | | VOP_FSYNC() does not take cred as an argument. Correct comment.
* MFC 303001: Add PTRACE_VFORK to trace vfork events.jhb2016-08-193-2/+15
| | | | | | | | | First, PL_FLAG_FORKED events now also set a PL_FLAG_VFORKED flag when the new child was created via vfork() rather than fork(). Second, a new PL_FLAG_VFORK_DONE event can now be enabled via the PTRACE_VFORK event mask. This new stop is reported after the vfork parent resumes due to the child calling exit or exec. Debuggers can use this stop to reinsert breakpoints in the vfork parent process before it resumes.
* MFC r303914:kib2016-08-171-4/+7
| | | | Re-schedule signals after kthread exits.
* MFC r303423:kib2016-08-154-22/+69
| | | | Force SIGSTOP to be the first signal reported after the attach.
* MFC 302900,302902,302921,303461,304009:jhb2016-08-157-28/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a mask of optional ptrace() events. 302900: Add a test for user signal delivery. This test verifies we get the correct ptrace event details when a signal is posted to a traced process from userland. 302902: Add a mask of optional ptrace() events. ptrace() now stores a mask of optional events in p_ptevents. Currently this mask is a single integer, but it can be expanded into an array of integers in the future. Two new ptrace requests can be used to manipulate the event mask: PT_GET_EVENT_MASK fetches the current event mask and PT_SET_EVENT_MASK sets the current event mask. The current set of events include: - PTRACE_EXEC: trace calls to execve(). - PTRACE_SCE: trace system call entries. - PTRACE_SCX: trace syscam call exits. - PTRACE_FORK: trace forks and auto-attach to new child processes. - PTRACE_LWP: trace LWP events. The S_PT_SCX and S_PT_SCE events in the procfs p_stops flags have been replaced by PTRACE_SCE and PTRACE_SCX. PTRACE_FORK replaces P_FOLLOW_FORK and PTRACE_LWP replaces P2_LWP_EVENTS. The PT_FOLLOW_FORK and PT_LWP_EVENTS ptrace requests remain for compatibility but now simply toggle corresponding flags in the event mask. While here, document that PT_SYSCALL, PT_TO_SCE, and PT_TO_SCX both modify the event mask and continue the traced process. 302921: Rename PTRACE_SYSCALL to LINUX_PTRACE_SYSCALL. 303461: Note that not all optional ptrace events use SIGTRAP. New child processes attached due to PTRACE_FORK use SIGSTOP instead of SIGTRAP. All other ptrace events use SIGTRAP. 304009: Remove description of P_FOLLOWFORK as this flag was removed.
* MFC 292894,292896: Add ptrace(2) reporting for LWP events.jhb2016-08-124-22/+70
| | | | | | | | | | | | | | 292894: Add ptrace(2) reporting for LWP events. Add two new LWPINFO flags: PL_FLAG_BORN and PL_FLAG_EXITED for reporting thread creation and destruction. Newly created threads will stop to report PL_FLAG_BORN before returning to userland and exiting threads will stop to report PL_FLAG_EXIT before exiting completely. Both of these events are only enabled and reported if PT_LWP_EVENTS is enabled on a process. 292896: Document the recently added support for ptrace(2) LWP events.
* MFC 303503: Don't treat NOCPU as a valid CPU to CPU_ISSET.jhb2016-08-091-1/+1
| | | | | If a thread is created bound to a cpuset it might already be bound before its very first timeslice, and td_lastcpu will be NOCPU in that case.
* MFC r280331:bdrewery2016-08-083-4/+16
| | | | | | cred: add proc_set_cred_init helper PR: D7431
* MFC r280330,r282567:bdrewery2016-08-081-8/+8
| | | | | | | | | r280330: fork: assign refed credentials earlier r282567: Fix up panics when fork fails due to hitting proc limit PR: D7431
* MFC r303702:kib2016-08-061-3/+3
| | | | Remove mention of Giant from the fork_return() description.
* MFC r302614:kib2016-08-012-10/+47
| | | | | | | | Revive the check, disabled in r197963. MFC r302999: On first exec after vfork(), call signotify() to handle pending reenabled signals.
* MFC r303211:kib2016-07-301-0/+28
| | | | Implement mtx_trylock_spin(9).
* MFC r303151:kib2016-07-281-0/+21
| | | | | | | Provide counter_warning(9) KPI. MFC r303155: Hide counted_warning(9) under #ifdef _KERNEL braces.
* MFC r302567:kib2016-07-251-1/+7
| | | | | | | | In vgonel(), postpone setting BO_DEAD until VOP_RECLAIM() is called, if vnode is VMIO. For VMIO vnodes, set BO_DEAD in vm_object_terminate(). MFC r302580: Fix grammar.
* MFC r302936:kib2016-07-231-2/+5
| | | | Explicitely check for the valid range of file descriptor values.
* MFC r302919:kib2016-07-221-1/+1
| | | | | In ptrace_vm_entry(), do not call vmspace_free() while owning a vm object lock.
* MFC r302893:kib2016-07-221-0/+2
| | | | Do not allow creation of char or block special nodes with VNOVAL dev_t.
* MFC r302770:kib2016-07-201-0/+17
| | | | Trace timeval parameters to the getitimer(2) and setitimer(2) syscalls.
* MFC r302346:markj2016-07-161-1/+8
| | | | Ensure that spinlock sections are balanced even after a panic.
* MFC r299913: dounmount: do not call mountcheckdirs() for mounts with MNT_IGNOREavg2016-07-131-2/+4
|
* MFC r302151: posixshm: Fix lock leak when mac_posixshm_check_read rejectsjilles2016-07-031-3/+3
| | | | | | | read. While reading the code, I noticed that shm_read() returns without unlocking foffset and rangelock if mac_posixshm_check_read() rejects the read.
* MFC r300793:bdrewery2016-06-271-8/+16
| | | | exec: Provide execpath in imgp for the process_exec hook.
* MFC r300792,r300851,r301580:bdrewery2016-06-271-125/+133
| | | | | | | | | | | | r300792: exec: Add credential change information into imgp for process_exec hook. r300851: exec: get rid of one vnode lock/unlock pair in do_execve r301580: Old process credentials for setuid execve must not be dereferenced when the process credentials were not changed. This can happen if an error occured trying to activate the setuid binary. And on error, if new credentials were not yet assigned, they must be freed to not create the leak.
* MFC r292384:bdrewery2016-06-278-76/+69
| | | | | | Fix style issues around existing SDT probes. ** Changes to sys/netinet/in_kdtrace.c and sys/netinet/in_kdtrace.h skipped.
* MFC r298819:bdrewery2016-06-2743-71/+71
| | | | sys/kern: spelling fixes in comments.
* MFC r297391:bdrewery2016-06-273-10/+0
| | | | Remove some NULL checks for M_WAITOK allocations.
* MFC r285513:bdrewery2016-06-271-15/+15
| | | | exec: textvp -> oldtextvp; binvp -> newtextvp
* MFC r285512:bdrewery2016-06-271-8/+6
| | | | exec plug a redundant vref + vrele of the image vnode
* MFC r273351:bdrewery2016-06-271-3/+3
| | | | Plug unnecessary binvp NULL initialization and test.
* MFC r280130:bdrewery2016-06-278-27/+55
| | | | cred: add proc_set_cred helper
* MFC r296285:bdrewery2016-06-271-1/+1
| | | | Correct a comment.
* MFC r301960:kib2016-06-231-3/+3
| | | | Remove XXX comments from kern_thread.c.
* MFC r301959:kib2016-06-231-5/+0
| | | | Remove code duplication.
* MFC r301929:kib2016-06-221-3/+18
| | | | | Do not assume that we own the use reference on the covered vnode until we set MNTK_UNMOUNT flag on the mp.
* MFC r297156,r297157,r297158,r297159,r297161,r297172,r297200,r297201,r297202,bdrewery2016-06-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r297203,r297256: r297156: Track filemon usage via a proc.p_filemon pointer rather than its own lists. r297157: Stop tracking stat(2). r297158: Consolidate open(2) and openat(2) code. r297159: Use curthread for vn_fullpath. r297161: Attempt to use the namecache for openat(2) path resolution. r297172: Consolidate common link(2) logic. r297200: Follow-up r297156: Close the log in filemon_dtr rather than in the last reference. r297201: Return any log write failure encountered when closing the filemon fd. r297202: Remove unused done argument to copyinstr(9). r297203: Handle copyin failures. r297256: Remove unneeded return left from refactoring. Relnotes: yes (filemon stability/performance updates) Sponsored by: EMC / Isilon Storage Division
* MFC r301764:jamie2016-06-151-0/+1
| | | | | Fix a vnode leak when giving a child jail a too-long path when debug.disablefullpath=1.
* MFC r301760:jamie2016-06-151-40/+40
| | | | Re-order some jail parameter reading to prevent a vnode leak.
* MFC r301758:jamie2016-06-151-12/+10
| | | | | Clean up some logic in jail error messages, replacing a missing test and a redundant test with a single correct test.
* MFC r301745:jamie2016-06-151-9/+13
| | | | | | | | Make sure the OSD methods for jail set and remove can't run concurrently, by holding allprison_lock exclusively (even if only for a moment before downgrading) on all paths that call PR_METHOD_REMOVE. Since they may run on a downgraded lock, it's still possible for them to run concurrently with PR_METHOD_GET, which will need to use the prison lock.
* MFC r301737:jamie2016-06-151-6/+0
| | | | | Remove a comment that was part of copied code, and is misleading in the new location.
* MFC r300983:jamie2016-06-151-17/+17
| | | | | Mark jail(2), and the sysctls that it (and only it) uses as deprecated. jail(8) has long used jail_set(2), and those sysctl only cause confusion.
* MFC r299494:ngie2016-06-101-3/+1
| | | | | | | | | | | r299494 (by cem): subr_vmem: Fix double-free in error case of vmem_create If vmem_init() fails, 'vm' is already destroyed and freed. Don't free it again. CID: 1042110
OpenPOWER on IntegriCloud