summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* MFC r270096:trasz2014-08-311-0/+4
| | | | | | | | | | | | | Bring in the new automounter, similar to what's provided in most other UNIX systems, eg. MacOS X and Solaris. It uses Sun-compatible map format, has proper kernel support, and LDAP integration. There are still a few outstanding problems; they will be fixed shortly. Reviewed by: allanjude@, emaste@, kib@, wblock@ (earlier versions) Phabric: D523 Relnotes: yes Sponsored by: The FreeBSD Foundation
* MFC r269963+269964:delphij2014-08-291-14/+10
| | | | | | | | | | | Re-instate UMA cached backend for 4K - 64K allocations. New consumers like geli(4) uses malloc(9) to allocate temporary buffers that gets free'ed shortly, causing frequent TLB shootdown as observed in hwpmc supported flame graph. Add a new loader tunable, vm.kmem_zmax which allows a system administrator to limit the maximum allocation size that malloc(9) would consider using the UMA cache allocator as backend.
* MFC r270345:kib2014-08-291-2/+4
| | | | | In do_lock_pi(), do not override error from umtxq_sleep_pi() when doing suspend check.
* MFC r270321:kib2014-08-291-33/+44
| | | | | | | | | Ensure that sigaction flags for signal, which disposition is reset to ignored or default, are not leaking. MFC r270504: Revert the handling of all siginfo sa_flags except SA_SIGINFO to the pre-r270321 state.
* MFC r270320:kib2014-08-291-0/+4
| | | | | Check the validity of struct sigaction sa_flags value, reject unknown flags.
* Commit forgotten chunk of r270264.kib2014-08-211-0/+1
|
* MFC r269656:kib2014-08-213-20/+50
| | | | | | | | | | Implement and use proc_realparent(9). MFC r270024 (by markj): Correct the order of arguments passed to LIST_INSERT_AFTER(). For merge, the p_treeflag member of struct proc was moved to the end of the structure, to keep KBI intact.
* MFC r269502:davide2014-08-201-6/+6
| | | | | | | Fix an overflow in getsockopt(). optval isn't big enough to hold sbintime_t. Re-introduce r255030 behaviour capping socket timeouts to INT_32 if they're too large.
* MFC r269907:kib2014-08-202-6/+7
| | | | Fix leaks of unqueued unwired pages.
* MFC r265098grehan2014-08-191-1/+1
| | | | | Bump WITNESS_PENDLIST by MAXCPU to account for the pmap pvlist locks which are scaled by MAXCPU.
* MFC of 269533 (by mckusick):mckusick2014-08-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for multi-threading of soft updates. Replace a single soft updates thread with a thread per FFS-filesystem mount point. The threads are associated with the bufdaemon process. Reviewed by: kib Tested by: Peter Holm and Scott Long MFC after: 2 weeks Sponsored by: Netflix MFC of 269853 (by kib): Revision r269457 removed the Giant around mount and unmount code, but r269533, which was tested before r269457 was committed, implicitely relied on the Giant to protect the manipulations of the softdepmounts list. Use softdep global lock consistently to guarantee the list structure now. Insert the new struct mount_softdeps into the softdepmounts only after it is sufficiently initialized, to prevent softdep_speedup() from accessing bare memory. Similarly, remove struct mount_softdeps for the unmounted filesystem from the tailq before destroying structure rwlock. Reported and tested by: pho Reviewed by: mckusick Sponsored by: The FreeBSD Foundation
* MFC r269457:kib2014-08-173-65/+87
| | | | Remove Giant acquisition from the mount and unmount pathes.
* MFC r269020:mjg2014-08-171-5/+4
| | | | | | | | Cosmetic changes to unp_internalize Don't throw away the result of fget_unlocked. Move fdp increment to for loop to make it consistent with similar code elsewhere.
* MFC r268636:mjg2014-08-171-1/+1
| | | | Plug p_pptr null test in do_execve. It is always true.
* MFC r268634:mjg2014-08-171-10/+7
| | | | Manage struct sigacts refcnt with atomics instead of a mutex.
* MFC r264114, r264310, r268570:mjg2014-08-171-31/+55
| | | | | | | | | | | | | | | | | r264114 by davidxu: Fix SIGIO delivery. Use fsetown() to handle file descriptor owner ioctl and use pgsigio() to send SIGIO. r264310 by davidxu: Add kqueue support for devctl. r268570: Clear nonblock and async on devctl close instaed of open. This is a purely cosmetic change.
* MFC r268514:mjg2014-08-171-6/+3
| | | | | | Eliminate plim and vtmp local vars in exit1. No functional changes.
* MFC r259407:mjg2014-08-171-2/+0
| | | | | | | proc exit: don't take PROC_LOCK while freeing rlimits Code wishing to check rlimits of some process should check whether it is exiting first, which current consumers do.
* MFC r268505, r268507:mjg2014-08-171-17/+31
| | | | | | | | | | | | | | | | Avoid relocking filedesc lock when closing fds during fdp destruction. Don't call bzero nor fdunused from fdfree for such cases. It would do unnecessary work and complain that the lock is not taken. ======= Don't zero fd_nfiles during fdp destruction. Code trying to take a look has to check fd_refcnt and it is 0 by that time. This is a follow up to r268505, without this the code would leak memory for tables bigger than the default.
* MFC r268365:mjg2014-08-171-2/+4
| | | | | | | | Don't call crdup nor uifind under vnode lock. A locked vnode can get into the way of satisyfing malloc with M_WATOK. This is a fixup to r268087.
* MFC r268136:mjg2014-08-171-1/+3
| | | | Plug gcc warning after r268074 about unitialized newsigacts
* MFC r268087:mjg2014-08-171-10/+10
| | | | Don't call crcopysafe or uifind unnecessarily in execve.
* MFC r268074:mjg2014-08-172-10/+5
| | | | | | | | | | Perform a lockless check in sigacts_shared. It is used only during execve (i.e. singlethreaded), so there is no fear of returning 'not shared' which soon becomes 'shared'. While here reorganize the code a little to avoid proc lock/unlock in shared case.
* MFC r269669:bz2014-08-161-2/+9
| | | | | | | Split up sys_ktimer_getoverrun() into a sys_ and a kern_ variant and export the kern_ version needed by an upcoming linuxolator change. Sponsored by: DARPA,AFRL
* MFC r266826, r266827markj2014-08-091-0/+9
| | | | | Move some duplicated hook definitions from machine-dependent files to kern_dtrace.c.
* MFC r269408, r269409:rpaulo2014-08-081-2/+12
| | | | shm_open()/shm_unlink() ktrace support.
* MFC r269244:kib2014-08-051-16/+25
| | | | Remove one-time use macros which check for the vnode lifecycle.
* MFC r269190:kib2014-08-041-0/+1
| | | | | For md(4), posix shm(3) and tmpfs(5), free swap space used by paged in dirty page, which is written by the process.
* Insta-MFC r269489: partial revert of r262867 which was MFC'ed as r263820.peter2014-08-031-1/+1
| | | | | Don't ignore sndbuf/rcvbuf limits for SOCK_DGRAM sockets. This appears to be an edit error or patch fuzz mismatch.
* Partial MFC of r267961, r267973, r267985, r267992, r267993 and r268005:hselasky2014-08-021-13/+13
| | | | | Backport some macro definitions to make backporting code from FreeBSD current easier.
* MFC r268780truckman2014-08-011-102/+10
| | | | | | | | | | | | | | | | | | Nuke the never-used RF_TIMESHARE feature, reducing the complexity of the code. The consensus on arch@ is that this feature might have been useful in the distant past, but is now just unnecessary bloat. The int_rman_activate_resource() and int_rman_deactivate_resource() functions become trivial, so manually inline them. The special deferred handling of RF_ACTIVE is no longer needed in reserve_resource_bound(), so eliminate the associated code at the end of the function. These changes reduce the object file size by more than 500 bytes on i386. Update the rman.9 man page to reflect the removal of the RF_TIMESHARE feature.
* MFC r269205:kib2014-08-011-1/+1
| | | | Simplify the expression.
* MFC r268764:kib2014-07-301-1/+9
| | | | | Check for the cross-device cross-link attempt in the VFS, instead of VOP_LINK() implemenations.
* MFC r268612:kib2014-07-281-0/+31
| | | | | | | Add helper helper vfs_write_suspend_umnt(). Fix the bug in the FFS unmount, when suspension failed, the ufs extattrs were not reinitialized.
* MFC r268607:kib2014-07-281-2/+8
| | | | In kern_linkat(), avoid passing doomed vnode to the VOP.
* MFC r268606:kib2014-07-281-4/+27
| | | | | | Generalize vn_get_ino() to allow filesystems to use custom vnode producer. Convert inline copies of vn_get_ino() in msdosfs and cd9660 into the uses of vn_get_ino_gen().
* MFC r268466:kib2014-07-241-35/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | Calculate the amount of resident pages by looking in the objects chain backing the region. Add a knob to disable the residency calculation at all. MFC r268490: Unconditionally initialize addr to handle the case of changed map timestamp while the map is unlocked. MFC r268711: Change the calculation of the kinfo_vmentry field kve_private_resident to reflect its name. MFC r268712: Followup to r268466. - Move the code to calculate resident count into separate function. It reduces the indent level and makes the operation of vmmap_skip_res_cnt tunable more clear. - Optimize the calculation of the resident page count for map entry. Skip directly to the next lowest available index and page among the whole shadow chain. - Restore the use of pmap_incore(9), only to verify that current mapping is indeed superpage. - Note the issue with the invalid pages.
* MFC r268384:kib2014-07-241-1/+9
| | | | | When the lock was stolen from us, retry the whole lock sequence in kernel, instead of returning EINTR.
* MFC r268787:kevlo2014-07-241-1/+1
| | | | Deprecate m_act. Use m_nextpkt always.
* MFC r268601:kevlo2014-07-241-0/+6
| | | | | | | | | | Make bind(2) and connect(2) return EAFNOSUPPORT for AF_UNIX on wrong address family. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191586 for the original discussion. Reviewed by: terry
* MFC r268373truckman2014-07-171-24/+40
| | | | Declaration whitespace changes for style(9).
* MFC r268211:kib2014-07-101-6/+8
| | | | Micro-manage clang to get the expected inlining for cpu_search().
* Fix kernel memory disclosure in control message and SCTP notifications.delphij2014-07-081-0/+5
| | | | | Security: FreeBSD-SA-14:17.kmem Security: CVE-2014-3952, CVE-2014-3953
* 267622 Log:ray2014-07-071-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename vt(4) vga module to dismiss interference with syscons(4) vga module. 267623 Log: Remove stale link to deleted vt(4) xboxfb driver. 267624 Log: syscons(4) and vt(4) can be built together now. 267625 Log: Allow to disable syscons(4) if "hw.syscons.disable" kenv is set. 267626 Log: Suspend vt(4) initialization if "kern.vt.disable" kenv is set. 267965 by emaste@ Log: Use a common tunable to choose between vt(4)/sc(4) With this change and previous work from ray@ it will be possible to put both in GENERIC, and have one enabled by default, but allow the other to be selected via the loader. (The previous implementation had separate kern.vt.disable and hw.syscons.disable tunables, and would panic if both drivers were compiled in and neither was explicitly disabled.) 268175 by emaste@ Log: Fix vt(4) detection in kbdcontrol and vidcontrol As sc(4) and vt(4) coexist and are both enabled in GENERIC, the existence of a vt(4) sysctl is not sufficient to determine that vt(4) is in use. Reported by: Trond Endrestøl 268045 by emaste@ Log: Add vt(4) to GENERIC and retire the separate VT config vt(4) and sc(4) can now coexist in the same kernel. To choose the vt driver, set the loader tunable kern.vty=vt . Sponsored by: The FreeBSD Foundation
* MFC r268002:mjg2014-07-061-2/+2
| | | | | | Call fdcloseexec right after fdunshare. No functional changes.
* MFC r268001:mjg2014-07-063-4/+5
| | | | | | | Make fdunshare accept only td parameter. Proc had to match the thread anyway and 2 parameters were inconsistent with the rest.
* MFC r268000:mjg2014-07-061-5/+5
| | | | | | | | | | | | Make sure to always clear p_fd for process getting rid of its filetable. Filetable can be shared with other processes. Previous code failed to clear the pointer for all but the last process getting rid of the table. This is mostly cosmetics. Get rid of 'This should happen earlier' comment. Clearing the pointer in this place is fine as consumers can reliably check for files availability by inspecting fd_refcnt and vnodes availabity by NULL-checking them.
* MFC r267947:mjg2014-07-061-1/+1
| | | | | | | | | | | | | | Check lower bound of cmsg_len. If passed cm->cmsg_len was below cmsghdr size the experssion: datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data; would give negative result. However, in practice it would not result in a crash because the kernel would try to obtain garbage fds for given process and would error out with EBADF. PR: 124908 Submitted by: campbell mumble.net (modified a little)
* MFC r267760:mjg2014-07-061-18/+2
| | | | | | | | | | | | Tidy up fd-related functions called by do_execve o assert in each one that fdp is not shared o remove unnecessary NULL checks - all userspace processes have fdtables and kernel processes cannot execve o remove comments about the danger of fd_ofiles getting reallocated - fdtable is not shared and fd_ofiles could be only reallocated if new fd was about to be added, but if that was possible the code would already be buggy as setugidsafety work could be undone
* MFC r267755:mjg2014-07-061-9/+6
| | | | | | | | | | Don't take filedesc lock in fdunshare(). We can read refcnt safely and only care if it is equal to 1. If it could suddenly change from 1 to something bigger the code would be buggy even in the previous form and transitions from > 1 to 1 are equally racy and harmless (we copy even though there is no need).
OpenPOWER on IntegriCloud