202134 Commits

Author SHA1 Message Date
vangyzen
00f0196ec6 MFC r295012
kqueue EVFILT_PROC: avoid collision between NOTE_CHILD and NOTE_EXIT

NOTE_CHILD and NOTE_EXIT return something in kevent.data: the parent
pid (ppid) for NOTE_CHILD and the exit status for NOTE_EXIT.
Do not let the two events be combined, since one would overwrite
the other's data.

PR:		180385
Submitted by:	David A. Bright <david_a_bright@dell.com>
Sponsored by:	Dell Inc.
2016-04-14 17:14:11 +00:00
asomers
9b388bff95 MFC 297838
Fix an intermittent bug in sbin/devd/client_test.stream

In case where the two events were being received in separate reads, the
event buffer was being null-terminated at the wrong offset.

Also, factored out some common code between the tests, and fixed a comment.
2016-04-14 15:24:45 +00:00
gahr
7f331c8ab2 MFC 297678: Enhance uuencode with a -r option to produce raw output.
This matches with uudecode's -r option to decode raw data without initial and
final framing lines.

$ echo Test | uuencode -mr - | uudecode -mr
Test

Approved by:	cognet
2016-04-14 11:45:52 +00:00
mav
5a7f6237bc MFC r297672: Alike to r293708 relax pool check in vdev_geom_open_by_path().
This made impossible spare disk open by known path, which kind of worked
only because the same fix was applied to vdev_geom_attach_by_guids() in
r293708.
2016-04-14 09:10:09 +00:00
markj
7d48c1b04d MFC r297827:
libdtrace: Add a missing unlock to an error handler.
2016-04-14 04:54:47 +00:00
kevlo
a2a5fb1296 MFC r297479, r297695:
Update comment: Linux does set a randomized generation number of an inode
on ext2/3/4.  While here use arc4random() instead of random().

Reviewed by:	pfg
2016-04-14 01:24:00 +00:00
wblock
a977dbd919 MFC r297571:
Add another real-life example of setting a quirk for a USB gaming
keyboard.  From forum thread: https://forums.freebsd.org/threads/55717/
2016-04-13 20:12:02 +00:00
brooks
aedb89a595 MFC r297476:
Add a cross reference to ktrace(2).

Obtained from:	CheriBSD (9cb420d6b7f04c1b7d2006180b80932e5d3fe50e)
Sponsored by:	DARPA, AFRL
2016-04-13 16:47:14 +00:00
brooks
a96e6cea4d MFC r297475:
Document KTRFAC_FAULT and KTRFAC_FAULTEND.

Obtained from:	CheriBSD (9d70f563f1b033e6a9b51eaf3b145a8cbbc6617c)
Sponsored by:	DARPA, AFRL
2016-04-13 16:45:17 +00:00
bdrewery
4e6bbd6d77 MFC r297626:
Follow-up r295924: Only sync hash-based db files open for writing when
  closing.
2016-04-13 01:54:36 +00:00
mav
57d12b01ce MFC r297387: Add some device IDs found on AMD FCH shipsets. 2016-04-12 07:54:55 +00:00
mav
eb38e24ae4 MFC r297386: Add support for AMD FCH watchdog timers. 2016-04-12 07:54:03 +00:00
glebius
69db0b60a3 Merge r285713 (by zec@) from head:
Prevent null-pointer dereferencing.
2016-04-11 17:23:47 +00:00
emaste
c7d5202520 MFC r296685: libelf: correct byte count in cross-endian note translation
Sponsored by:	The FreeBSD Foundation
2016-04-11 14:45:36 +00:00
emaste
51b775d978 MFC r275430: libelf: Fix cross-endian ELF note file / memory conversion
The namesz and descsz variables need to be used in native endianness.
The sizes are in native order after swapping in the file to memory case,
and before swapping in the memory to file case.

This change is not identical to r275430 because r273443 was never merged
to stable/10, and libelf moved from lib/ to contrib/elftoolchain/.
2016-04-11 14:44:18 +00:00
emaste
48db6cc4af MFC r296769: boot/efi: Prefer nm to objdump
Both objdump and nm are equally capable of reporting undefined symbols.

  This gets us a step closer to building without binutils as we have an nm
  implementation from ELF Tool Chain.

