151687 Commits

Author SHA1 Message Date
Pyun YongHyeon
0ab95a1532 MFC r208862:
Fix a bug introduced in r199011. When bge(4) reuses loaded RX
  buffers it should also reinitialize RX descriptors otherwise some
  stale data could be passed to controller. This could end up with
  mbuf double free or unexpected NULL pointer dereference in upper
  stack. To fix the issue, save loaded buffer's length and
  reinitialize RX descriptors with the saved value whenever bge(4)
  reuses the loaded RX buffers.
  While I'm here, increase the number of RX buffers to 512 from 256.
  This simplifies RX buffer handling as well as giving more RX
  buffers. Controller supports just fixed number of RX buffers
  (i.e. 512) and bge(4) used to rely on hope that our CPU is fast
  enough to keep up with the controller. With this change, bge(4)
  will use 1MB for RX buffers but I don't think it would cause
  problems in these days.

  Reported by:	marcel
  Tested by:	marcel
  Approved by:	re (bz)
2010-06-10 17:53:35 +00:00
Attilio Rao
b0a893e01f MFC r208771:
Improve wording and fix style.

Sponsored by:	Sandvine Incorporated

Approved by:	re (bz)
2010-06-09 14:54:05 +00:00
Ulrich Spörlein
fa7848b6c1 MFC r208753:
Add required header for isalnum(3) to quench compiler warnings

Forgotten in:   r174678
Submitted by:   Alexander Best alexbestms at wwu.de
Approved by:    das
Approved by:	re (kib)
2010-06-09 14:31:11 +00:00
Ulrich Spörlein
40d1c65d17 MFC r208074:
fsirand(8): make WARNS=3 clean

- Drop bogus quad_t cast for di_gen, it is a 32bit type
- Print di_gen with leading zeros, to get consistent output

Approved by:	re (kib)
2010-06-09 14:30:21 +00:00
Andriy Gapon
d52023c1d3 MFC r208671: udf_readlink: fix malloc call with uninitialized size
parameter

Found by:	clang static analyzer
Approved by:	re(kib)
2010-06-09 10:13:59 +00:00
Andriy Gapon
2549d17a08 MFC r208800: scsi_cd: pass correct pointer to free()
Found with:	Coverity Prevent(tm)
CID:		2986
Approved by:	re(kib)
2010-06-09 09:44:05 +00:00
Brian Somers
f0bcca7940 MFC r197477 - clean up keys deleted via pthread_key_delete()
PR:		135462
Approved by:	re (kib)
Nod timeout:	davidxu
2010-06-09 07:31:41 +00:00
Pyun YongHyeon
c4d83ac0a9 MFC r208806:
Don't blindly set IFF_DRV_OACTIVE when sge_encap() fails. If there
  is no queued frame, IFF_DRV_OACTIVE would never be cleared.

  Submitted by:	Nikolay Denev < ndenev <> gmail at com >
  Approved by:	re (bz)
2010-06-08 19:26:22 +00:00
Nathan Whitehorn
4b865d9ac3 MFC r208168:
It is not necessary (and in some cases harmful) to hardcode ata_kauai's
IRQ to 39 on K2 devices, as well as Shasta ones.

Reported by:	Andreas Tobler
Approved by:	re (kib)
2010-06-08 17:26:18 +00:00
Alexander Motin
2d0033c8c8 MFC r208796:
Fix PCH chipset IDs. They are 0x3bxx, not 0x3axx.

Approved by:	re (kib)
2010-06-08 10:52:37 +00:00
Alan Cox
acb4c5ecbb MFC r208765
In the unlikely event that pmap_ts_referenced() demoted five superpage
  mappings to the same underlying physical page, the calling thread would
  be left forever pinned to the same processor.

Approved by:	re (kib)
2010-06-08 04:41:31 +00:00
Andrey V. Elsukov
00e4466ce9 MFC r197608:
The first 96 bytes may not be zeroes. It can contain trivial boot
code that merely emits an error and waits for a key press before
rebooting. The error being that extended partitions are not
bootable. The origin is presumed to be Windows 2000; Windows XP
does not do this...

For now, ignore the first 96 bytes when checking that the EBR is
(for the most part) all zeroes.

Tested by:	Mario Lobo <mlobo at digiart.art.br>
		Dieter <dieterbsd at engineer.com>
PR:		kern/141235
Reviewed by:	marcel
Approved by:	kib (mentor)
Approved by:	re (bz)
2010-06-07 20:31:55 +00:00
Matt Jacob
40a7bbabd9 MFC of 198262
Use callout_init_mtx on FreeBSD versions recent enough. This closes
the race where interrupt thread can complete the request for which
timeout has fired and while mpt_timeout has blocked on mpt_lock.

