Commit Graph

149580 Commits

Author SHA1 Message Date
John Baldwin
115753ce9e MFC 198174:
Close a race with caching of -ve name lookups in the NFS client.
Specifically, clients only trust -ve cache entries while the directory
remains unchanged and discard any -ve cache entries for a directory when
they notice that the modification time of a directory entry changes.  The
race involves two concurrent lookups as follows:
- Thread A does a lookup for file 'foo' which sends a lookup RPC to the
  server.  The lookup fails and the server replies.
- The 'foo' file is created (either by the same client or a different
  client) updating the modification time on the parent directory of 'foo'.
- Thread B does a lookup for a different file 'bar' which updates the
  cached attributes of the parent directory of 'foo' to reflect the new
  modification time after 'foo' was created.
- Thread A finally resumes execution to parse the reply from the NFS
  server.  It adds a -ve cache entry and sets the cached value of the
  directory's modification time that is used for invalidating -ve cached
  lookups to the new modification time set by thread B.

At this point, future lookups of 'foo' will honor the -ve cached entry
until the cached entry is pushed out of the name cache's LRU or the
modification time of the parent directory is changed again by some other
change.  The fix is to read the directory's modification time before
sending the lookup RPC and use that cached modification time when setting
the directory's cached modification time.  Also, we do not add a -ve cache
entry if another thread has added -ve cache entry that set the directory's
cached modification time to a newer value than the value we read before
sending the lookup RPC.

Approved by:	re (kib)
2009-10-23 19:52:29 +00:00
Philip Paeps
1ca0e46fdf MFC r198352
Make dhclient use bootpc (68) as the source port for unicast
  DHCPREQUEST packets instead of allowing the protocol stack to pick
  a random source port.

  This fixes the behaviour where dhclient would never transition
  from RENEWING to BOUND without going through REBINDING in networks
  which are paranoid about DHCP spoofing, such as most mainstream
  cable-broadband ISP networks.

Obtained from:	OpenBSD
Reviewed by:	brooks
Approved by:	re (kib)
2009-10-23 14:43:17 +00:00
Andrew Thompson
de411f4cd2 MFC r198376
Prevent wraparound of the timeout variable.

Submitted by:	HPS
Approved by:	re (kib)
2009-10-23 12:02:01 +00:00
Qing Li
dbd4bfe317 MFC 198306
The flow-table function flowtable_route_flush() may be called
during system initialization time. Since the flow-table is
designed to maintain per CPU flow cache, the existing code
did not check whether "smp_started" is true before calling
sched_bind() and sched_unbind(), which triggers a page fault.

Reviewed by:	jeff
Approved by:	re
2009-10-22 18:48:25 +00:00
Edward Tomasz Napierala
1c7deea437 MFC r196863:
Improve wording.

MFC r196941:

Prevent the line from wrapping.

Approved by:	re (kib)
2009-10-22 16:26:38 +00:00
Christian Brueffer
8c1851f5a1 MFC: r198232
Powercrypt and NetSec seem to be defunct (webpages point to link farms
and a google search yields no alternative).  Remove the links but
keep the entries around for reference.

Approved by:	re (kib)
2009-10-22 08:34:20 +00:00
Andrew Thompson
b1c3c31d58 MFC r198307
Change from CAM_TID_INVALID to CAM_SEL_TIMEOUT error code when the usb device
 has been yanked, this works around a cam recounting bug when
 CAM_DEV_UNCONFIGURED is set late in the detach. In certain conditions the
 reference to the XPT device would not be released which would cause the usb
 explore thread to sleep forever on "simfree", preventing any new usb devices to
 be found/ejected on the bus.

Approved by:	re (kib)
2009-10-21 19:48:27 +00:00
Ken Smith
3604d6e3d3 MFC r198287:
Update package list for 8.0-REL.

Reviewed by:	re@, portmgr@
Approved by:	re (implicit)
2009-10-21 17:18:48 +00:00
Konstantin Belousov
46aaa1ed67 MFC r198201:
Remove spurious call to priv_check(PRIV_VM_SWAP_NOQUOTA).
Call priv_check(PRIV_VM_SWAP_NORLIMIT) only when per-uid limit is
actually exceed.