Sponsored by:	The FreeBSD Foundation
2016-04-11 14:26:02 +00:00
kib
d1b3dae178 MFC r297535:
Remove unused variable.
2016-04-11 09:29:08 +00:00
gnn
e992763185 MFC 297358
Add ethertype reserved for network testing
2016-04-11 02:42:04 +00:00
ache
fb5000eaff MFC r297557:
SJIS encoding don't have single byte characters >= 224
2016-04-11 02:21:42 +00:00
mp
c433aab6ad MFC 297673:
Revert r296969 by removing SAVESIGVEC and switching to fork instead. This
fixes usage with system libraries which maintain their own signal state.

PR:	208132
2016-04-10 18:12:04 +00:00
kib
811669954b MFC r297311:
Ensure that TRIMs are finished before unmount destroys ufsmount.
2016-04-10 16:32:21 +00:00
kib
27423b3aa6 MFC r297308:
Style: wrap long lines.
2016-04-10 16:27:46 +00:00
jilles
2ee68855a4 MFC r278817: touch: Fix some subtle bugs related to NULL times fallback:
* Do not subvert vfs.timestamp_precision by reading the time and passing
  that to utimensat(). Instead, pass UTIME_NOW. A fallback to a NULL times
  pointer is no longer used.

* Do not ignore -a/-m if the user has write access but does not own the
  file. Leave timestamps unchanged using UTIME_OMIT and do not fall back to
  a NULL times pointer (which would set both timestamps) if that fails.
2016-04-10 15:24:07 +00:00
jilles
4c6d087886 MFC r277645: cp,mv,touch: Set timestamps with nanosecond precision.
This uses utimensat().
2016-04-10 15:02:29 +00:00
dchagin
e29b7097a2 MFCR r297519, r297525 (by pfg@):
Move Linux specific times tests up to guarantee the values are defined.
2016-04-10 06:36:58 +00:00
jilles
8699198909 MFC r259017: test: Avoid looking up again the type of a known binary
operator.
2016-04-09 21:55:58 +00:00
jilles
f631ef3d78 MFC r258799: test: Simplify the code by unifying op_num and op_type.
The global variable t_wp_op is no longer needed.
2016-04-09 21:49:57 +00:00
jilles
e010ff64d6 MFC r281086: utimensat: Correct Capsicum required capability rights. 2016-04-09 21:04:51 +00:00
jilles
f563d215af MFC r287753: setuid(2): Suggest O_CLOEXEC instead of fcntl(F_SETFD). 2016-04-09 19:29:39 +00:00
jilles
0b7191c4ed MFC r297360: sh: Fix use-after-free if a trap replaces itself.
The mergeinfo for this commit was accidentally added to the previous commit.
2016-04-09 14:24:17 +00:00
jilles
1a49b5f5b0 MFC r278818: sh: Add stsavestr(), like savestr() but allocates using
stalloc().
2016-04-09 14:09:14 +00:00
jilles
15cca94824 MFC r295385: semget(): Check for [EEXIST] error first.
Although POSIX literally permits failing with [EINVAL] if IPC_CREAT and
IPC_EXCL were both passed, the semaphore set already exists and has fewer
semaphores than nsems, this does not allow an application to retry safely:
if the [EINVAL] is actually because of the semmsl limit, an infinite loop
would result.

PR:		206927
2016-04-09 13:32:42 +00:00
asomers
336b1f7bb6 MFC r294924
syslogd: Enable repeated line compression for lines of any length.

Enable repeated line compression for lines of any length, instead of only short
lines. AFAICT repeated line compression was limited to short lines as a RAM
optimization, which made sense when karels added it in 1988, but no longer.
The penalty is a paltry 904B of RAM per file logged.
2016-04-08 21:42:35 +00:00
asomers
1e918163f5 MFC 270231
Misc fixes suggested by Coverity.

sbin/devd/tests/client_test.c
	* In the event that popen fails, don't dereference its return value.
	* Fix array overwrite in the stream and seqpacket tests.
	* Close sockets at the end of successful ATF tests.