Approved by:	re (kib)
2010-06-07 16:32:12 +00:00
Andriy Gapon
639a73c428 MFC r208610: boot/zfs: fix gang block reading code
- use correct size (512) while reading a gang block
- skip holes while reading child blocks
- advance buffer pointer while reading child blocks

PR:		144214
Approved by:	re(kib)
2010-06-07 13:37:13 +00:00
Andrey V. Elsukov
e79044fd18 MFC r207181:
Re-calculate a geometry when reprobing as well.

PR:		kern/145452
Reviewed by:	marcel
Approved by:	kib (mentor)
Approved by:	re (bz)
2010-06-07 10:22:22 +00:00
Martin Matuska
c21c27aa90 MFC r208775:
Fix freeing space after deleting large files with holes.

OpenSolaris onnv revision:	9950:78fc41aa9bc5

Reviewed by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6792701)
Approved by:	re (kib)
2010-06-06 13:08:36 +00:00
Rui Paulo
8b7b5858a1 MFC r208696:
Don't reference null pointer in hwmp_recv_preq().

 Found with:	Coverity Prevent(tm)
 CID:		3912
Approved by:	re (bz)
2010-06-05 20:51:56 +00:00
Gavin Atkinson
4fcca83f71 Fix typo (COMPAT_FREEBDS32 -> COMPAT_FREEBSD32)
Direct commit to stable/8 as this text isn't in head.

PR:		docs/147497
Submitted by:	Jack Low <xxjack12xx gmail.com>
Approved by:	re (kib)
2010-06-05 18:30:42 +00:00
Konstantin Belousov
e753752c1d MFC r208731:
Add a facility to dynamically adjust or unconfigure p1003_1b mib.
Use it to allow to tune sem_nsem_max at runtime, only when sem.ko
module is present in kernel.

Approved by:    re (bz)
2010-06-05 14:53:34 +00:00
Konstantin Belousov
f0f2f0a9e0 MFC r208374:
Remove POLLHUP from the flags used to test for to set exceptfsd
fd_set bits in select(2). It seems that historical behaviour is to not
reporting exception on EOF, and several applications are broken.

Approved by:    re (kensmith)
2010-06-04 14:06:59 +00:00
Martin Matuska
0985c67ea7 MFC r208689:
Fix ZIL close when doing zfs rollback or zfs receive on a mounted dataset.

The fix is a partial import and merge of OpenSolaris onnv revisions
8227:f7d7be9b1f56. and 9292:e112194b5b73

Reviewed by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6798298)
Approved by:	re (kib)
2010-06-04 08:46:26 +00:00
Robert Watson
ef9bfed8fb Merge r205010 from head to stable/8:
Update nfsrv_getsocksndseq() for changes in TCP internals since FreeBSD 6.x:

  - so_pcb is now guaranteed to be non-NULL and valid if a valid socket
    reference is held.

  - Need to check INP_TIMEWAIT and INP_DROPPED before assuming inp_ppcb is a
    tcpcb, as it might be a tcptw or NULL otherwise.

  - tp can never be NULL by the end of the function, so only check
    TCPS_ESTABLISHED before extracting tcpcb fields.

  The NFS server arguably incorporates too many assumptions about TCP
  internals, but fixing that is left for another day.

  Reviewed by:		bz
  Reviewed and tested by:	rmacklem
  Sponsored by:		Juniper Networks

Approved by:	re (kib)
2010-06-03 09:15:52 +00:00
Robert Watson
e5dbe8eca0 Merge r204830 from head to stable/8
Locking the tcbinfo structure should not be necessary in tcp_timer_delack(),
  so don't.

  Reviewed by:    bz
  Sponsored by:   Juniper Networks

Approved by:	re (kib)
2010-06-03 09:06:50 +00:00
Robert Watson
4b33228640 Merge r204826 from head to stable/8:
Make udp_set_kernel_tunneling() less forgiving when its invariants are
  violated: so_pcb can never be NULL for a valid UDP socket, and it is
  always SOCK_DGRAM.  Use sotoinpcb() as the rest of the UDP code does.

  Reviewed by:	bz
  Sponsored by:	Juniper Networks

Approved by:	re (kib)
2010-06-03 09:02:53 +00:00
Robert Watson
c00cb785e5 Merge r204810 from head to stable/8:
Remove unnecessary locking of divcbinfo lock from div_output(): this has
  not been required since FreeBSD 7.0 when the so_pcb pointer leading to inp
  was guaranteed to be stable when a valid socket reference is held (as it
  is in the output path).

  Reviewed by:	bz
  Sponsored by:	Juniper Networks

