summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Significantly reduce the memory leak as noted in BUGS section forscf2007-07-0428-290/+1389
| | | | | | | | | | | | | | | | | | | | | | | | | | setenv(3) by tracking the size of the memory allocated instead of using strlen() on the current value. Convert all calls to POSIX from historic BSD API: - unsetenv returns an int. - putenv takes a char * instead of const char *. - putenv no longer makes a copy of the input string. - errno is set appropriately for POSIX. Exceptions involve bad environ variable and internal initialization code. These both set errno to EFAULT. Several patches to base utilities to handle the POSIX changes from Andrey Chernov's previous commit. A few I re-wrote to use setenv() instead of putenv(). New regression module for tools/regression/environ to test these functions. It also can be used to test the performance. Bump __FreeBSD_version to 700050 due to API change. PR: kern/99826 Approved by: wes Approved by: re (kensmith)
* - Use explicit locking in the various fcntl case statements so that wejeff2007-07-031-64/+99
| | | | | | | | | | | can acquire shared filedescriptor locks in the appropriate cases. - Remove Giant from calls that issue ioctls. The ioctl path has been mpsafe for some time now. - Only acquire giant for VOP_ADVLOCK when the filesystem requires giant. advlock is now mpsafe. Reviewed by: rwatson Approved by: re
* - Remove explicit Giant protection from lockf. Use the vnode interlockjeff2007-07-031-54/+56
| | | | | | | | | | to protect this datastructure instead. - Preallocate an extra lockf structure in case we want to split a lock on insert or delete. - msleep() on the vnode interlock when blocking on a lock. Reviewed by: rwatson Approved by: re
* Tweak the low-level MI SMP code some:jhb2007-07-031-11/+23
| | | | | | | | | | | | | - Use cpu_spinwait() in the spin loops in stop_cpus(), restart_cpus(), and smp_rendezvous_action(). - Remove unneeded acq memory barriers in stop_cpus(), restart_cpus(), and smp_rendezvous_action(). - Add an additional synch point in smp_rendezvous() to ensure that all the CPUs will always see an up-to-date value of smp_rv_setup_func. Reviewed by: attilio Approved by: re (kensmith) Tested on: alpha, amd64, i386, sparc64 SMP (for several years)
* Fix for a race where out of order loading of NFS attrs into thejhb2007-07-031-1/+17
| | | | | | | | | | | | nfsnode could lead to attrs being stale. One example (that we ran into) was a READDIR+, WRITE. The responses came back in order, but the attrs from the WRITE were loaded before the attrs from the READDIR+, leading to the wrong size from being read on the next stat() call. MFC after: 1 week Submitted by: mohans Approved by: re (kensmith)
* Fix up NFS client write error handling. Errors are split intojhb2007-07-031-0/+15
| | | | | | | | | | | | | recoverable and unrecoverable. For the former, we redirty the buffer and hang onto it for future retries. For the latter (eg. ESTALE), we discard the buffer and return the error back to the user on the next syscall. This fixes a number of vfs panics and fixes having a large number of dirty buffers (that cannot be written out and reclaimed) from hanging around. Thanks to ups@ for discussions on this issue. Reported by: kris, Kai, others Approved by: re (kensmith)
* Rev. 1.204 and 1.205 got an erronous version of destroy_dev() thatkib2007-07-031-6/+18
| | | | | | | | calls destroy_dev_sched() with cdev mutex locked. Commit the code that was actually tested. Pointy hat to: kib Approved by: re (implicit)
* Use the -n flag on ifconfig so that dhclient does not cause the kernel modulethompsa2007-07-031-8/+9
| | | | | | | to be reloaded when the interface is torn down. Reviewed by: brooks Approved by: re (kensmith)
* Lock Giant and proctree lock around dereferencing p_session->s_ttyvp->v_rdev.kib2007-07-031-1/+13
| | | | | | | | | | Lock cdev mutex too to close the race with tty being freed. Relock clone_drain_lock to prevent the LOR with proctree lock, thus add #include <fs/devfs/devfs_int.h>. Suggested by: tegge Debugging help and testing by: Peter Holm Approved by: re (kensmith)
* Use make_dev_credf(MAKEDEV_REF) instead of make_dev() from pty clone handler.kib2007-07-031-2/+1
| | | | | Debugging help and testing by: Peter Holm Approved by: re (kensmith)
* Use make_dev_credf(MAKEDEV_REF) instead of make_dev() from the clone handler.kib2007-07-031-10/+16
| | | | | | | | | | Lock Giant in the clone handler. Use destroy_dev_sched() explicitely from pty_maybecleanup() and postpone pty_release() until both master and slave cdevs are destroyed by setting it as callback for destroy_dev_sched(). Debugging help and testing by: Peter Holm Approved by: re (kensmith)
* Use make_dev_credf(MAKEDEV_REF) instead of make_dev() from snp clone handler.kib2007-07-031-3/+4
| | | | | | | Drain clone events and cdev destruction from the module unload handler. Debugging help and testing by: Peter Holm Approved by: re (kensmith)
* Automatically detect deadlock condition in destroy_dev(), that is, ifkib2007-07-031-2/+8
| | | | | | | | | destroy_dev() is called from csw method, and no d_purge driver method is provided. Transform the direct call to destroy_dev() into destroy_dev_sched(). Reviewed by: njl (programming interface) Debugging help and testing by: Peter Holm Approved by: re (kensmith)
* Since rev. 1.199 of sys/kern/kern_conf.c, the thread that callskib2007-07-034-18/+176
| | | | | | | | | | | | | | | | | | | | | | | destroy_dev() from d_close() cdev method would self-deadlock. devfs_close() bump device thread reference counter, and destroy_dev() sleeps, waiting for si_threadcount to reach zero for cdev without d_purge method. destroy_dev_sched() could be used instead from d_close(), to schedule execution of destroy_dev() in another context. The destroy_dev_sched_drain() function can be used to drain the scheduled calls to destroy_dev_sched(). Similarly, drain_dev_clone_events() drains the events clone to make sure no lingering devices are left after dev_clone event handler deregistered. make_dev_credf(MAKEDEV_REF) function should be used from dev_clone event handlers instead of make_dev()/make_dev_cred() to ensure that created device has reference counter bumped before cdev mutex is dropped inside make_dev(). Reviewed by: tegge (early versions), njl (programming interface) Debugging help and testing by: Peter Holm Approved by: re (kensmith)
* Relock the sema_mtxp unconditionally after copyin() for SETALL case inkib2007-07-031-1/+1
| | | | | | | | kern_semctl. Otherwise, later mtx_unlock() can operate on unlocked mutex. Submitted by: rdivacky MFC after: 3 days Approved by: re (kensmith)
* New release notes: uark(4), nxge(4), KAME IPsec removal andbmah2007-07-031-4/+26
| | | | | | | | | | | FAST_IPSEC promotion, wicontrol(8) gone, PF 4.1. Modified release notes: netstat(1) IPsec stats (modified for KAME IPsec removal). MFC noted: less v406. Approved by: re (implicitly)
* New release note: gjournal(8).bmah2007-07-031-0/+8
| | | | | | PR: docs/114070 Reminded by: Adam McDougall Approved by: re (implicitly)
* Lost these during the import. Hand me the pointy hat.mlaier2007-07-032-0/+125
| | | | Approved by: re (implicit)
* Add a note about the pf update, mark libexec/ftp-proxy as obsolete and bumpmlaier2007-07-033-1/+10
| | | | | | __FreeBSD_version for ports. Approved by: re (implicit)
* Add two place holders in struct pf_rule for future netgraph integration.mlaier2007-07-031-0/+2
| | | | | Submitted by: Ermal Luçi Approved by: re (kensmith)
* Link pf 4.1 to the build:mlaier2007-07-0322-76/+222
| | | | | | | | - move ftp-proxy from libexec to usr.sbin - add tftp-proxy - new altq mtag link Approved by: re (kensmith)
* Commit resolved import of OpenBSD 4.1 pf userland from perforce.mlaier2007-07-0328-3423/+3641
| | | | Approved by: re (kensmith)
* This commit was generated by cvs2svn to compensate for changes in r171169,mlaier2007-07-0321-7/+5188
|\ | | | | | | which included commits to RCS files with non-trunk default branches.
| * Import pf userland from OpenBSD 4.1 and (for ftp-proxy) libevent 1.3b asmlaier2007-07-0343-2655/+8750
| | | | | | | | a local lib.
* | Commit resolved import of OpenBSD 4.1 pf from perforce.mlaier2007-07-0313-2488/+3410
| | | | | | | | Approved by: re (kensmith)
* | Commit the change from FAST_IPSEC to IPSEC. The FAST_IPSECgnn2007-07-0343-219/+209
| | | | | | | | | | | | | | | | option is now deprecated, as well as the KAME IPsec code. What was FAST_IPSEC is now IPSEC. Approved by: re Sponsored by: Secure Computing
* | This commit was generated by cvs2svn to compensate for changes in r171164,mlaier2007-07-031-0/+415
|\ \ | | | | | | | | | which included commits to RCS files with non-trunk default branches.
| * | Import pf from OpenBSD 4.1mlaier2007-07-0312-1690/+2973
| | |
| * | Loopback four fixes from OpenBSD for problems reported to the freebsd-pfmlaier2005-09-082-21/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mailing list onto the vendor branch: pf_ioctl.c Revision 1.153 Sun Aug 7 11:37:33 2005 UTC by dhartmei | verify ticket in DIOCADDADDR, from Boris Polevoy, ok deraadt@ pf_ioctl.c Revision 1.158 Mon Sep 5 14:51:08 2005 UTC by dhartmei | in DIOCCHANGERULE, properly initialize table, if used in NAT rule. | from Boris Polevoy <vapcom at mail dot ru>, ok mcbride@ pf.c Revision 1.502 Mon Aug 22 11:54:25 2005 UTC by dhartmei | when nat'ing icmp 'connections', replace icmp id with proxy values | (similar to proxy ports for tcp/udp). not all clients use | per-invokation random ids, this allows multiple concurrent | connections from such clients. | thanks for testing to Rod Whitworth, "looks ok" markus@ pf.c Revision 1.501 Mon Aug 22 09:48:05 2005 UTC by dhartmei | fix rdr to bitmask replacement address pool. patch from Max Laier, | reported by Boris Polevoy, tested by Jean Debogue, ok henning@
| * | Import pf from OpenBSD 3.7 (OPENBSD_3_7 as of today)mlaier2005-05-0311-1093/+2403
| | |
| * | Import a fix from the OpenBSD-stable branch, that slipped by my previousmlaier2004-08-121-2/+3
| | | | | | | | | | | | import. Sorry.
| * | Import a couple of fixes from OpenBSD-current, which did not make -stable inmlaier2004-08-124-7/+17
| | | | | | | | | | | | | | | | | | OpenBSD for various reasons. Discussed with: yongari
| * | Import from OpenBSD stable branchmlaier2004-07-171-42/+53
| | |
| * | Import OpenBSD stable branch.mlaier2004-06-173-19/+16
| | |
* | | Fix hardware checksum verification on fragments.mlaier2007-07-031-0/+9
| | | | | | | | | | | | | | | | | | | | | MFC after: 7 days Reported/tested by: Hugo Koji Kobayashi, Vadym Chepkov Reviewed/help by: yongari Approved by: re (kensmith)
* | | Fixing !INET6 + FAST_IPSEC builds.avatar2007-07-031-1/+1
| | | | | | | | | | | | | | | Reviewed by: gnn Approved by: re (kensmith)
* | | Recover from some major omissions/problems with the 24XX port.mjacob2007-07-024-21/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, we were never correctly checking for a 24XX Status Type 0 response- that cased us to fall through to evaluate status for commands as if this were a 2100/2200/2300 Status Type 0 response. This is *close*, but not quite the same. This has been reported to be apparent with some wierd lun configuration problems with some arrays. It became glaringly apparent on sparc64 where none of the correct byte swap things were done. Fixing this omission then caused a whole universe shifting debug cycle of endian issues for the 2400. The manual for 24XX f/w turns out to be wrong about the endianness of a couple of entities. The lun and cdb fields for the type 7 request are *not* unconditionally big endian- they happen to be opposite of whatever the endian of the current machine type is. Same with the sense data for the 24XX type 0 response. While we're at it investigate and resolve some NVRAM endian issues. Approved by: re (ken) MFC after: 3 days
* | | - Consolidate the code that free's chunks to actually alsorrs2007-07-027-43/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | call the sctp_free_remote_address() function. - Assure that when we allocate a chunk the whoTo is NULL, also when we free it and place it into the cache we NULL it (that way the consolidation code will always work). - Fix a small race, when a empty data holder is left on the stream out queue, and both sides do a shutdown, the empty data holder would prevent us from sending a SHUTDOWN-ACK and at the same time we never would cleanup the empty holder (since nothing was ever in queue). We now add a utility function that a) cleans up empty holders and b) properly determines if there are still pending data chunks on the stream out wheel. Approved by: re@freebsd.org (Ken Smith)
* | | Continue pre-7.0 privilege cleanup: update suser(9) comments to be priv(9)rwatson2007-07-022-3/+3
| | | | | | | | | | | | | | | | | | comments. Approved by: re (bmah)
* | | Continue kernel privilege cleanup for 7.0: unstaticize suser_enabled andrwatson2007-07-022-2/+1
| | | | | | | | | | | | | | | | | | | | | stop declaring it in systm.h -- it's used only in kern_priv.c and is not required elsewhere. Approved by: re (kensmith)
* | | ed(1) no longer relies on crypto library when built for the fixit media.kensmith2007-07-021-1/+1
| | | | | | | | | | | | Approved by: re (hrs)
* | | Don't include encryption features of ed(1) when building for thekensmith2007-07-021-0/+2
| | | | | | | | | | | | | | | | | | | | | "rescue media" bundled with releases. Suggested by: ru Approved by: re (hrs)
* | | - Add some needed error checking on bad fd passing in the sctprrs2007-07-021-6/+10
| | | | | | | | | | | | | | | | | | syscalls. Approved by: re@freebsd.org (Ken Smith) Obtained from: Weongyo Jeong (weongyo.jeong@gmail.com)
* | | - Removes some incorrect error returns (errno was being overriden inrrs2007-07-021-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | one of the functions) - Fixes the error return of sctp_get_opt, it was returning the errno not -1. Approved by: re@freebsd.org (Robert Watson) Obtained from: Weongyo Jeong (weongyo.jeong@gmail.com)
* | | In the previous revision, when I replaced the unconditional acquisitionalc2007-07-021-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of Giant in vm_pageout_scan() with VFS_LOCK_GIANT(), I had to eliminate the acquisition of the vnode interlock before releasing the vm object's lock because the vnode interlock cannot be held when VFS_LOCK_GIANT() is performed. Unfortunately, this allows the vnode to be recycled between the release of the vm object's lock and the vget() on the vnode. In this revision, I prevent the vnode from being recycled by acquiring another reference to the vm object and underlying vnode before releasing the vm object's lock. This change also addresses another preexisting but trivial problem. By acquiring another reference to the vm object, I also prevent the vm object from being recycled. Previously, the "vnodes skipped" counter could be wrong because if it examined a recycled vm object. Reported by: kib Reviewed by: kib Approved by: re (kensmith) MFC after: 3 weeks
* | | WD Firewire/USB Combo hangs under load on USB interface. Fix withimp2007-07-022-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | these quirks. Submitted by: John Pettitt PR: 79140 Approved by: re@ (blanket)
* | | Removing old, dead, KAME IPsec files as part of the move to thegnn2007-07-0217-20184/+0
| | | | | | | | | | | | | | | | | | | | | new FAST_IPSEC based IPsec stack. Approved by: re Reviewed by: bz
* | | Fix an annoying pointer/int cast warning that shows up on 64 bit systems.peter2007-07-021-1/+1
| | | | | | | | | | | | Approved by: re
* | | Revert previous commit, retaining cpufreq.njl2007-07-012-0/+6
| | | | | | | | | | | | Approved by: re (implicitly)
* | | Add cpufreq(4) to GENERIC. It does not change the frequency by default,njl2007-07-014-6/+6
| | | | | | | | | | | | | | | | | | | | | so systems should be relatively unaffected. Users can then simply enable powerd(8) in rc.conf to take advantage of it. Approved by: re
OpenPOWER on IntegriCloud