Approved by:	re (kensmith)
2009-10-21 15:07:34 +00:00
Robert Watson
cbdd92bda4 Merge r198233 from head to stable/8:
Clean up comments, white space, and style in pfil.c (VNET changes not
  MFC'd)

Approved by:	re (kib)
2009-10-21 14:05:51 +00:00
Robert Watson
5e2ef9933c Merge r198198 from head to stable/8:
Line-wrap pfil.c so that it prints more nicely.

Approved by:	re (kensmith)
2009-10-21 13:11:38 +00:00
Robert Watson
304762b138 Merge r198219 from head to stable/8:
Remove unused pfil_flags field in packet_filter_hook.

Approved by:	re (kib)
2009-10-21 09:53:55 +00:00
Stanislav Sedov
e0b75e6195 - Note that ASF is now disabled by default in 8.0.
Approved by:	re (kib)
2009-10-20 22:11:17 +00:00
Qing Li
0eb4d28bac MFC 198301
In the ARP callout timer expiration function, the current time_second
is compared against the entry expiration time value (that was set based
on time_second) to check if the current time is larger than the set
expiration time. Due to the +/- timer granularity value, the comparison
returns false, causing the alternative code to be executed. The
alternative code path freed the memory without removing that entry
from the table list, causing a use-after-free bug.

Reviewed by:	discussed with kmacy
Approved by:	re
Verified by:	rnoland, yongari
2009-10-20 21:36:56 +00:00
Alexander Kabaev
8ed4544ca7 MFC Revision 197277:
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)
2009-10-20 19:05:43 +00:00
Robert Watson
752b1b6971 Merge r198218 from head to stable/8:
Sort function prototypes in pfil.h, clean up white space, and better
  align fields for printing.

Approved by:	re (kensmith)
2009-10-20 18:54:51 +00:00
Weongyo Jeong
6fb7173c2b MFC r198098:
fixes a TX hang bug that it could happen when if_start callback didn't
  be restarted by full of the output queue.

  Tested by:      bsduser <bsd at acd.homelinux.org>

MFC r198099:
  fixes a TX hang that could be possible to happen when the trasfers are
  in the high speed that some drivers don't call if_start callback after
  marking ~IFF_DRV_OACTIVE.

Approved by:	re (kib)
2009-10-20 17:50:36 +00:00
Qing Li
6f99a646e4 MFC r198111
This patch fixes the following issues in the ARP operation:

1. There is a regression issue in the ARP code. The incomplete
   ARP entry was timing out too quickly (1 second timeout), as
   such, a new entry is created each time arpresolve() is called.
   Therefore the maximum attempts made is always 1. Consequently
   the error code returned to the application is always 0.
2. Set the expiration of each incomplete entry to a 20-second
   lifetime.
3. Return "incomplete" entries to the application.
4. The return error code was incorrect.

Reviewed by:	kmacy
Approved by:	re
2009-10-20 17:44:50 +00:00
Stanislav Sedov
ea95296ce8 - Disable ASF by default in STABLE_8. This causes a lot
of problems on non-DELL branded machines with IPMI
  support.  The proposed fix was committed to HEAD but has
  not received much test coverage yet.

Discussed with:	bz
Approved by:	re (kensmith)
2009-10-20 16:41:23 +00:00
Robert Watson
92b52ada7c Merge r198196 from head to stable/8:
Rewrap ip_input() comment so that it prints more nicely.

Approved by:	re (kib)
2009-10-20 16:22:31 +00:00
Konstantin Belousov
dc68cec603 MFC r197934:
Map PIE binaries at non-zero base address.

MFC r198202:
Honour non-zero mapbase for PIE binaries. Inform interpreter-less PIE
binary about its relocbase.

Approved by:	re (kensmith)
2009-10-20 13:34:41 +00:00
Konstantin Belousov
55f128de91 MFC r197933:
Define architectural load bases for PIE binaries.

MFC r198203 (by marius):
Change load base for sparc to match default gcc memory layout model.

Approved by:	re (kensmith)
2009-10-20 13:32:28 +00:00
Ken Smith
9930b1a6ac MFC r197313:
Build a separate livefs CD for sparc64.

Approved by:	re (kib)
2009-10-20 13:32:18 +00:00
Konstantin Belousov
5b15472fe9 MFC r197932:
Do not map elf segments of zero length.

Approved by:	re (kensmith)
2009-10-20 13:30:06 +00:00
Konstantin Belousov
b6124fac40 MFC r197931:
Apply relocations for PIE binary ELF data structures pointers in rtld.

Approved by:	re (kensmith)
2009-10-20 13:26:58 +00:00
Hajimu UMEMOTO
b40a504727 MFC r198189: Check error of dlfunc(3).
Approved by:	re (kib)
2009-10-20 11:52:39 +00:00
John Baldwin
74fb2c91c6 MFC 198126:
Fix a sign bug in the handling of nice priorities when computing the
interactive score for a thread.

Approved by:	re (kib)
2009-10-19 19:40:05 +00:00
John Baldwin
a9266569b7 MFC 198079:
Use zfs_read() instead of xfsread() to read /boot.config.  xfsread() fails
short read requests, so the result was that a /boot.config smaller than 512
bytes was ignored.  boot2 uses fsread() instead of xfsread() to read
/boot.config already, so this makes zfsboot more like boot2.