Approved by:	re (kib)
2010-06-03 08:55:45 +00:00
Jung-uk Kim
32aa4ac70d MFC: r208650
Fix a regression from r203544 (MFC of r200554), which broke fdc(4)
attachment to acpi(4).

Approved by:	re (kib)
2010-06-02 21:00:18 +00:00
Edward Tomasz Napierala
4d01f7c33b MFC r208437:
Make acl_get_perm_np(3) work with NFSv4 ACLs.

Reviewed by:	kientzle@
Approved by:	re (kib)
2010-06-02 20:35:56 +00:00
Gleb Smirnoff
295c646baf Merge 208554 from head:
Add uep(4), driver for USB onscreen touch panel from eGalax.

  The driver is stub. It just creates device entry and feeds
  reassembled packets from hardware into it.

  If in future we would port wsmouse(4) from NetBSD, or make
  sysmouse(4) to support absolute motion events, then the driver
  can be extended to act as system mouse. Meanwhile, it just
  presents a /dev/uep0, that can be utilized by X driver, that
  I am going to commit to ports tree soon.

  The name for the driver is chosen to be the same as in NetBSD,
  however, due to different USB stacks this driver isn't a port.

The driver is supported by ports/x11-drivers/xf86-input-egalax.

Approved by:	re (kib)
2010-06-02 18:46:12 +00:00
Dag-Erling Smørgrav
d2997dabd4 Missing commas in Dd
Approved by:	re (kib@)
2010-06-02 10:28:26 +00:00
Dag-Erling Smørgrav
a97329ecda Fix expansion of AuthorizedKeysFile (upstream patch)
PR:		146334, 145940
Approved by:	re (kib@)
2010-06-02 10:26:31 +00:00
Attilio Rao
875e0aa40d MFC r207329, r208716:
- Extract the IODEV_PIO interface from ia64 and make it MI.
- On i386 and amd64 the old behaviour is kept but multithreaded
  processes must use the new interface in order to work well.
- Support for the other architectures is greatly improved.

Sponsored by:	Sandvine Incorporated

Approved by:	re (kib, bz)
2010-06-01 21:19:58 +00:00
John Baldwin
af89e29624 MFC 208555:
Ignore the 'addr' argument passed to PT_STEP (it is required to be '1'
for PT_STEP which means "ignore") and PT_DETACH.

Approved by:	re (kib)
2010-06-01 19:38:46 +00:00
Robert Watson
2300da982a Merge r206210 from head to stable/7:
Synchronize Coda kernel module definitions in our coda.h to Coda 6's
  coda.h:

  - CodaFid typdef -> struct CodaFid throughout.
  - Use unsigned int instead of unsigned long for venus_dirent and other
    cosmetic fixes.
  - Introduce cuid_t and cgid_t and use instead of uid_t and gid_t in RPCs.
  - Synchronize comments and macros.
  - Use u_int32_t instead of unsigned long for coda_out_hdr.

  With these changes, a 64-bit Coda kernel module now works with
  coda6_client, whereas previous userspace and kernel versions of RPCs
  differed sufficiently to prevent using the file system.  This has been
  verified only with casual testing, but /coda is now usable for at least
  basic operations on amd64.

Approved by:	re (kensmith)
2010-06-01 14:29:26 +00:00
Robert Watson
6e2c1ff23b Merge r206972 from head to stable/8:
Merge @176820, @176822, @177156 to tcpp from P4 to HEAD:

   Improve accuracy of connection data transfer math.

   Disable Nagle's algorithm to avoid delaying transfers of data --
   will want to refine this to combine payload with header transfer,
   however.

   Now that we're running w/o Nagle, try to send the initial data
   burst with the header in a single TCP segment.

   Prefer %zu to %ju for size_t.

   Sponsored by:	Juniper, Inc.

Approved by:	re (bz)
2010-06-01 14:26:27 +00:00
Robert Watson
03b868be4c Merge r204809 from head to stable/8:
Add a comment to tcp_usr_accept() to indicate why it is we acquire the
  tcbinfo lock there: r175612, which re-added it, masked a race between
  sonewconn(2) and accept(2) that could allow an incompletely initialized
  address on a newly-created socket on a listen queue to be exposed.  Full
  details can be found in that commit message.

  Sponsored by:	Juniper Networks

Approved by:	re (bz)
2010-06-01 14:21:24 +00:00
Robert Watson
4fc9f6b81e Merge r204806 from head to stable/8:
Wrap use of rw_try_upgrade() on pcbinfo with macro INP_INFO_TRY_UPGRADE()
  to match other pcbinfo locking macros.

