Commit Graph

170753 Commits

Author SHA1 Message Date
Konstantin Belousov
41014d996a vn_io_fault() is a facility to prevent page faults while filesystems
perform copyin/copyout of the file data into the usermode
buffer. Typical filesystem hold vnode lock and some buffer locks over
the VOP_READ() and VOP_WRITE() operations, and since page fault
handler may need to recurse into VFS to get the page content, a
deadlock is possible.

The facility works by disabling page faults handling for the current
thread and attempting to execute i/o while allowing uiomove() to
access the usermode mapping of the i/o buffer. If all buffer pages are
resident, uiomove() is successfull and request is finished. If EFAULT
is returned from uiomove(), the pages backing i/o buffer are faulted
in and held, and the copyin/out is performed using uiomove_fromphys()
over the held pages for the second attempt of VOP call.

Since pages are hold in chunks to prevent large i/o requests from
starving free pages pool, and since vnode lock is only taken for
i/o over the current chunk, the vnode lock no longer protect atomicity
of the whole i/o request. Use newly added rangelocks to provide the
required atomicity of i/o regardind other i/o and truncations.

Filesystems need to explicitely opt-in into the scheme, by setting the
MNTK_NO_IOPF struct mount flag, and optionally by using
vn_io_fault_uiomove(9) helper which takes care of calling uiomove() or
converting uio into request for uiomove_fromphys().

Reviewed by:	bf (comments), mdf, pjd (previous version)
Tested by:	pho
Tested by:	flo, Gustau P?rez <gperez entel upc edu> (previous version)
MFC after:	2 months
2012-05-30 16:42:08 +00:00
Konstantin Belousov
8f0e91308a Add a rangelock implementation, intended to be used to range-locking
the i/o regions of the vnode data space. The implementation is quite
simple-minded, it uses the list of the lock requests, ordered by
arrival time. Each request may be for read or for write. The
implementation is fair FIFO.

MFC after:     2 month
2012-05-30 16:06:38 +00:00
Konstantin Belousov
6eec26f5ad Capitalize start of sentence.
MFC after:	3 days
2012-05-30 14:00:23 +00:00
Konstantin Belousov
c83f909ce7 Clarify that the v_lockf is advisory lock list.
MFC after:	3 days
2012-05-30 13:58:01 +00:00
Ulrich Spörlein
de21233f45 Unbreak make depend. 2012-05-30 13:55:43 +00:00
Gleb Smirnoff
eaf151c49d Improve style(9) of bcopy() to and from mbuf tag.
Submitted by:	bde
2012-05-30 13:51:00 +00:00
Konstantin Belousov
6c5d7af158 Assert that TDP_NOFAULTING and TDP_NOSPEEPING thread flags do not leak
when thread returns from a syscall to usermode.

Tested by:	pho
MFC after:	1 week
2012-05-30 13:44:42 +00:00
Grzegorz Bernacki
0cdf461105 Print userspace backtrace for current thread.
Reviewed by:	imp
Obtained from:	Semihalf
2012-05-30 13:33:27 +00:00
Grzegorz Bernacki
6a07a86043 Flush D and I caches after setting a breakpoint.
Reviewed by: imp
Obtained from: Semihalf
2012-05-30 13:31:08 +00:00
Bjoern A. Zeeb
071183ef48 Update the previous openssl fix. [12:01]
Fix a bug in crypt(3) ignoring characters of a passphrase. [12:02]

Security:	FreeBSD-SA-12:01.openssl (revised)
Security:	FreeBSD-SA-12:02.crypt
Approved by:	so (bz, simon)
2012-05-30 12:01:28 +00:00
Gleb Smirnoff
a856ddc665 After r228571 carp_output() expects carp_softc * pointer in the mtag.
Noticed by:	thompsa
2012-05-30 07:11:27 +00:00
Benjamin Kaduk
e98adf398d Catch up to the carp rewrite and refer to vhids instead of interfaces.
Pointy hat to:	bjk
Submitted by:	glebius
Approved by:	hrs (mentor)
2012-05-30 05:42:40 +00:00
Alan Cox
a2efa4249e Eliminate some purely stylistic differences among the amd64, i386 native,
and i386 xen PV entry allocators.
2012-05-30 04:16:54 +00:00
Eitan Adler
a521695cf4 Document daily_status_security_chkportsum_enable
PR:		docs/167980
Submitted by:	"Bryan Drewery" <bryan@shatow.net>
Reported by:	rank1seeker@gmail.com
Approved by:	cperciva
MFC after:	2 weeks
2012-05-30 04:14:38 +00:00
Eitan Adler
31fd5c1101 Relax security permissions on '.seq' file creation - the strict,
but odd permissions resulted in a security alert from 110.neggrpperm