Approved by:	re (kib)
2009-10-19 18:31:39 +00:00
Christian Brueffer
a469682518 MFC: r198125
Use our standard section 4 SYNOPSIS.

Approved by:	re (hrs)
2009-10-19 08:43:11 +00:00
Robert Watson
4b94fa7835 Merge r198118 from head to stable/8:
Print routing statistics as unsigned short rather than unsigned int,
  otherwise sign extension leads to unlikely values when in the negative
  range of the signed short structure fields that hold the statistics.
  The type used to hold routing statistics is arguably also incorrect.

Approved by:	re (bz)
2009-10-18 15:58:57 +00:00
Rui Paulo
596646aee5 MFC 197975, 197977, 197980, 198027:
Update for latest 802.11s changes in meshconf format.

Approved by:	re (kib)
2009-10-17 13:42:23 +00:00
Alexander Nedotsukov
a7261a62d5 MFC r197995, 198020:
Link GSS mechanics modules against libgssapi so they will not fail due
unresolved symbol errors when in turn libgssapi was loaded with RTLD_LOCAL
flag set (which is the default).

Approved by:	re (kib)
2009-10-16 09:29:06 +00:00
Doug Barton
888d94cf9b MFC r197947:
In regards to the "Starting foo:" type messages at boot time, create
and employ a more generic solution, and use it in the individual rc.d
scripts that also have an $rc_quiet test:

1. Add check_startmsgs() to rc.subr.
2. In the rc.d scripts that use rc_quiet (and rc.subr) substitute
variations of [ -z "$rc_quiet" ] with check_startmsgs
3. In savecore add a trailing '.' to the end of the message to make it
more consistent with other scripts.
4. In newsyslog remove a : before the terminal '.' since we do not
expect there to be anything printed out in between to make it more
consistent.
5. In the following scripts change "quotes" to 'quotes' where no
variables exist in the message: savecore pf newsyslog
6. [Does not apply in RELENG_8]
7. In the following scripts separate the "Starting foo:" from the
terminal '.' to make them more consistent: moused hostname pf
8. In nfsclient move the message to its own line to avoid a style bug
9. In pf rc_quiet does not apply to the _stop method, so remove the
test there.
10. In motd add 'quotes' around the terminal '.' for consistency

Approved by:	re (kib)
2009-10-16 00:17:09 +00:00
Rick Macklem
7a8a559822 MFC r197298:
Change the default transport protocol for use by the Mount protocol
and the NFS Null RPC done by mount_nfs from UDP to TCP, so that it is
consistent with the kernel, which already uses NFS over TCP by
default. Without this change, doing an NFS mount
against a server that only supports UDP results in an unusable
mount point if a transport protocol option wasn't specified for the
mount.

Approved by:	re (kib)
2009-10-15 19:50:00 +00:00
Robert Watson
0dcda942fd Add a MODULE_DEPEND() on the NFS client from dtnfsclient so that dtnfsclient
can access NFS client symbols.

Discussed with:	kib
Reported by:	markm
Approved by:	re (kib)
2009-10-15 14:39:59 +00:00
Michael Tuexen
bef10df88e MFC r197868.
Use correct arguments when calling SCTP_RTALLOC().
Approved by: re, rrs (mentor)
2009-10-14 17:26:05 +00:00
Ermal Luçi
d8e86c4a5d Fix typo which has survived amazingly long!
Reviewed by:	mlaier(mentor)
Approved by:	re(kib)
2009-10-14 15:32:46 +00:00
Konstantin Belousov
f7bca35675 MFC r197958:
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)
2009-10-14 14:26:19 +00:00
Doug Barton
505c00fa5b MFC r196439:
Fix the typo mentioned in the PR, and one additional.
Fix caps while I'm here.

PR:		conf/138087
Submitted by:	Chris Petrik <c.petrik.sosa@gmail.com>
Approved by:	re (kib)
2009-10-14 03:31:37 +00:00
Attilio Rao
be0ac16015 MFC r197476:
In function do_rw_wrlock, when a writer got an error and before returning,
check if there are readers blocked by us via URWLOCK_WRITE_WAITERS flag,
and resume the readers. The error must be EAGAIN, otherwise there must
have memory problem, and nobody can rescue the buggy application.

Approved by:	re (kib), davidxu
2009-10-13 13:03:31 +00:00
Konstantin Belousov
aba70b5e59 MFC r197942:
Refine r195509, instead of checking that vnode type is VBAD, that is
set quite late in the revocation path, properly verify that vnode is
not doomed before calling VOP.

Approved by:	re (bz)
2009-10-13 09:24:51 +00:00
Hiroki Sato
b509d7d489 MFC r197142:
Document accept_rev_ethip_ver and send_rev_ethip_ver flags of
EtherIP (gif(4) + if_bridge(4)).