Approved by:	re (bz)
2010-06-01 14:18:44 +00:00
Robert Watson
93ed892eb9 Merge r204435 from head to stable/8:
Fix typo in comment.

Approved by:	re (bz)
2010-06-01 14:09:35 +00:00
Robert Watson
f462942090 Merge r204430 from head to stable/8:
Remove stale comment about socket buffer accounting from access(2) code.
  It is the case, however, that the uidinfo of the temporary credential
  set up for access(2) is not properly updated when its effective uid is
  changed.

Approved by:	re (bz)
2010-06-01 14:04:33 +00:00
Robert Watson
9b47fa5955 Merge r208601 from head to stable/8:
When close() is called on a connected socket pair, SO_ISCONNECTED might be
  set but be cleared before the call to sodisconnect().  In this case,
  ENOTCONN is returned: suppress this error rather than returning it to
  userspace so that close() doesn't report an error improperly.

  PR:		kern/144061
  Reported by:	Matt Reimer <mreimer at vpop.net>,
		Nikolay Denev <ndenev at gmail.com>,
		Mikolaj Golub <to.my.trociny at gmail.com>

Approved by:	re (kib)
2010-06-01 13:59:48 +00:00
Robert Watson
9770cc486f Merge r206206 from head to stable/8:
Correct definition of CIOC_KERNEL_VERSION Coda ioctl() for systems
  where sizeof(int) != sizeof(sizeof(int)), or the ioctl will return
  EINVAL.

Approved by:	re (kib)
2010-06-01 13:57:58 +00:00
Attilio Rao
bf28bb90d5 MFC r208300:
Fix a race between ngs_rcvmsg() and soclose() which closes the control
socket while it is still in use as ngs_rcvmsg() runs without any lock
held.

Sponsored by:	Sandvine Incorporated
Approved by:	re (bz)
2010-06-01 09:32:22 +00:00
Robert Watson
67b38bab13 Merge r204498 from head to stable/8:
Whitespace tweak.

Approved by:	re (kib)
2010-05-31 22:29:48 +00:00
Robert Watson
d5a42fa49c Merge r204581 from head to stable/8:
Update device-labeling logic for Biba, LOMAC, and MLS to recognize new-style
  pts devices when various policy ptys_equal flags are enabled.

  Submitted by:	Estella Mystagic <estella at mystagic.com>

Approved by:	re (kib)
2010-05-31 22:27:08 +00:00
Robert Watson
b6ec54747a Merge r204173 from head to stable/8:
ifconfig(8) expects interface fooX to be supported by the module if_foo,
  and will try to load it if it's not present.  To better meet these
  expectations, change the module name for the loopback interface from
  'loop' to 'if_lo'.  The loopback interface is always compiled into the
  base kernel, so there are no resulting changes in kld files, etc.

  Discussed with:       brooks (ages ago)

Approved by:    re (bz, kib)
2010-05-31 22:18:42 +00:00
Pyun YongHyeon
1cf8f2c431 MFC r208512:
sge_encap() can sometimes return an error with m_head set to NULL.
  Make sure not to requeue freed mbuf in sge_start_locked(). This
  should fix NULL pointer dereference panic.

  Reported by:	Nikolay Denev <ndenev <> gmail dot com>
  Submitted by:	jhb
  Approved by:	re (bz)
2010-05-31 22:03:56 +00:00
Robert Watson
1732ca8fb3 Merge r203410 from head to stable/8:
Only audit pathnames in namei(9) if copying the directory string completes
 successfully.  Continue to do this before the empty path check so that the
 ENOENT returned in that case gets an empty string token in the BSM record.

Approved by:	re (kib)
2010-05-31 21:57:31 +00:00
Robert Watson
b269c05e01 Merge r200976 from head to stable/8:
Minor comment tweaks in rmlocks.

Approved by:	re (kib)
2010-05-31 21:35:40 +00:00
Robert Watson
25d3931a9f Merge r200899 from head to stable/8:
When warning about possible netisr configuration problems during boot,
  report using "netisr_init" rather than "netisr2", which was the development
  name for the project.

Approved by:	re (kib)
2010-05-31 21:14:56 +00:00
Andriy Gapon
84ba62ee66 MFC r201374: g_part_gpt: Properly return the UUID represented by the alias
PR:		kern/142174
Approved by:	re (kib)
Approved by:	marcel
2010-05-31 20:17:37 +00:00
Colin Percival
e39a411806 MFC r208606: Remove $Mdocdate$ from man page imported from OpenBSD;
their mdoc supports it, but ours doesn't.

Approved by:	re (hrs)
2010-05-31 07:14:40 +00:00