PR:		kern/165533
Submitted by:	Anton Shterenlikht <mexas@bristol.ac.uk>
Submitted by:	J B <jb.1234abcd@gmail.com>
Approved by:	cperciva
MFC after:	1 week
2012-05-30 04:08:29 +00:00
Eitan Adler
e5d9109aab Only set _w to 0 when the file stream is not currently reading. Without
this fflush may fail to write data in the buffer.

PR:		kern/137819
Submitted by:	Eric Blake <ebb9@byu.net>
Reviewed by:	theraven
Approved by:	cperciva
MFC after:	2 weeks
2012-05-30 04:06:38 +00:00
Eitan Adler
af57f4cf56 add missing variable declaration when DEBUG is defined forgotten in
r215046

PR:		bin/166404
Submitted by:	"Conrad J. Sabatier" <conrads@cox.net>
Approved by:	cperciva
MFC after:	3 days
2012-05-30 03:57:49 +00:00
Eitan Adler
35f8ab70be Fix likely race condition if wait_child() is interrupted by sigchild()
PR:		bin/102834
Submitted by:	Andreas Longwitz <longwitz@incore.de>
Approved by:	cperciva
MFC after:	2 weeks
2012-05-30 03:55:44 +00:00
Eitan Adler
5e4cc10b6d Add missing flag enable when certain arguments are parsed
PR:		bin/163053
Submitted by:	Peter <pmc@citylink.dinoex.sub.org>
Approved by:	cperciva
MFC after:	1 week
2012-05-30 03:54:10 +00:00
Eitan Adler
d81a84a9bc Don't attempt to delete .sujournal in /tmp
PR:		conf/163828
Submitted by:	Tatsuki Makino <tatsuki_makino@hotmail.com>
Approved by:	cperciva
MFC after:	1 week
2012-05-30 03:51:46 +00:00
Eitan Adler
30563ab45e Add support for newer garmin devices
PR:		kern/163932
Submitted by:	Bartosz Fabianowski <freebsd@chillt.de>
Approved by:	cperciva
MFC after:	1 week
2012-05-30 03:50:58 +00:00
Eitan Adler
d9b73ea9cf Add support for Sun 1040 PCI Quad Serial
PR:		kern/163450
Submitted by:	Anonymous Hardware Hacker <silicium@harmony-p.ath.cx>
Approved by:	cperciva
MFC after:	1 week
2012-05-30 03:47:51 +00:00
Martin Wilke
57eef2a0b2 - FreeBSD ships a KDE PAM module in base, but it's missing support for passwordless login (kde-np),
and it doesn't really belong in base system.

PR:		misc/167261
Submitted by:	avilla@
Approved by:	rwatson (mentor)
MFC after:	3 days
2012-05-30 03:10:22 +00:00
Glen Barber
ee4e9133d4 Regen src.conf.5 after r236279.
MFC after:	3 days
2012-05-30 02:41:09 +00:00
Glen Barber
691b39b51e Add '-width Pa' to src.conf.5 for mdoc(7) style consistency.
MFC after:	3 days
2012-05-30 02:37:20 +00:00
Glen Barber
a82b501b27 Fix mdoc(7) style nits.
MFC after:	3 days
2012-05-30 02:29:47 +00:00
Kevin Lo
69e5d6b823 Hook up wbwd man page to the build. 2012-05-30 02:02:37 +00:00
Glen Barber
82f39c10fe Fix an mdoc(7) formatting nit.
MFC after:	3 days
2012-05-30 01:52:01 +00:00
Jung-uk Kim
9b7d4a7f2d Fix style(9) nits, reduce unnecessary type castings, etc., for bpf_setf(). 2012-05-29 22:28:46 +00:00
Jung-uk Kim
8b04b48a7d - Save the previous filter right before we set new one.
- Reduce duplicate code and make it little easier to read.

MFC after:	2 weeks
2012-05-29 22:21:53 +00:00
Dimitry Andric
96ccbf68a6 Pull in r156591 from upstream llvm trunk:
Allow unique_file to take a mode for file permissions, but default
  to user only read/write.

and r156592 from upstream clang trunk:

  For final output files create them with mode 0664 to match other
  compilers and expected defaults.

This should fix clang creating files with mode 0600.