2016-04-08 20:43:50 +00:00
jilles
04a8be1cdc MFC r295384: semget(2): Add missing [EINVAL] conditions.
PR:		206927
2016-04-08 15:43:49 +00:00
sbruno
44786516a4 Revert svn 297681 as it has been deprecated by svn 297575.
Submitted by:	Tomoaki AOKI <junchoon@dec.dakura.ne.jp>
2016-04-08 13:43:39 +00:00
mav
aec435c55b MFC r266615: Increase taskqueue thread priority from idle to PRIBIO.
Idle priority is not even time-share, so if system is busy in any way,
those events may never be executed.  Since in some cases system waits
for events processed by that thread, that may cause deadlocks.
2016-04-08 10:00:07 +00:00
sbruno
dde534d3bd MFC r297237
Add 4k enabled cam quirks for Samsung SM863 Series SSDs
2016-04-07 18:03:42 +00:00
mav
8f57ccd875 MFC r297255: Unify ichwd(4) attachment messages in dmesg. 2016-04-07 08:32:37 +00:00
mav
4dd915bf8d MFC r286890 (by fabient):
Add ichwd TCO version 3 support (Bay Trail / Rangeley...)
2016-04-07 08:31:52 +00:00
hselasky
6df5b27586 MFC r294520:
LinuxKPI atomic fixes:
- Fix implementation of atomic_add_unless(). The atomic_cmpset_int()
  function returns a boolean and not the previous value of the atomic
  variable.
- The atomic counters should be signed according to Linux.
- Some minor cosmetics and styling while at it.

Reviewed by:	alfred @
Sponsored by:	Mellanox Technologies
2016-04-07 07:52:09 +00:00
hselasky
206a1c6d98 MFC r297444:
Fix bugs in currently unused bit searching loop.

Sponsored by:	Mellanox Technologies
2016-04-07 07:44:01 +00:00
hselasky
9706ffd556 MFC r296934:
Fix crash in krping when run as a client due to NULL pointer access.
Initialize pointer in question which is used only when fast registers
mode is selected.

Sponsored by:	Mellanox Technologies
2016-04-07 07:41:06 +00:00
hselasky
1c1fa6f80e MFC r296987:
Add missing curly brackets in for loop.

Sponsored by:	Mellanox Technologies
2016-04-07 07:36:54 +00:00
hselasky
09c7580f48 MFC r296910:
Use hardware computed Toeplitz hash for incoming flowids

Use the Toeplitz hash value as source for the flowid. This makes the
hash value more suitable for so-called hash bucket algorithms which
are used in the FreeBSD's TCP/IP stack when RSS is enabled.

Sponsored by:	Mellanox Technologies
2016-04-07 07:35:02 +00:00
hselasky
0e933cfd2b MFC r296909:
Fix witness panic in the ipoib_ioctl() function when unloading the
ipoib module.

The bpfdetach() function is trying to turn off promiscious mode on the
network interface it is attached to while holding a mutex. The fix
consists of ignoring any further calls to the ipoib_ioctl() function
when the network interface is going to be detached. The ipoib_ioctl()
function might sleep.

Sponsored by:	Mellanox Technologies
2016-04-07 07:29:57 +00:00
hselasky
28b34f7466 MFC r294526:
Add missing atomic wrapper macro.

Reviewed by:	alfred @
Sponsored by:	Mellanox Technologies
2016-04-07 07:21:27 +00:00
hselasky
d0a1b2369f MFC r296342:
Allow for overlapping quirk device ranges. Prior to this patch only
the first device entry matching the USB vendor, product and revision
would be searched for quirks. After this patch all device entries will
be searched for quirks.
2016-04-07 07:17:23 +00:00
hselasky
58bfc3556c MFC r296902:
Improve detection of extended QSFP diagnostics.

The standards in the QSFP diagnostics area are not clear when the
additional measurements are present or not. Use a valid temperature
reading as an indicator for the presence of voltage and TX/RX power
measurements.

Sponsored by:	Mellanox Technologies
Tested by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D5391
Reviewed by:	gallatin
2016-04-07 07:12:14 +00:00
jhibbits
ee60d67180 MFC r295186
Align signal stack pointer to 16 bytes.

The stack must be aligned to 16 bytes at all times.  Clang 3.8 is especially
adamant about this, and causes strange behavior and segmentation faults if it is
not the case.

PR:             kern/206810
2016-04-07 00:37:46 +00:00