summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Change the current working directory to be inside the jail created byColin Percival2010-05-271-1/+8
| | | | | | | | | | | | | | | | | the jail(8) command. [10:04] Fix a one-NUL-byte buffer overflow in libopie. [10:05] Correctly sanity-check a buffer length in nfs mount. [10:06] Approved by: so (cperciva) Approved by: re (kensmith) Security: FreeBSD-SA-10:04.jail Security: FreeBSD-SA-10:05.opie Security: FreeBSD-SA-10:06.nfsclient Notes: svn path=/releng/8.0/; revision=208586
* MFC r198376Andrew Thompson2009-10-231-1/+5
| | | | | | | | | | Prevent wraparound of the timeout variable. Submitted by: HPS Approved by: re (kib) Notes: svn path=/stable/8/; revision=198386
* MFC Revision 197277:Alexander Kabaev2009-10-201-0/+4
| | | | | | | | | | | | Make libc.a provide __stack_chk_fail_local weak alias. This is needed to satisfy static libraries that are compiled with -fpic and linked into static binary afterwards. Several libraries in gcc are examples of such static libs. Approved by: re (kib) Notes: svn path=/stable/8/; revision=198304
* MFC r197958:Konstantin Belousov2009-10-141-1/+3
| | | | | | | | | | | In nanosleep(2), note that the calling thread is put to sleep, not the whole process. Also explicitely name the parameter that specifies sleep interval. Approved by: re (kensmith) Notes: svn path=/stable/8/; revision=198080
* MFC: r197312Christian Brueffer2009-10-091-2/+2
| | | | | | | | | Fix setfib(1) section number. Approved by: re (kib) Notes: svn path=/stable/8/; revision=197907
* MFC: rev. 197681Joe Marcus Clarke2009-10-041-1/+1
| | | | | | | | | | | Correct the pthread stub prototype for pthread_mutexattr_settype to allow for the type argument. This is known to fix some pthread_mutexattr_settype() invocations, especially when it comes to pulseaudio. Approved by: re (kib) Notes: svn path=/stable/8/; revision=197758
* MFC r196990:Brooks Davis2009-09-241-1/+1
| | | | | | | | | | | | | | | | cr_groups is no longer embedded in struct ucred and is instead stored in a seperate array. As such we need to use kvm_read rather than bcopy to populate the ki_groups field. This fixes a crash when running ps -ax on a coredump. Reported by: brucec Tested by: brucec MFC after: 3 days Approved by: re@ (kib) Notes: svn path=/stable/8/; revision=197474
* MFC: r197322 and r197374Yoshihiro Takahashi2009-09-241-3/+8
| | | | | | | | | | | | | | | | | | | | Revision: 197322 Log: Correct BIOS header sanitizing on pc98. Revision: 197374 Log: Disable a check on a disk size because it's too strict. This change is to avoid using incorrect geometry. It seems that this is the same problem in g_part_bsd_read()@g_part_bsd.c. Reviewed by: rink Approved by: re (kib) Notes: svn path=/stable/8/; revision=197457
* MFC r197445:Attilio Rao2009-09-241-2/+5
| | | | | | | | | | | | | | | | Let fall down in the hard path (thus handling shared waiters wakeup correctly) for the shared waiters also in the rwlock held in shared mode as well, fixing possible deadlocks. Please note that this is a special condition as we want this fix in before RC2 as we assume it is critical and so it has been handled as an instant-merge. For the STABLE_7 branch, 1 week before the MFC is assumed. Approved by: re (kib) Notes: svn path=/stable/8/; revision=197452
* MFC r196962: Fix /usr/bin/unzip: A bug deep in libarchive's read-ahead logicTim Kientzle2009-09-172-3/+6
| | | | | | | | | | | | | | | (incorrect handling of zero-length reads before the copy buffer is allocated) is masked by the iso9660 taster. Tar and cpio both enable that taster so were protected from the bug; unzip is susceptible. This both fixes the bug and updates the test harness to exercise this case. Submitted by: Ed Schouten diagnosed the bug and drafted a patch Approved by: re (kib) Notes: svn path=/stable/8/; revision=197266
* MFC r197224:Attilio Rao2009-09-151-4/+4
| | | | | | | | | | | | | | | Use explicit int values for the device states in order to allow, if necessary, in the future, adds of new states without breaking ABI between revisions. Please note that this is a special condition as we want this fix in before RC1 as we assume it is critical and so it has been handled as an instant-merge. Approved by: re (kib) Notes: svn path=/stable/8/; revision=197228
* MFC r196861:Konstantin Belousov2009-09-121-0/+9
| | | | | | | | | | Handle zero size for posix_memalign. Return NULL or unique address according to the 'V' option. Approved by: re (kensmith) Notes: svn path=/stable/8/; revision=197127
* Remove extra debugging support that is turned on for head but turned offKen Smith2009-09-101-1/+1
| | | | | | | | | | | | | | | | | | for stable branches: - shift to MALLOC_PRODUCTION - turn off automatic crash dumps - Remove kernel debuggers, INVARIANTS*[1], WITNESS* from GENERIC kernel config files[2] [1] INVARIANTS* left on for ia64 by request marcel [2] sun4v was left as-is Reviewed by: marcel, kib Approved by: re (implicit) Notes: svn path=/stable/8/; revision=197065
* MFC r196740:Edward Tomasz Napierala2009-09-052-11/+12
| | | | | | | | | | | | | Fix regression introduced with NFSv4 ACL support - make acl_to_text(3) and acl_calc_mask(3) return error instead of crashing when acl passed to them is NULL. Submitted by: markus Reviewed by: rwatson Approved by: re (kib) Notes: svn path=/stable/8/; revision=196862
* MFC r196525:Xin LI2009-08-281-2/+2
| | | | | | | | | | | Consider flag == 0 as the same of flag == R_NEXT. This change will restore a historical behavior that has been changed by revision 190491, and has seen to break exim. Approved by: re (kib) Notes: svn path=/stable/8/; revision=196625
* MFC r196508:Ed Schouten2009-08-281-15/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Our implementation of granpt(3) could be valid in the future. When I wrote the pseudo-terminal driver for the MPSAFE TTY code, Robert Watson and I agreed the best way to implement this, would be to let posix_openpt() create a pseudo-terminal with proper permissions in place and let grantpt() and unlockpt() be no-ops. This isn't valid behaviour when looking at the spec. Because I thought it was an elegant solution, I filed a bug report at the Austin Group about this. In their last teleconference, they agreed on this subject. This means that future revisions of POSIX may allow grantpt() and unlockpt() to be no-ops if an open() on /dev/ptmx (if the implementation has such a device) and posix_openpt() already do the right thing. I'd rather put this in the manpage, because simply mentioning we don't comply to any standard makes it look worse than it is. Right now we don't, but at least we took care of it. Approved by: re (kib) Notes: svn path=/stable/8/; revision=196614
* Merge r196123 from head to stable/8:Robert Watson2009-08-137-156/+129
| | | | | | | | | | Update posix1e-related man pages, especially as relates to MAC, to more accurately reflect the last ten years of work. Approved by: re (kib) Notes: svn path=/stable/8/; revision=196190
* MFC r196185:Bjoern A. Zeeb2009-08-131-1/+1
| | | | | | | | | | | | | | Rather than replicating the maths from the kernel, use the value the kernel calculated directly as we already read it with struct vnet. This will make kvm_vnet.c more resilent in case of possible kernel changes. Reviewed by: rwatson Approved by: re (kib) Notes: svn path=/stable/8/; revision=196188
* Merge the remainder of kern_vimage.c and vimage.h into vnet.c andRobert Watson2009-08-011-1/+0
| | | | | | | | | | | | | vnet.h, we now use jails (rather than vimages) as the abstraction for virtualization management, and what remained was specific to virtual network stacks. Minor cleanups are done in the process, and comments updated to reflect these changes. Reviewed by: bz Approved by: re (vimage blanket) Notes: svn path=/head/; revision=196019
* LibUSB v1.0:Alfred Perlstein2009-07-309-1531/+1356
| | | | | | | | | | | | - Significantly improve libusb10 support. - Many minor issues fixed. - P4 ID: 166189, 165853, 165991, 166052, 166069 Submitted by: hps Approved by: re Notes: svn path=/head/; revision=195957
* The parser for Rockridge symlinks tended to insertTim Kientzle2009-07-261-8/+8
| | | | | | | | | | | extra slashes at the beginning of absolute targets. Thanks to Jung-uk Kim for pointing this out to me. Approved by: re (kib) Notes: svn path=/head/; revision=195895
* Eliminate a stale paragraph from the BUGS section. This "bug" wasAlan Cox2009-07-261-8/+1
| | | | | | | | | eliminated in r195693. Approved by: re (kensmith) Notes: svn path=/head/; revision=195882
* Libarchive recognizes hardlinked files on ISO images,Tim Kientzle2009-07-251-0/+1
| | | | | | | | | | | | | | but returned them incorrectly, causing tar to actually erase the resulting file while trying to restore the link. This one-line fix corrects the hardlink descriptions to avoid this problem. Thanks to Jung-uk Kim for pointing this out. Approved by: re (kib) Notes: svn path=/head/; revision=195873
* Some jail parameters (in particular, "ip4" and "ip6" for IP addressJamie Gritton2009-07-252-60/+89
| | | | | | | | | | | | restrictions) were found to be inadequately described by a boolean. Define a new parameter type with three values (disable, new, inherit) to handle these and future cases. Approved by: re (kib), bz (mentor) Discussed with: rwatson Notes: svn path=/head/; revision=195870
* Revert the changes to struct kinfo_proc in r194498. Instead, fillBrooks Davis2009-07-241-2/+8
| | | | | | | | | | | | | in up to 16 (KI_NGROUPS) values and steal a bit from ki_cr_flags (all bits currently unused) to indicate overflow with the new flag KI_CRF_GRP_OVERFLOW. This fixes procstat -s. Approved by: re (kib) Notes: svn path=/head/; revision=195843
* Make libkvm work on live systems and crashdumps with andBjoern A. Zeeb2009-07-234-9/+412
| | | | | | | | | | | | | | | | | | | | | without VIMAGE virtualization in the kernel. If we cannot resolve a symbol try to see if we can find it with prefix of the virtualized subsystem, currently only "vnet_entry" by identifying either the vnet of the current process for a live system or the vnet of proc0 (or of dumptid if compiled in a non-default way). The way this is done currently allows us to only touch libkvm but no single application. Once we are going to virtualize more subsystems we will have to review this decision for better scaling. Submitted by: rwatson (initial version of kvm_vnet.c, lots of ideas) Reviewed by: rwatson Approved by: re (kib) Notes: svn path=/head/; revision=195838
* It is believed the last subsystem that limited ID sizes to somethingKen Smith2009-07-221-7/+18
| | | | | | | | | | | | | other than the current system-wide size (32-bits) has been updated so for now just cautiously turn the check off. While here fix the check for IDs being too large which doesn't work due to type mis-matches. Reviewed by: jhb (previous version) Approved by: re (kib) MFC after: 1 month (type mis-match fixes only) Notes: svn path=/head/; revision=195827
* Bump the version of all non-symbol-versioned shared libraries inKen Smith2009-07-1941-41/+41
| | | | | | | | | | | preparation for 8.0-RELEASE. Add the previous version of those libraries to ObsoleteFiles.inc and bump __FreeBSD_Version. Reviewed by: kib Approved by: re (rwatson) Notes: svn path=/head/; revision=195767
* Correct AT_SYMLINK_FOLLOW flag name in linkat(2) man page.Jilles Tjoelker2009-07-191-1/+1
| | | | | | | Approved by: re (kib), ed (mentor) Notes: svn path=/head/; revision=195763
* Store accurate offset information in CTF data. A large number ofNavdeep Parhar2009-07-171-2/+2
| | | | | | | | | | | | | | | | | | structs had incorrect member offsets, limiting dtrace's usefulness when working with them. An example of incorrect info (struct rtentry) from before this fix: <1738> STRUCT rtentry (200 bytes) rt_nodes type=1731 off=0 rt_gateway type=849 off=65280 <== WRONG, should be 8 * 96 rt_flags type=3 off=65344 <== wrong again, and so on.. ... Approved by: re (kib), gnn (mentor) MFC after: 2 weeks Notes: svn path=/head/; revision=195747
* Implement RTLD_NOLOAD flag for dlopen(3).Konstantin Belousov2009-07-171-1/+8
| | | | | | | | | Requested and tested by: jkim Reviewed by: kan Approved by: re (kensmith) Notes: svn path=/head/; revision=195745
* Second attempt at eliminating .text relocations in shared librariesAlexander Kabaev2009-07-143-8/+2
| | | | | | | | | | | | | | | | | compiled with stack protector. Use libssp_nonshared library to pull __stack_chk_fail_local symbol into each library that needs it instead of pulling it from libc. GCC generates local calls to this function which result in absolute relocations put into position-independent code segment, making dynamic loader do extra work every time given shared library is being relocated and making affected text pages non-shareable. Reviewed by: kib Approved by: re (kib) Notes: svn path=/head/; revision=195697
* - Change mmap() to fail requests with EINVAL that pass a length of 0. ThisJohn Baldwin2009-07-141-2/+2
| | | | | | | | | | | | | | | behavior is mandated by POSIX. - Do not fail requests that pass a length greater than SSIZE_MAX (such as > 2GB on 32-bit platforms). The 'len' parameter is actually an unsigned 'size_t' so negative values don't really make sense. Submitted by: Alexander Best alexbestms at math.uni-muenster.de Reviewed by: alc Approved by: re (kib) MFC after: 1 week Notes: svn path=/head/; revision=195693
* Add missing MLINKS for acl_{get,set}_link_fd(3).Edward Tomasz Napierala2009-07-141-0/+2
| | | | | | | Approved by: re (kib) Notes: svn path=/head/; revision=195692
* Move msg{snd,recv,get,ctl} manual pages from section 3 to 2.Edward Tomasz Napierala2009-07-137-26/+27
| | | | | | | Approved by: re (kib) Notes: svn path=/head/; revision=195656
* Fix fwrite() to return 0 when size or nmemb are zero.Ed Schouten2009-07-122-4/+9
| | | | | | | | | | | Right now nmemb is returned when size is 0. In newer versions of the standards, it is explicitly required that fwrite() should return 0. Submitted by: Christoph Mallon Approved by: re (kib) Notes: svn path=/head/; revision=195637
* Sync the libusb 1.0 exported api to the latest GSoC code.Andrew Thompson2009-07-105-506/+510
| | | | | | | | | | | | | - Fix possible uninitialised variables and null derefs - Support big transfers - Various bug fixes and style changes Submitted by: Sylvestre Gallon Sponsored by: Google Summer of Code 2009 Approved by: re (kib) Notes: svn path=/head/; revision=195560
* Separate the parallel scsi knowledge out of the core of the XPT, andScott Long2009-07-101-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | modularize it so that new transports can be created. Add a transport for SATA Add a periph+protocol layer for ATA Add a driver for AHCI-compliant hardware. Add a maxio field to CAM so that drivers can advertise their max I/O capability. Modify various drivers so that they are insulated from the value of MAXPHYS. The new ATA/SATA code supports AHCI-compliant hardware, and will override the classic ATA driver if it is loaded as a module at boot time or compiled into the kernel. The stack now support NCQ (tagged queueing) for increased performance on modern SATA drives. It also supports port multipliers. ATA drives are accessed via 'ada' device nodes. ATAPI drives are accessed via 'cd' device nodes. They can all be enumerated and manipulated via camcontrol, just like SCSI drives. SCSI commands are not translated to their ATA equivalents; ATA native commands are used throughout the entire stack, including camcontrol. See the camcontrol manpage for further details. Testing this code may require that you update your fstab, and possibly modify your BIOS to enable AHCI functionality, if available. This code is very experimental at the moment. The userland ABI/API has changed, so applications will need to be recompiled. It may change further in the near future. The 'ada' device name may also change as more infrastructure is completed in this project. The goal is to eventually put all CAM busses and devices until newbus, allowing for interesting topology and management options. Few functional changes will be seen with existing SCSI/SAS/FC drivers, though the userland ABI has still changed. In the future, transports specific modules for SAS and FC may appear in order to better support the topologies and capabilities of these technologies. The modularization of CAM and the addition of the ATA/SATA modules is meant to break CAM out of the mold of being specific to SCSI, letting it grow to be a framework for arbitrary transports and protocols. It also allows drivers to be written to support discrete hardware without jeopardizing the stability of non-related hardware. While only an AHCI driver is provided now, a Silicon Image driver is also in the works. Drivers for ICH1-4, ICH5-6, PIIX, classic IDE, and any other hardware is possible and encouraged. Help with new transports is also encouraged. Submitted by: scottl, mav Approved by: re Notes: svn path=/head/; revision=195534
* There is an optimization in chmod(1), that makes it not to call chmod(2)Edward Tomasz Napierala2009-07-083-3/+27
| | | | | | | | | | | | | | | | if the new file mode is the same as it was before; however, this optimization must be disabled for filesystems that support NFSv4 ACLs. Chmod uses pathconf(2) to determine whether this is the case - however, pathconf(2) always follows symbolic links, while the 'chmod -h' doesn't. This change adds lpathconf(3) to make it possible to solve that problem in a clean way. Reviewed by: rwatson (earlier version) Approved by: re (kib) Notes: svn path=/head/; revision=195458
* In the current code, rdlock_count is not correctly handled for some cases.Attilio Rao2009-07-062-1/+4
| | | | | | | | | | | | | | | | | | The most notable is that it is not bumped in rwlock_rdlock_common() when the hard path (__thr_rwlock_rdlock()) returns successfully. This can lead to deadlocks in libthr when rwlocks recursion in read mode happens. Fix the interested parts by correctly handling rdlock_count. PR: threads/136345 Reported by: rink Tested by: rink Reviewed by: jeff Approved by: re (kib) MFC: 2 weeks Notes: svn path=/head/; revision=195403
* - Don't suggest opening file for writing in preparation for fexecve(2).Pawel Jakub Dawidek2009-07-051-6/+5
| | | | | | | | | - execve(2)/fexecve(2) won't return ETXTBSY if file is open for reading. Approved by: re (kib) Notes: svn path=/head/; revision=195380
* Make it clear where to look for for protocol-specific socket options.Edward Tomasz Napierala2009-06-301-0/+9
| | | | | | | | Reviewed by: rwatson Approved by: re (kib) Notes: svn path=/head/; revision=195211
* Make the structure definitions in the man pages match the real code, andKonstantin Belousov2009-06-293-25/+7
| | | | | | | | | remove no longer valid caution. Approved by: re (kensmith) Notes: svn path=/head/; revision=195172
* Back out previous revision until better tested fix is ready.Alexander Kabaev2009-06-293-2/+8
| | | | | | | Approved by: re (impliciti, by approving previos check-in) Notes: svn path=/head/; revision=195152
* Eliminate .text relocations in shared libraries compiled with stack protector.Alexander Kabaev2009-06-283-8/+2
| | | | | | | | | | | | | | | Use libssp_nonshared library to pull __stack_chk_fail_local symbol into each library that needs it instead of pulling it from libc. GCC generates local calls to this function which result in absolute relocations put into position-independent code segment, making dynamic loader do extra work everys time given shared library is being relocated and making affected text pages non-shareable. Reviewed by: kib Approved by: re (kensmith) Notes: svn path=/head/; revision=195151
* Implement %z for strptime.Xin LI2009-06-251-0/+28
| | | | | | | | | PR: kern/63064 Submitted by: Stefan `Sec` Zehl <sec 42 org> (with some small changes) MFC after: 1 month Notes: svn path=/head/; revision=195015
* Fix dynamic (re)allocation logic in jailparam_set and jailparam_get.Jamie Gritton2009-06-251-34/+72
| | | | | | | | | Touch up jailparam_import a bit while I'm at it. Approved by: bz (mentor) Notes: svn path=/head/; revision=195011
* Fix acl_set_fd(3) and acl_get_fd(3) for cases where the kernel doesn't knowEdward Tomasz Napierala2009-06-252-2/+3
| | | | | | | anything about _PC_ACL_NFS4. Notes: svn path=/head/; revision=195004
* Manual page tweaks.Edward Tomasz Napierala2009-06-251-2/+2
| | | | Notes: svn path=/head/; revision=194970
* Fix c194955 - somehow I managed all the new files, tripling theirEdward Tomasz Napierala2009-06-2517-4664/+0
| | | | | | | contents. Notes: svn path=/head/; revision=194957