Reported by:	James <james@hicag.org>
MFC after:	3 days
2012-05-29 21:59:09 +00:00
Dimitry Andric
baa749209e For clang, similar to r236137, enable gnu hash generation for dynamic
ELF binaries on x86.
2012-05-29 20:21:24 +00:00
Olivier Duchateau
54171f992c Add myself and my relation to my mentors.
Approved by:	miwi@, rene@
2012-05-29 20:16:26 +00:00
Luigi Rizzo
4e7dc6ecbb add support to build netmap as a module,
but for the time being keep it disconnected from the main build.

MFC after:	3 days
2012-05-29 19:55:07 +00:00
David E. O'Brien
585ed8cb79 Add the latest FreeBSD versions. 2012-05-29 19:49:52 +00:00
Jung-uk Kim
6f731135ac Fix 32-bit shim for BIOCSETF to drop all packets buffered on the descriptor
and reset statistics as it should.

MFC after:	3 days
2012-05-29 18:44:53 +00:00
Pawel Jakub Dawidek
97e9ad8ec4 Tighten up the assertion: because size can't be 0 and even if sm_space is equal
to sm_size, any 'sm_space - size' will be less than sm_size.

MFC after:	3 days
2012-05-29 18:11:45 +00:00
Pawel Jakub Dawidek
837a617728 Eliminate 'where' argument, we don't use it.
MFC after:	3 days
2012-05-29 18:09:14 +00:00
Pawel Jakub Dawidek
8ac2669cc8 Remove unused variable.
MFC after:	3 days
2012-05-29 18:05:24 +00:00
Pawel Jakub Dawidek
e21c77d804 Remove unused sysctl.
MFC after:	3 days
2012-05-29 17:53:11 +00:00
Robert Noland
cf864f03b6 Add device ids for the Winbond 83627DHG-P chip and set the registers to
trigger the keyboard reset line on timeout.

Reviewed by:	bz
MFC after:	1 week
2012-05-29 16:39:42 +00:00
Robert Noland
63fb0bb621 Fix a typo in wbwd so that CRF5 is actually written to the data register
rather than the index register.

Reviewed by:	bz
MFC after:	3 days
2012-05-29 16:25:01 +00:00
Alan Cox
0490d34982 MFi386 pmap r233433
Disable detailed PV entry accounting by default.  (A config option for
  enabling it was already introduced in r233433.)
2012-05-29 16:11:15 +00:00
Hans Petter Selasky
58a9da85fe Add quirk for Marvell based AHCI controller.
MFC after:	3 days
Suggested by:	mav @
2012-05-29 15:56:30 +00:00
Alan Cox
6516bffdef Rename pmap_collect() to pmap_pv_reclaim() and rewrite it such that it no
longer uses the active and inactive paging queues.  Instead, the pmap now
maintains an LRU-ordered list of pv entry pages, and pmap_pv_reclaim() uses
this list to select pv entries for reclamation.

Note: The old pmap_collect() tried to avoid reclaiming mappings for pages
that have either a hold_count or a busy field that is non-zero.  However,
this isn't necessary for correctness, and the locking in pmap_collect() was
insufficient to guarantee that such mappings weren't reclaimed.  The new
pmap_pv_reclaim() doesn't even try.

Tested by:	sbruno
MFC after:	5 weeks
2012-05-29 15:41:20 +00:00
Edward Tomasz Napierala
18183ca93f Fix lock interaction table for rmlocks - by default they cannot sleep,
just like rwlocks.

MFC after:	1 week
2012-05-29 14:41:16 +00:00
Alexander Motin
7dc3213da1 Allow to change number of openings (used tags) for ATA/SATA devices
via `camcontrol tags ... -N ...`.  There is no need to tune it in
usual cases, but some users want to have it for debugging purposes.

MFC after:	2 weeks
2012-05-29 14:28:46 +00:00
Alexander V. Chernikov
a86227d176 Fix BPF_JITTER code broken by r235746.
Pointed by:       jkim
Reviewed by:      jkim (except locking changes)
Approved by:      (mentor)
MFC after:        2 weeks
2012-05-29 12:52:30 +00:00
Alexander Motin
2e3f592b09 Plug request and references leak caused by race between invalidated
ond probe periph destruction and new incoming probe request.

This at least caused problems with SATA Port Multipliers hot-plug.

MFC after:	2 weeks
2012-05-29 11:22:40 +00:00
Dag-Erling Smørgrav
5fca4d10aa Pass a filename, rather than a file descriptor, to libarchive.
Submitted by:	Alex Kozlov <spam@rm-rf.kiev.ua>
MFC after:	1 week
2012-05-29 09:11:19 +00:00