Approved by:	re (kib)
2009-10-12 21:08:38 +00:00
Pawel Jakub Dawidek
69882ff11d MFC r197898:
If provider is open for writing when we taste it, skip it for classes that
depend on on-disk metadata. This was we won't attach to providers that are used
by other classes. For example we don't want to configure partitions on da0 if
it is part of gmirror, what we really want is partitions on mirror/foo.

During regular work it works like this: if provider is open for writing a class
receives the spoiled event from GEOM and detaches, once provider is closed the
taste event is send again and class can rediscover its metadata if it is still
there.  This doesn't work that way when new class arrives, because GEOM gives
all existing providers for it to taste, also those open for writing. Classes
have to decided on their own if they want to deal with such providers (eg.
geom_dev) or not (classes modified by this commit).

Reported by:	des, Oliver Lehmann <lehmann@ans-netz.de>
Tested by:	des, Oliver Lehmann <lehmann@ans-netz.de>
Discussed with:	phk, marcel
Reviewed by:	marcel
Approved by:	re (kib)
2009-10-12 21:08:06 +00:00
Pawel Jakub Dawidek
1d93d2aa4f MFC r197896:
Export disk serial numbers for adaX disks.

Reviewed by:	mav
Approved by:	re (kib)
2009-10-12 21:03:07 +00:00
Pawel Jakub Dawidek
d1c95b4a34 MFC r197831,r197842,r197843,r197860,r197861:
r197831:

Fix situation where Mac OS X NFS client creates a file and when it tries
to set ownership and mode in the same setattr operation, the mode was
overwritten by secpolicy_vnode_setattr().

PR:	kern/118320
Submitted by:	Mark Thompson <info-gentoo@mark.thompson.bz>

r197842:

Fix white-spaces.

r197843:

On FreeBSD it is enough to report provider removal when orphan event is
received, we don't have to do it on every ENXIO error in I/O path.
Solaris has no GEOM so they have to handle it in a less clean way.

r197860:

File system owner is when uid matches and jail matches.

r197861:

Allow file system owner to modify system flags if securelevel permits.

Approved by:	re (kib)
2009-10-12 20:36:55 +00:00
Attilio Rao
4dc32a7398 MFC r197803, r197824, r197910:
Per their definition, atomic instructions used in conjuction with
memory barriers should also ensure that the compiler doesn't reorder paths
where they are used.  GCC, however, does that aggressively, even in
presence of volatile operands.  The most reliable way GCC offers for avoid
instructions reordering is clobbering "memory".
Not all our memory barriers, right now, clobber memory for GCC-like
compilers.
Fix these cases.

Approved by:	re (kib)
2009-10-12 16:05:31 +00:00
Roman Divacky
dd8eeffea9 MFC r197812:
Fix tcsh losing history when tcsh terminates because the pty beneath it
is closed.

Diagnosed by Ted Anderson:

New signal queuing logic was introduced in 6.15 and allows the signal handlers
to be run explicitly by calling handle_pending_signals, instead of
immediately when the signal is delivered.  This function is called at
various places, typically when receiving a EINTR from a slow system call
such as read or write.  In the pty exit case, it was called from xwrite,
called from flush, while printing the "exit" message after receiving EOF
when reading from the pty (note that the read did not return EINTR but
zero bytes, indicating EOF).  The SIGHUP handler, phup(), called
rechist, which opened the history file and began writing the merged
history to it.  This process invoked flush recursively to actually write
the data.  In this case, however, the flush noticed it was being called
recursively and decided fail by calling stderror.

My conclusion was that the signal was being handled at a bad time.  But
whether to fix flush not to care about the recursive call, or to handle
the signal some other time and when to handle it, was unclear to me.
However, by adding an extra call to handle_pending_signals, just after
process() returns to main(), I was able to avoid the truncated history
after network outages and similar failures.  I verified this fix in
version 6.17.

Approved by:	re (kib)
2009-10-12 15:46:17 +00:00
Attilio Rao
3f4609ac69 MFC r197643, r197735:
When releasing a read/shared lock we need to use a write memory barrier
in order to avoid, on architectures which doesn't have strong ordered
writes, CPU instructions reordering.

Approved by:	re (kib)
2009-10-12 15:32:00 +00:00
Edward Tomasz Napierala
931d2a6f93 MFC r196700:
Manual page for mfiutil(8) is in section 8 now.

Approved by:	re (kib)
2009-10-11 18:14:18 +00:00
Simon L. B. Nielsen
31deab2050 MFC r197835:
- Document that 'Dell PowerEdge R710' has bce(4) supported NIC.
- Bump document date.

Approved by:	re (kib)
2009-10-11 16:52:24 +00:00