summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* MFC r277322:kib2015-01-255-3/+90
| | | | | Add procctl(2) PROC_TRACE_CTL command to enable or disable debugger attachment to the process.
* MFC r277321:kib2015-01-251-2/+5
| | | | | Make SIGSTOP working for sleeps done while waiting for fifo readers or writers in open(2), when the fifo is located on an NFS mount.
* MFC r276904:delphij2015-01-241-1/+2
| | | | | | | | | Improve style and fix a possible use-after-free case introduced in r268384 by reinitializing the 'freestate' pointer after freeing the memory. Obtained from: HardenedBSD (71fab80c5dd3034b71a29a61064625018671bbeb) PR: 194525 Submitted by: Oliver Pinter <oliver.pinter@hardenedbsd.org>
* MFC r277236:kib2015-01-221-3/+4
| | | | | For sigaction(2), ignore possible garbage in sa_flags for sa_handler == SIG_DFL or SIG_IGN.
* MFC r277055:kib2015-01-191-2/+0
| | | | Revert r263475: TDP_DEVMEMIO no longer needed.
* MFC r276906:dchagin2015-01-171-5/+2
| | | | | Allow clock_getcpuclockid() on the CPU-time clock for zombie process. Posix does not prohibit this.
* MFC r277158:jamie2015-01-171-2/+2
| | | | | | Don't set prison's pr_ip4s or pr_ip6s to -1. PR: 196474
* MFC r276532 and r276626:hselasky2015-01-111-0/+7
| | | | | | | | The "cnputs_mtx" mutex must be allowed to recurse. Debug prints and/or witness printouts in the console driver clients can cause this mutex to recurse by calls to "printf()" from witness for example. In particular this can happen if "debug.witness.skipspin=0" is set in the boot environment.
* Regen for r276955 (__getcwd path bug).dchagin2015-01-113-4/+4
|
* MFC r276564, r276654:dchagin2015-01-112-10/+2
| | | | | | | | | | | | | | | | Cast *path to silence clang -Wpointer-sign warning. Indeed, instead of hiding the kern___getcwd() bug by bogus cast in r276564, change path type to char * (pathnames are always char *). And remove bogus casts of malloc(). kern___getcwd() internally doesn't actually use or support u_char * paths, except to copy them to a normal char * path. These changes are not visible to libc as libc/gen/getcwd.c misdeclares __getcwd() as taking a plain char * path. While here remove _SYS_SYSPROTO_H_ for __getcwd() syscall as we always have sysproto.h.
* Merge reaper facility.kib2015-01-055-213/+543
| | | | | | | | | | | | | | | | | | | | | MFC r270443 (by mjg): Properly reparent traced processes when the tracer dies. MFC r273452 (by mjg): Plug unnecessary PRS_NEW check in kern_procctl. MFC 275800: Add a facility for non-init process to declare itself the reaper of the orphaned descendants. MFC r275821: Add missed break. MFC r275846 (by mckusick): Add some additional clarification and fix a few gammer nits. MFC r275847 (by bdrewery): Bump Dd for r275846.
* MFC r276008:kib2015-01-042-1/+4
| | | | | Add VN_OPEN_NAMECACHE flag for vn_open_cred(9), which requests that the created file name was cached. Use the flag for core dumps.
* MFC r275897:kib2015-01-013-12/+21
| | | | | Set NOCACHE flag for CREATE namei() calls, do not specially handle MAKEENTRY in VOP_LOOKUP().
* MFC: r276192, r276200rmacklem2014-12-311-14/+23
| | | | | | | | | | | | Modify vop_stdadvlock{async}() so that it only locks/unlocks the vnode and does a VOP_GETATTR() for the SEEK_END case. This is safe to do, since lf_advlock{async}() only uses the size argument for the SEEK_END case. The NFSv4 server needs this when vfs.nfsd.enable_locallocks!=0 since locking the vnode results in a LOR that can cause a deadlock for the nfsd threads.
* MFC r275638:kib2014-12-301-2/+2
| | | | Do not call VFS_SYNC() before VFS_UNMOUNT() for forced unmount.
* MFC r275260:kib2014-12-291-7/+3
| | | | | Remove lock recursion for the pipe pair mutex, and disable the recursion on mutex initialization.
* MFC r272789:marcel2014-12-281-10/+25
| | | | Fix draining in ttydev_leave().
* MFC r269126 & 272786:marcel2014-12-281-8/+8
| | | | Don't return ERESTART when the device is gone.
* MFC r275745:kib2014-12-276-47/+231
| | | | | | | | | | Add facility to stop all userspace processes. MFC r275753: Fix gcc build. MFC r275820: Add missed break.
* Regen for r275986 (ppoll).dchagin2014-12-213-2/+38
|
* MFC r274462: Add the ppoll() system call.dchagin2014-12-212-33/+98
|
* MFC r275744:kib2014-12-201-5/+8
| | | | | Only sleep interruptible while waiting for suspension end when filesystem specified VFCF_SBDRY flag, i.e. for NFS.
* MFC r275743:kib2014-12-201-10/+24
| | | | Put the buffer cleanup code after inactivation.
* MFC r275727:kib2014-12-191-5/+3
| | | | | | | For architectures where time_t is wide enough, in particular, 64bit platforms, avoid overflow after year 2038 in clock_ct_to_ts(). PR: 195868
* MFC r268843 (by bapt):kib2014-12-181-7/+35
| | | | Extend kqueue's EVFILT_TIMER by adding precision unit flags support.
* MFC r259609 (by se):kib2014-12-181-1/+5
| | | | | | | | | Fix overflow for timeout values of more than 68 years, which is the maximum covered by sbintime (LONG_MAX seconds). MFC r259633 (by se): Fix compilation on 32 bit architectures and use INT64_MAX instead of LONG_MAX for the upper bound check.
* MFC r275620:kib2014-12-151-2/+21
| | | | | | | Add functions syncer_suspend() and syncer_resume(). MFC r275637: Remove local variable for real.
* MFC r275619:kib2014-12-151-3/+7
| | | | | | Check for bo_bufobj->bo_object for NULL and cache the value in local variable to avoid NULL dereference in getnewbuf_reuse_bp(). The vnode owning the buffer is not locked there.
* MFC r275617:kib2014-12-151-41/+47
| | | | Do some refactoring and minor cleanups of the thread_single() code.
* MFC r275616:kib2014-12-152-4/+27
| | | | | | | | | | | | | | | Thread waiting for the vfork(2)-ed child to exec or exit, must allow for the suspension. MFC r275683 (by andreast): Fix build for powerpc(32|64) kernels. MFC r275686 (by andreast): Fix kernel build for booke. r275639 (by andrew) is not merged, since arm/arm/syscall.c is not present on the stable/10 branch, and arm/arm/trap.c already includes sys/kernel.h.
* MFC r275615:kib2014-12-151-9/+16
| | | | | When process is exiting, check for suspension regardless of multithreaded status of the process.
* MFC r275206:kib2014-12-051-2/+8
| | | | | Assert the state of the process lock and sigact mutex in kern_sigprocmask() and reschedule_signals().
* MFC r275120:kib2014-12-031-19/+27
| | | | | Fix SA_SIGINFO | SA_RESETHAND handling, reset disposition after sv_sendsig() is called.
* MFC r274017, r274088 and r275205:hselasky2014-11-281-8/+25
| | | | | | Provide an on-stack temporary buffer for small IOCTL requests. Avoiding a memory allocation per IOCTL request can give a significant speedup for applications which heavily rely on IOCTLs.
* vt(4): Adjust the cursor position after changing the window sizedumbbell2014-11-221-0/+7
| | | | | | | | | | | | | | | | A new terminal_set_cursor() is added: it wraps the existing teken_set_cursor() function. In vtbuf_grow(), the cursor position is adjusted at the end of the function. In vt_change_font(), we call terminal_set_cursor() just after terminal_set_winsize_blank(), while the terminal is mute. This fixes a bug where, after loading a kernel video driver which increases the terminal window size, the cursor remains at its old position, in other words, in the middle of the display content. PR: 194421 MFC of: r273932
* MFC r274501:kib2014-11-211-1/+3
| | | | | In vfs_write_suspend_umnt(), if suspension cannot be established, do not forget to restore write ops count when returning the error.
* MFC r274478:kib2014-11-201-2/+1
| | | | | Fix assertion, &uc->uc_busy is never zero, the intent is to test the uc_busy value, and not its address.
* MFC r274474:kib2014-11-201-3/+8
| | | | Do not try to dereference thread pointer when the value is not a pointer.
* MFC r274473:kib2014-11-201-5/+0
| | | | Remove fossil.
* MFC r274438:kib2014-11-191-29/+15
| | | | | | For posix_fallocate(2) and posix_fadvise(2), return ESPIPE when underlying file does not have DFLAG_SEEKABLE set. For posix_fallocate(2), simplify error handling logic.
* Merge the fueword(9) and casueword(9). In particular,kib2014-11-184-229/+481
| | | | | | | | | | | | | | | | | | | | | | | MFC r273783: Add fueword(9) and casueword(9) functions. MFC note: ia64 is handled like arm, with NO_FUEWORD define. MFC r273784: Replace some calls to fuword() by fueword() with proper error checking. MFC r273785: Convert kern_umtx.c to use fueword() and casueword(). MFC note: the sys__umtx_lock and sys__umtx_unlock syscalls are not converted, they are removed from HEAD, and not used. The do_sem2*() family is not yet merged to stable/10, corresponding chunk will be merged after do_sem2* are committed. MFC r273788 (by jkim): Actually install casuword(9) to fix build. MFC r273911: Add type qualifier volatile to the base (userspace) address argument of fuword(9) and suword(9).
* MFC r274343:kib2014-11-172-3/+4
| | | | | When sleeping waiting for the profiling stop, always set P_STOPPROF before dropping process lock. Clear P_STOPPROF when doing wakeup.
* MFC r274023:kib2014-11-171-5/+5
| | | | | When other end of the pipe closed during the write, but some bytes were written, return short write instead of EPIPE.
* MFC r273966:kib2014-11-162-7/+9
| | | | | | | | Fix two issues with lockmgr(9) LK_CAN_SHARE() test, related to the exclusive locker starvation. MFC r273986: Fix the build with ADAPTIVE_LOCKMGRS kernel option.
* MFC r274038:kib2014-11-101-4/+6
| | | | Clean up confusing comment.
* MFC r273342:markj2014-11-061-1/+1
| | | | | Fix a typo from r189544, which replaced unp_global_rwlock with unp_list_lock and unp_link_rwlock.
* [SA-14:25] Fix kernel stack disclosure in setlogin(2) / getlogin(2).des2014-11-041-15/+16
| | | | | | [SA-14:26] Fix remote command execution in ftp(1). Approved by: so (des)
* MFC r271946 and r272595:hselasky2014-11-031-0/+31
| | | | | | | | | Improve transmit sending offload, TSO, algorithm in general. This change allows all HCAs from Mellanox Technologies to function properly when TSO is enabled. See r271946 and r272595 for more details about this commit. Sponsored by: Mellanox Technologies
* MFC r273733, r273740 and r273773:hselasky2014-10-301-17/+20
| | | | | | | | | | The SYSCTL data pointers can come from userspace and must not be directly accessed. Although this will work on some platforms, it can throw an exception if the pointer is invalid and then panic the kernel. Add a missing SYSCTL_IN() of "SCTP_BASE_STATS" structure. Sponsored by: Mellanox Technologies
* MFC r273638:mav2014-10-281-1/+3
| | | | | | | | | | | | | Revert somewhat hackish geom_disk optimization, committed as part of r256880, and the following r273143 commit, supposed to workaround introduced issue by quite innocent-looking change. While there is no clear understanding why, but r273143 is accused in data corruption in some environments with high I/O load. I personally don't see any problem in that commit, and possibly it is just a trigger to some other bug somewhere, but better safe then sorry for now. Requested by: scottl@
OpenPOWER on IntegriCloud