summaryrefslogtreecommitdiff
path: root/sys/kern/kern_context.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix small kernel memory disclosures. [EN-18:12.mem]releng/11.1Gordon Tetlow2018-09-271-0/+2
| | | | | | | | | | Reported by: Thomas Barabosch, Fraunhofer FKIE Approved by: so Security: FreeBSD-EN-18:12.mem Security: CVE-2018-17155 Notes: svn path=/releng/11.1/; revision=338981
* In order to maximize the re-usability of kernel code in user space thisKip Macy2011-09-161-3/+3
| | | | | | | | | | | | | | | | patch modifies makesyscalls.sh to prefix all of the non-compatibility calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel entry points and all places in the code that use them. It also fixes an additional name space collision between the kernel function psignal and the libc function of the same name by renaming the kernel psignal kern_psignal(). By introducing this change now we will ease future MFCs that change syscalls. Reviewed by: rwatson Approved by: re (bz) Notes: svn path=/head/; revision=225617
* Clear the padding when returning context to the usermode, forKonstantin Belousov2011-02-051-0/+2
| | | | | | | | | | | | MI ucontext_t and x86 MD parts. Kernel allocates the structures on the stack, and not clearing reserved fields and paddings causes leakage. Noted and discussed with: bde MFC after: 2 weeks Notes: svn path=/head/; revision=218327
* Move prototypes for kern_sigtimedwait() and kern_sigprocmask() toJohn Baldwin2010-06-301-0/+1
| | | | | | | <sys/syscallsubr.h> where all other kern_<syscall> prototypes live. Notes: svn path=/head/; revision=209613
* In r197963, a race with thread being selected for signal deliveryKonstantin Belousov2009-10-271-8/+4
| | | | | | | | | | | | | | | | while in kernel mode, and later changing signal mask to block the signal, was fixed for sigprocmask(2) and ptread_exit(3). The same race exists for sigreturn(2), setcontext(2) and swapcontext(2) syscalls. Use kern_sigprocmask() instead of direct manipulation of td_sigmask to reschedule newly blocked signals, closing the race. Reviewed by: davidxu Tested by: pho MFC after: 1 month Notes: svn path=/head/; revision=198507
* Further system call comment cleanup:Robert Watson2007-03-051-3/+3
| | | | | | | | | | | | | - Remove also "MP SAFE" after prior "MPSAFE" pass. (suggested by bde) - Remove extra blank lines in some cases. - Add extra blank lines in some cases. - Remove no-op comments consisting solely of the function name, the word "syscall", or the system call name. - Add punctuation. - Re-wrap some comments. Notes: svn path=/head/; revision=167232
* Remove 'MPSAFE' annotations from the comments above most system calls: allRobert Watson2007-03-041-6/+0
| | | | | | | | | | | system calls now enter without Giant held, and then in some cases, acquire Giant explicitly. Remove a number of other MPSAFE annotations in the credential code and tweak one or two other adjacent comments. Notes: svn path=/head/; revision=167211
* Change the clear_ret argument of get_mcontext() to be a flags argument.Marcel Moolenaar2003-11-091-2/+2
| | | | | | | | | | | | | Since all callers either passed 0 or 1 for clear_ret, define bit 0 in the flags for use as clear_ret. Reserve bits 1, 2 and 3 for use by MI code for possible (but unlikely) future use. The remaining bits are for use by MD code. This change is triggered by a need on ia64 to have another knob for get_mcontext(). Notes: svn path=/head/; revision=122364
* Use __FBSDID().David E. O'Brien2003-06-111-4/+3
| | | | Notes: svn path=/head/; revision=116182
* Add an argument to get_mcontext() which specified whether theDaniel Eischen2003-04-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | syscall return values should be cleared. The system calls getcontext() and swapcontext() want to return 0 on success but these contexts can be switched to at a later time so the return values need to be cleared in the saved register sets. Other callers of get_mcontext() would normally want the context without clearing the return values. Remove the i386-specific context saving from the KSE code. get_mcontext() is not i386-specific any more. Fix a bad pointer in the alpha get_mcontext() code. The context was being bcopy()'d from &td->tf_frame, but tf_frame is itself a pointer, so the thread was being copied instead. Spotted by jake. Glanced at by: jake Reviewed by: bde (months ago) Notes: svn path=/head/; revision=113998
* Protect td_sigmask with the proc lock.John Baldwin2003-04-171-1/+5
| | | | Notes: svn path=/head/; revision=113626
* - Fix UC_COPY_SIZE. Adding up the size of structure fields doesn't takeJake Burkholder2003-04-011-4/+3
| | | | | | | | | alignment into account. - Return EJUSTRETURN from set_context on success to avoid clobbering the first 2 out registers with td_retval on sparc64. Notes: svn path=/head/; revision=112962
* - Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread withJeff Roberson2003-03-311-4/+4
| | | | | | | | | | a follow on commit to kern_sig.c - signotify() now operates on a thread since unmasked pending signals are stored in the thread. - PS_NEEDSIGCHK moves to TDF_NEEDSIGCHK. Notes: svn path=/head/; revision=112888
* Add getcontext, setcontext, and swapcontext as system calls.Daniel Eischen2002-11-161-0/+134
Previously these were libc functions but were requested to be made into system calls for atomicity and to coalesce what might be two entrances into the kernel (signal mask setting and floating point trap) into one. A few style nits and comments from bde are also included. Tested on alpha by: gallatin Notes: svn path=/head/; revision=106977