]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
4 years agoMFC r359440:
hselasky [Mon, 13 Apr 2020 16:32:18 +0000 (16:32 +0000)]
MFC r359440:
Implement new mixer API to return the device pointer based on the mixer pointer.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359887 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359356:
hselasky [Mon, 13 Apr 2020 16:30:10 +0000 (16:30 +0000)]
MFC r359356:
Change default microphone level from 0 to 25.

Discussed with: Horse Ma <Shichun.Ma@dell.com>
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359884 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359355:
hselasky [Mon, 13 Apr 2020 16:28:15 +0000 (16:28 +0000)]
MFC r359355:
Improve USB audio mixer support for USB audio class 1 and 2.
- make sure volume controls are correctly mapped to "pcm" and "rec" depending
  on how they deliver audio to the USB host.
- make sure there are no duplicate record selections.
- remove internal only mixer class type.
- don't add software volume controls for recording only.
- some minor mixer code cleanup.

Tested by: Horse Ma <Shichun.Ma@dell.com>
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359881 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359323:
hselasky [Mon, 13 Apr 2020 16:26:15 +0000 (16:26 +0000)]
MFC r359323:
Be more intelligent when classifying USB audio terminal types, so that we
don't end up using SOUND_MIXER_VOLUME for all undefined types.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359878 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359322:
hselasky [Mon, 13 Apr 2020 16:24:21 +0000 (16:24 +0000)]
MFC r359322:
Make mute controls available for USB audio mixers.

Submitted by: Horse Ma <Shichun.Ma@dell.com>
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359875 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359321:
hselasky [Mon, 13 Apr 2020 16:22:15 +0000 (16:22 +0000)]
MFC r359321:
Factor out USB audio mixer value range check.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359872 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359320:
hselasky [Mon, 13 Apr 2020 16:19:45 +0000 (16:19 +0000)]
MFC r359320:
Avoid scaling USB audio mixer values twice.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359869 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359653:
hselasky [Mon, 13 Apr 2020 09:02:17 +0000 (09:02 +0000)]
MFC r359653:
Count number of times transmit ring is out of buffers in mlx5en(4).

Differential Revision: https://reviews.freebsd.org/D24273
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359855 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359654:
hselasky [Mon, 13 Apr 2020 08:33:49 +0000 (08:33 +0000)]
MFC r359654:
Ensure a minimum inline size of 16 bytes in mlx5en(4).

This includes 14 bytes of ethernet header and 2 bytes of VLAN header.

This allows for making assumptions about the inline size limit
in the fast transmit path later on.

Use a signed integer variable to catch underflow.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359847 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359120:
hselasky [Thu, 26 Mar 2020 05:38:33 +0000 (05:38 +0000)]
MFC r359120:
Correctly implement support for remote wakeup for USB 3.0 device.

Submitted by: Horse Ma <Shichun.Ma@dell.com>
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359318 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r338422: Adding support for CS46xx MIDI output.
avatar [Fri, 20 Mar 2020 14:26:08 +0000 (14:26 +0000)]
MFC r338422: Adding support for CS46xx MIDI output.

With this patch, users can play the MIDI files through /dev/sequencer
device with tools like playmidi. The audio output will go through
the external MIDI device such like wavetable synthesis card.

Reviewed by: matk (a long time ago), kib
Tested with: Terratec SiXPack 5.1+ + Yamaha DB50XG

git-svn-id: svn://svn.freebsd.org/base/stable/10@359161 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359014:
hselasky [Thu, 19 Mar 2020 09:20:41 +0000 (09:20 +0000)]
MFC r359014:
Fix for double unlock in ipoib.

The ipoib_unicast_send() function is not supposed to unlock the priv lock.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359123 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r358841:
hselasky [Fri, 13 Mar 2020 09:18:28 +0000 (09:18 +0000)]
MFC r358841:
Fix for building libusb under Linux.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@358949 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r358838:
hselasky [Fri, 13 Mar 2020 08:57:22 +0000 (08:57 +0000)]
MFC r358838:
Add support for the device statistics IOCTL, needed by the coming
linux_libusb upgrade.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@358941 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r358695:
hselasky [Fri, 13 Mar 2020 08:53:59 +0000 (08:53 +0000)]
MFC r358695:
Define more subsystem orders.
Intended for use with module_init_order() in the LinuxKPI.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@358937 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r358694:
hselasky [Fri, 13 Mar 2020 08:50:56 +0000 (08:50 +0000)]
MFC r358694:
Fix some whitespace issues in ipoib.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@358933 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r358533:
mm [Fri, 13 Mar 2020 01:06:08 +0000 (01:06 +0000)]
MFC r358533:
Sync libarchive with vendor.

Relevant vendor changes:
  Issue #1257: Add testcase for ZIPX files with LZMA_STREAM_END marker
  PR #1331: cpio.5: fix hard link description
  Issue #1335: archive_read.c: fix UBSan warning about undefined behavior
  Issue #1338: XAR reader: fix UBSan warning about undefined behavior
  Issue #1339: bsdcpio_test: fix datatype in from_hex()
  Issue #1341: Safe writes: delete temporary file if rename fails.
  Issue #1341: Safe writes: improve error handling

git-svn-id: svn://svn.freebsd.org/base/stable/10@358927 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r358629:
hselasky [Wed, 11 Mar 2020 08:26:11 +0000 (08:26 +0000)]
MFC r358629:
Implement a detaching flag for the sound(4) subsystem to take
appropriate actions when we are trying to detach an audio device,
but cannot because someone is using it.

This avoids applications having to wait for the DSP read data
timeout before they receive any error indication.
Tested with virtual_oss(8).

Remove some unused definitions while at it.

PR: 194727
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@358879 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r358738:
hselasky [Wed, 11 Mar 2020 08:21:48 +0000 (08:21 +0000)]
MFC r358738:
Remove the power bit from the super speed root hub port status register
because it clobbers the super speed link status when a device is in super
speed mode. Currently the power bit is not needed for anything in the USB
hub driver.

This fixes USB warm reset for super speed devices.

Tested by: Shichun.Ma@dell.com
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@358875 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoRemove reference to the freebsd-mobile mailing list to fix the build.
gjb [Wed, 19 Feb 2020 15:30:13 +0000 (15:30 +0000)]
Remove reference to the freebsd-mobile mailing list to fix the build.

This is a direct commit to stable/10 as part of an ongoing investigation
regarding transient and silent build failures.

Sponsored by: Rubicon Communications, LLC (netgate.com)

git-svn-id: svn://svn.freebsd.org/base/stable/10@358119 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r356212,r356366,r356416,r357785
mm [Wed, 19 Feb 2020 01:51:44 +0000 (01:51 +0000)]
MFC r356212,r356366,r356416,r357785
Update libarchive to version 3.4.2

Relevant vendor changes (r356212):
  Issue #351: Refactor and implement private state logic for write filters
  PR #1252: RAR5 reader - verify window size for solid files (OSS-Fuzz 15482)
  PR #1255: zip writer - don't append unused NUL for directories
  PR #1260: Fix sparse file offset overflow on 32-bit systems
  PR #1263: UNICODE filename support for reading lha/lzh format
  Issue #1276: Bugfix and optimize archive_wstring_append_from_mbs()
  PR #1288: Add the "xattrhdr" option to pax write options
  PR #1295: 7z reader - fix reading archives with digests in PackInfo
  PR #1296: RAR5 reader - verify window size for multivolume archives
  PR #1297: ZIP reader - support LZMA_STREAM_END marker in 'lzma alone' files
  Issue #1298: Fix a heap-buffer-overflow in archive_string_append_from_wcs()
  OSS-Fuzz 19360, 19362: LHA reader - plug two memory leaks on error
  Fix possible off-by-one when dealing with readlink(2)

Relevant vendor changes (r356366):
  Issue #1302: Plug memory leak on failure of archive_write_client_open()

Relevant vendor changes (r356416):
  Issue #1302: Re-do fix for archive_write_client_open()

Relevant vendor changes (r357785):
  PR #1289: atomic extraction support (bsdtar -x --safe-writes)
  PR #1308: big endian fix for UTF16 support in LHA reader
  PR #1326: reject RAR5 files that declare invalid header flags
  Issue #987: fix support 7z archive entries with Delta filter
  Issue #1317: fix compression output buffer handling in XAR writer
  Issue #1319: fix uname or gname longer than 32 characters in pax writer
  Issue #1325: fix use after free when archiving hardlinks in ISO9660 or XAR
  Use localtime_r() and gmtime_r() instead of localtime() and gmtime()

git-svn-id: svn://svn.freebsd.org/base/stable/10@358090 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC: r357149
rmacklem [Mon, 17 Feb 2020 19:31:34 +0000 (19:31 +0000)]
MFC: r357149
Fix a crash in the NFSv4 server.

The PR reported a crash that occurred when a file was removed while
client(s) were actively doing lock operations on it.
Since nfsvno_getvp() will return NULL when the file does not exist,
the bug was obvious and easy to fix via this patch. It is a little
surprising that this wasn't found sooner, but I guess the above
case rarely occurs.

PR: 242768

git-svn-id: svn://svn.freebsd.org/base/stable/10@358035 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r357212: libfetch: fix urldecode buffer overrun
emaste [Wed, 5 Feb 2020 18:26:50 +0000 (18:26 +0000)]
MFC r357212: libfetch: fix urldecode buffer overrun

Reported by: Duncan Overbruck
Security: CVE-2020-7450

git-svn-id: svn://svn.freebsd.org/base/stable/10@357582 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r357340:
dim [Tue, 4 Feb 2020 19:46:29 +0000 (19:46 +0000)]
MFC r357340:

Merge r357339 from the clang1000-import branch:

Fix the following -Werror warning from clang 10.0.0 in bsnmpd:

usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c:1661:4: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation]
                        return (-1);
                        ^
usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c:1658:5: note: previous statement is here
                } else
                  ^

The intent was to group the return statement with the previous syslog()
call.

git-svn-id: svn://svn.freebsd.org/base/stable/10@357523 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r357272:
dim [Tue, 4 Feb 2020 19:35:40 +0000 (19:35 +0000)]
MFC r357272:

Merge r357271 from the clang1000-import branch:

Fix the following -Werror warning from clang 10.0.0 in bsnmpd:

usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c:1235:43: error: overlapping comparisons always evaluate to true [-Werror,-Wtautological-overlap-compare]
                            begemotBridgeStpPortEnable_enabled ||
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~

Work around it by casting the enum values to the type of val->v.integer.

git-svn-id: svn://svn.freebsd.org/base/stable/10@357520 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r357268:
dim [Tue, 4 Feb 2020 19:31:01 +0000 (19:31 +0000)]
MFC r357268:

Merge r357260 from the clang1000-import branch:

Fix the following -Werror warning from clang 10.0.0 in procstat:

usr.bin/procstat/procstat_sigs.c:79:3: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation]
                xo_close_container(name);
                ^
usr.bin/procstat/procstat_sigs.c:77:4: note: previous statement is here
        } else
          ^

The intent was to group the xo_close_container() call to the previous
snprintf() call.

git-svn-id: svn://svn.freebsd.org/base/stable/10@357519 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r357269:
dim [Tue, 4 Feb 2020 19:24:10 +0000 (19:24 +0000)]
MFC r357269:

Merge r357267 from the clang1000-import branch:

Fix the following -Werror warning from clang 10.0.0 in tip:

usr.bin/tip/tip/tip.c:428:4: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
                        if (gch == EOF)
                        ^
usr.bin/tip/tip/tip.c:426:5: note: previous statement is here
                } else if (!cumode && gch == character(value(FORCE)))
                  ^

The intent was to have the EOF check grouped with the getchar() call
just above it.  This was accidentally introduced in r354624.

git-svn-id: svn://svn.freebsd.org/base/stable/10@357518 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r357223:
dim [Tue, 4 Feb 2020 19:19:48 +0000 (19:19 +0000)]
MFC r357223:

Merge r357222 from the clang1000-import branch:

Fix the following -Werror warning from clang 10.0.0 in rbootd:

libexec/rbootd/rmpproto.c:335:49: error: multiple unsequenced modifications to 'filename' [-Werror,-Wunsequenced]
        filename = (filename = strrchr(filepath,'/'))? ++filename: filepath;
                 ~                                     ^

git-svn-id: svn://svn.freebsd.org/base/stable/10@357517 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r357298:
hselasky [Mon, 3 Feb 2020 11:05:59 +0000 (11:05 +0000)]
MFC r357298:
Add missing mutex unlock in failure case.

Differential Revision: https://reviews.freebsd.org/D23430
Submitted by: cem
Reported by: Coverity
Coverity CID: 1368773
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@357439 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r356952:
hselasky [Mon, 3 Feb 2020 10:50:52 +0000 (10:50 +0000)]
MFC r356952:
Add new USB ID to uslcom(4).

Submitted by: Oleg Sharoyko <osharoiko@gmail.com>
PR: 243494
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@357432 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r356633:
hselasky [Mon, 3 Feb 2020 10:47:44 +0000 (10:47 +0000)]
MFC r356633:
Make sure the VNET is properly set when reaping mbufs in ipoib.
Else the following panic may happen:

panic()
icmp_error()
ipoib_cm_mb_reap()
linux_work_fn()
taskqueue_run_locked()
taskqueue_thread_loop()
fork_exit()
fork_trampoline()

Submitted by: Andreas Kempe <kempe@lysator.liu.se>
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@357429 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r357226:
dim [Fri, 31 Jan 2020 20:04:32 +0000 (20:04 +0000)]
MFC r357226:

Merge r357224 from the clang1000-import branch:

Fix the following -Werror warning from clang 10.0.0 in binutils:

contrib/binutils/bfd/peicode.h:1356:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
                if (efi)
                ^
contrib/binutils/bfd/peicode.h:1353:8: note: previous statement is here
              if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch)
              ^
contrib/binutils/bfd/peicode.h:1370:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
                if (!efi)
                ^
contrib/binutils/bfd/peicode.h:1367:8: note: previous statement is here
              if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch)
              ^

git-svn-id: svn://svn.freebsd.org/base/stable/10@357351 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r356545:
hselasky [Thu, 16 Jan 2020 08:53:59 +0000 (08:53 +0000)]
MFC r356545:
Fix a XHCI driver issue with Intel's Gemini Lake SOC.

Do not configure any endpoint twice, but instead keep track of which
endpoints are configured on a per device basis, and use an evaluate
endpoint context command instead. When changing the configuration make
sure all endpoints get deconfigured and the configured endpoint mask
is reset.

This fixes an issue where an endpoint might stop working if there is
an error and the endpoint needs to be reconfigured as a part of the
error recovery mechanism in the FreeBSD USB stack.

Tested by: Shichun.Ma@dell.com
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@356783 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r356551: arp(8): avoid segfaulting due to out-of-bounds memory access
eugen [Thu, 16 Jan 2020 08:27:30 +0000 (08:27 +0000)]
MFC r356551: arp(8): avoid segfaulting due to out-of-bounds memory access

Fix obvious mistake that sometimes results in reading memory
past end of an array.

PR:             242784

git-svn-id: svn://svn.freebsd.org/base/stable/10@356780 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r356409:
hselasky [Mon, 13 Jan 2020 11:33:03 +0000 (11:33 +0000)]
MFC r356409:
Add own counter for cancelled USB transfers.
Do not count these as errors.

Bump the FreeBSD version to force recompilation of external modules.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@356681 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r356201:
hselasky [Mon, 6 Jan 2020 09:51:54 +0000 (09:51 +0000)]
MFC r356201:
Fix spelling.

PR: 242891
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@356412 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r356137:
hselasky [Mon, 6 Jan 2020 09:40:59 +0000 (09:40 +0000)]
MFC r356137:
Implement dump_stats command for usbconfig(8).

This command is useful when debugging USB device issues.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@356408 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r351146:
hselasky [Mon, 6 Jan 2020 09:40:18 +0000 (09:40 +0000)]
MFC r351146:
Implement detach_kernel_driver command in usbconfig(8).

Submitted by: Kevin Zheng <kevinz5000@gmail.com>
PR: 239916

git-svn-id: svn://svn.freebsd.org/base/stable/10@356407 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r333089:
hselasky [Mon, 6 Jan 2020 09:38:57 +0000 (09:38 +0000)]
MFC r333089:
Clean up the EXAMPLES section of usbconfig(8).  This removes parts that
become redundant after documenting all the subcommands, and switches
to the new syntax, without the '-d'.

Reviewed by: hselasky@
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@356406 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r332659:
hselasky [Mon, 6 Jan 2020 09:38:08 +0000 (09:38 +0000)]
MFC r332659:
Make it possible to pass the ugenX.Y to usbconfig(8) without using "-d",
eg "usbconfig ugen1.2 dump_all_desc".

Reviewed by: hselasky@
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@356405 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r330875:
hselasky [Mon, 6 Jan 2020 09:37:13 +0000 (09:37 +0000)]
MFC r330875:
Add "usbconfig dump_all_desc", a subcommand to dump all device and config
descriptors.

Reviewed by: hselasky@
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@356404 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r327522:
hselasky [Mon, 6 Jan 2020 09:35:57 +0000 (09:35 +0000)]
MFC r327522:
Fix warnings from "mandoc -Tlint -Wwarning".

Reported by: Yuri Pankov <yuripv at gmx.com>
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@356403 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r327382:
hselasky [Mon, 6 Jan 2020 09:35:11 +0000 (09:35 +0000)]
MFC r327382:
Improve usbconfig(8) manual page by adding descriptions for subcommands.

Reviewed by: hselasky
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13445

git-svn-id: svn://svn.freebsd.org/base/stable/10@356402 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r356136:
hselasky [Mon, 6 Jan 2020 09:22:33 +0000 (09:22 +0000)]
MFC r356136:
Implement new libusb v2.0 API function, libusb20_dev_get_stats().

This function is useful when debugging USB device issues.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@356399 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r356135:
hselasky [Mon, 6 Jan 2020 09:16:41 +0000 (09:16 +0000)]
MFC r356135:
Make USB statistics per device instead of per bus.

Bump the FreeBSD version due to structure change to
force recompilation of external USB modules.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@356396 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r355447:
hselasky [Wed, 25 Dec 2019 09:34:16 +0000 (09:34 +0000)]
MFC r355447:
Fix compilation issue with mlx5core and sparc64 (gcc48):

sys/dev/mlx5/mlx5_en/mlx5_en_tx.c:335: error: requested alignment is not a constant

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@356074 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r355108 and r355170:
hselasky [Thu, 5 Dec 2019 14:53:46 +0000 (14:53 +0000)]
MFC r355108 and r355170:
Fix panic when loading kernel modules before root file system is mounted.
Make sure the rootvnode is always NULL checked.

Differential Revision: https://reviews.freebsd.org/D22545
PR: 241639
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@355419 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agor355120 | dim | 2019-11-26 23:01:09 +0100 (Tue, 26 Nov 2019) | 32 lines
dim [Wed, 4 Dec 2019 17:45:34 +0000 (17:45 +0000)]
r355120 | dim | 2019-11-26 23:01:09 +0100 (Tue, 26 Nov 2019) | 32 lines

The fdlibm hypot() implementations shouldn't potentially left-shift
negative numbers (invoking undefined behavior)

Summary:
Various paths through hypot(x, y) will multiply x and y by a power of
two, perform the calculation in a range where IEEE-754 provides greater
precision, then undo the multiplication to determine the true result.
Undoing that multiplication is implemented as t1*w, where t1=2**k.

2**k is often computed by taking the high word of 1.0, then adding k<<20
(for doubles or long doubles) or k<<23 (for floats) to it, then
overwriting that high word. But when k is negative this left-shifts a
negative value -- and that's undefined behavior in many editions of C
and C++.

This patch should fix all hypot implementations to compute 2**k without
triggering this particular bit of undefined behavior.

Test Plan: I've only very lightly tested out the hypot(double, double)
change, in SpiderMonkey's JavaScript engine, for consistency with prior
behavior.  The other functions' changes have more or less only been
eyeballed.  Careful examination appreciated!  Do note, however, that an
error in any of these changes would most likely produce a value that is
incorrect by a factor of two, so any mistake would most likely be
glaring if invoked.

Submitted by: Jeff Walden <jwalden@mit.edu>
Obtained from: https://github.com/freebsd/freebsd/pull/414
Reviewed by: dim, lwhsu
Differential Revision: https://reviews.freebsd.org/D22354

git-svn-id: svn://svn.freebsd.org/base/stable/10@355395 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r354255:
dim [Sun, 10 Nov 2019 17:33:10 +0000 (17:33 +0000)]
MFC r354255:

Add __isnan()/__isnanf() aliases for compatibility with glibc and CUDA

Even though clang comes with a number of internal CUDA wrapper headers,
compiling sample CUDA programs will result in errors similar to:

In file included from <built-in>:1:
In file included from /usr/lib/clang/9.0.0/include/__clang_cuda_runtime_wrapper.h:204:
/usr/home/arr/cuda/var/cuda-repo-10-0-local-10.0.130-410.48/usr/local/cuda-10.0//include/crt/math_functions.hpp:2910:7: error: no matching function for call to '__isnan'
  if (__isnan(a)) {
      ^~~~~~~
/usr/lib/clang/9.0.0/include/__clang_cuda_device_functions.h:460:16: note: candidate function not viable: call to __device__ function from __host__ function
__DEVICE__ int __isnan(double __a) { return __nv_isnand(__a); }
               ^

CUDA expects __isnan() and __isnanf() declarations to be available,
which are glibc specific extensions, equivalent to the regular isnan()
and isnanf().

To provide these, define __isnan() and __isnanf() as aliases of the
already existing static inline functions __inline_isnan() and
__inline_isnanf() from math.h.

Reported by: arrowd
PR: 241550

git-svn-id: svn://svn.freebsd.org/base/stable/10@354596 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoReplace current with stable/10
imp [Wed, 6 Nov 2019 14:34:14 +0000 (14:34 +0000)]
Replace current with stable/10

Direct commit because not relevant to other branches

Reported by: Jamie Landeg-Jones

git-svn-id: svn://svn.freebsd.org/base/stable/10@354393 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC: r353778 (partial)
marius [Wed, 30 Oct 2019 21:49:34 +0000 (21:49 +0000)]
MFC: r353778 (partial)

In em_handle_link(), only re-arm the link state change interrupt for
82574 and also only if such a device uses MSI-X, i. e. takes advantage
of autoclearing. In case of INTx and MSI re-arming isn't appropriate
here and setting EM_MSIX_LINK isn't either.

git-svn-id: svn://svn.freebsd.org/base/stable/10@354209 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r319872, r321063, r321582, r322034, r322425, r322962, r322985,
np [Thu, 10 Oct 2019 23:27:02 +0000 (23:27 +0000)]
MFC r319872, r321063, r321582, r322034, r322425, r322962, r322985,
r325596, r326026, r328420, r331472, r333276, r333650, r333652, r334406,
r334409-r334410, r334489, r336042, r340651, r342603, and r345083.

This updates the cxgbe firmwares in stable/10 and also pulls in support
for some newer boards and flash parts.

r319872:
cxgbe(4):  Do not request an FEC setting that the port does not support.

r321063:
cxgbe(4): Various link/media related improvements.

r321582:
cxgbe(4): Some updates to the common code.

r322034:
cxgbe(4): Always use the first and not the last virtual interface
associated with a port in begin_synchronized_op.

r322425:
cxgbe(4): Save the last reported link parameters and compare them with
the current state to determine whether to generate a link-state change
notification.  This fixes a bug introduced in r321063 that caused the
driver to sometimes skip these notifications.

r322962:
cxgbe(4): Remove write only variable from t4_port_init.

r322985:
cxgbe(4): Maintain one ifmedia per physical port instead of one per
Virtual Interface (VI).  All autonomous VIs that share a port share the
same media.

r325596:
cxgbe(4): Do not request settings not supported by the port.

r326026:
cxgbe(4): Add a custom board to the device id list.

r328420:
cxgbe(4): Do not display harmless warning in non-debug builds.

r331472:
cxgbe(4): Always initialize requested_speed to a valid value.

This fixes an avoidable EINVAL when the user tries to disable AN after
the port is initialized but l1cfg doesn't have a valid speed to use.

r333276:
cxgbe(4): Update all firmwares to 1.19.1.0.

r333650:
cxgbe(4): Claim some more T5 and T6 boards.

r333652:
cxgbe(4): Add support for two more flash parts.

r334406:
cxgbe(4): Consider all supported speeds when building the ifmedia list
for a port.  Fix other related issues while here:
- Require port lock for access to link_config.
- Allow 100Mbps operation by tracking the speed in Mbps.  Yes, really.
- New port flag to indicate that the media list is immutable.  It will
  be used in future refinements.

This also fixes a bug where the driver reports incorrect media with
recent firmwares.

r334409:
cxgbe(4): Implement ifm_change callback.

r334410:
cxgbe(4): Use ifm for ifmedia just like the rest of the kernel.

No functional change.

r334489:
cxgbe(4): Include full duplex mediaopt in media that can be reported as
active.  Always report full duplex in active media.

r336042:
cxgbe(4): Assume that any unknown flash on the card is 4MB and has 64KB
sectors, instead of refusing to attach to the card.

r340651:
cxgbe(4): Update T4/5/6 firmwares to 1.22.0.3.

r342603:
cxgbe(4): Attach to two T540 variants.

r345083:
cxgbe(4): Update T4/5/6 firmwares to 1.23.0.0.

git-svn-id: svn://svn.freebsd.org/base/stable/10@353418 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r318147 (by erj@):
np [Thu, 10 Oct 2019 20:28:34 +0000 (20:28 +0000)]
MFC r318147 (by erj@):

Add several new media types to if_media.h

These include several 25G types (for active direct attach cables and LR modules),
and a missing type for 10G active direct attach.

git-svn-id: svn://svn.freebsd.org/base/stable/10@353414 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r316456,352732:
mm [Wed, 9 Oct 2019 22:19:48 +0000 (22:19 +0000)]
MFC r316456,352732:
Sync libarchive with vendor.

MFC r316456:
Vendor changes (FreeBSD-related):
  Report which extended attributes could not be restored
  Update archive_read_disk.3 and archive_write_disk.3 manual pages
  Plug memory leaks in xattr tests.

MFC r352732:
Relevant vendor changes:
  Issue #1237: Fix integer overflow in archive_read_support_filter_lz4.c
  PR #1249: Correct some typographical and grammatical errors.
  PR #1250: Minor corrections to the formatting of manual pages

git-svn-id: svn://svn.freebsd.org/base/stable/10@353377 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r352556:
hselasky [Mon, 7 Oct 2019 08:25:25 +0000 (08:25 +0000)]
MFC r352556:
Add quirk for XHCI(4) controllers to support USB control transfers
above 1Kbyte.  It might look like some XHCI(4) controllers do not
support when the USB control transfer is split using a link TRB. The
next NORMAL TRB after the link TRB is simply failing with XHCI error
code 4. The quirk ensures we allocate a 64Kbyte buffer so that the
data stage TRB is not broken with a link TRB.

Found at: EuroBSDcon 2019
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@353179 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r352555:
hselasky [Mon, 7 Oct 2019 08:13:49 +0000 (08:13 +0000)]
MFC r352555:
Increase the maximum user-space buffer size from 256kBytes to 32MBytes for
libusb. This is useful for speeding up large data transfers while reducing
the interrupt rate.

Found at: EuroBSDcon 2019
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@353175 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r352554:
hselasky [Mon, 7 Oct 2019 08:11:12 +0000 (08:11 +0000)]
MFC r352554:
The maximum TD size is 31 and not 15.

Found at: EuroBSDcon 2019
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@353171 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r353116:
cy [Mon, 7 Oct 2019 04:44:01 +0000 (04:44 +0000)]
MFC r353116:

Add missing definition in DEBUG code.

git-svn-id: svn://svn.freebsd.org/base/stable/10@353164 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r352783:
cy [Mon, 30 Sep 2019 02:32:51 +0000 (02:32 +0000)]
MFC r352783:

Fix a typo.

git-svn-id: svn://svn.freebsd.org/base/stable/10@352884 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r352737:
cy [Sun, 29 Sep 2019 03:41:15 +0000 (03:41 +0000)]
MFC r352737:

ipf mistakenly regards UDP packets with a checksum of 0xffff as bad.

Obtained from: NetBSD fil.c r1.30, NetBSD PR/54443

git-svn-id: svn://svn.freebsd.org/base/stable/10@352866 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r352710:
dim [Sat, 28 Sep 2019 08:57:29 +0000 (08:57 +0000)]
MFC r352710:

Do not left-shift a negative number (inducing undefined behavior in
C/C++) in exp(3), expf(3), expm1(3) and expm1f(3) during intermediate
computations that compute the IEEE-754 bit pattern for |2**k| for
integer |k|.

The implementations of exp(3), expf(3), expm1(3) and expm1f(3) need to
compute IEEE-754 bit patterns for 2**k in certain places.  (k is an
integer and 2**k is exactly representable in IEEE-754.)

Currently they do things like 0x3FF0'0000+(k<<20), which is to say they
take the bit pattern representing 1 and then add directly to the
exponent field to get the desired power of two.  This is fine when k is
non-negative.

But when k<0 (and certain classes of input trigger this), this
left-shifts a negative number -- an operation with undefined behavior in
C and C++.

The desired semantics can be achieved by instead adding the
possibly-negative k to the IEEE-754 exponent bias to get the desired
exponent field, _then_ shifting that into its proper overall position.

(Note that in case of s_expm1.c and s_expm1f.c, there are SET_HIGH_WORD
and SET_FLOAT_WORD uses further down in each of these files that perform
shift operations involving k, but by these points k's range has been
restricted to 2 < k <= 56, and the shift operations under those
circumstances can't do anything that would be UB.)

Submitted by: Jeff Walden, https://github.com/jswalden
Obtained from: https://github.com/freebsd/freebsd/pull/411
Obtained from: https://github.com/freebsd/freebsd/pull/412

git-svn-id: svn://svn.freebsd.org/base/stable/10@352835 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r351380:
cy [Sun, 25 Aug 2019 01:09:31 +0000 (01:09 +0000)]
MFC r351380:

Specifying array sizes for fully initialized tables at compile time is
redundant.

git-svn-id: svn://svn.freebsd.org/base/stable/10@351468 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r350396:
hselasky [Wed, 14 Aug 2019 09:42:26 +0000 (09:42 +0000)]
MFC r350396:
Add support for tethering with Nokia 7 plus and the alike.

PR: 239495
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@351017 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r350855: Upgrade to Bzip2 version 1.0.8.
delphij [Wed, 14 Aug 2019 06:41:22 +0000 (06:41 +0000)]
MFC r350855: Upgrade to Bzip2 version 1.0.8.

git-svn-id: svn://svn.freebsd.org/base/stable/10@351008 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r349927, r349929:
cy [Fri, 12 Jul 2019 02:14:05 +0000 (02:14 +0000)]
MFC r349927, r349929:

r349927:
  Resolve IPv6 checksum errors with stateful inspection. According to
  PR/203585 this appears to have been broken by r235959, which predates
  the ipfilter 5.1.2 import into FreeBSD.

  The IPv6 checksum calculation is incorrect. To resolve this we call
  in6_cksum() to do the the heavy lifting for us, through a new function
  ipf_pcksum6(). Should we need to revisit this area again, a DTrace probe
  is added to aid with future debugging.

  Plus whitespace adjustments (r348989).

  PR: 203275, 203585
  Differential Revision: https://reviews.freebsd.org/D20583

r349929:
  Move the new ipf_pcksum6() function from ip_fil_freebsd.c to fil.c.
  The reason for this is that ipftest(8), which still works on FreeBSD-11,
  fails to link to it, breaking stable/11 builds.

  ipftest(8) was broken (segfault) sometime during the FreeBSD-12 cycle.
  glebius@ suggested we disable building it until I can get around to
  fixing it. Hence this was not caught in -current.

  The intention is to fix ipftest(8) as it is used by the netbsd-tests
  (imported by ngie@ many moons ago) for regression testing.

git-svn-id: svn://svn.freebsd.org/base/stable/10@349931 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r348987, r348989:
cy [Fri, 12 Jul 2019 00:50:33 +0000 (00:50 +0000)]
MFC r348987, r348989:

Resolve IPv6 checksum errors with stateful inspection. According to
PR/203585 this appears to have been broken by r235959, which predates
the ipfilter 5.1.2 import into FreeBSD.

The IPv6 checksum calculation is incorrect. To resolve this we call
in6_cksum() to do the the heavy lifting for us, through a new function
ipf_pcksum6(). Should we need to revisit this area again, a DTrace probe
is added to aid with future debugging.

Plus whitespace adjustments (r348989).

PR: 203275, 203585
Differential Revision: https://reviews.freebsd.org/D20583

git-svn-id: svn://svn.freebsd.org/base/stable/10@349927 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC 349843:
cy [Thu, 11 Jul 2019 00:44:09 +0000 (00:44 +0000)]
MFC 349843:

Update frtuc struct comments. It not only defines TCP things we are
interested in but also UDP.

While at it document the source and destination port variables.

git-svn-id: svn://svn.freebsd.org/base/stable/10@349903 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r349842:
cy [Thu, 11 Jul 2019 00:38:10 +0000 (00:38 +0000)]
MFC r349842:

Correct the description for the low port in the port compare struct.

Adjust the high port description to match that of the low port
description.

git-svn-id: svn://svn.freebsd.org/base/stable/10@349902 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r349527,349538:
mm [Thu, 11 Jul 2019 00:22:10 +0000 (00:22 +0000)]
MFC r349527,349538:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #1217: RAR5 reader - fix ARM filter going beyond window buffer boundary
            (OSS-Fuzz 15431)
  PR #1218: Fixes to sparse file handling

git-svn-id: svn://svn.freebsd.org/base/stable/10@349901 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r349503-349504:
cy [Fri, 5 Jul 2019 04:24:09 +0000 (04:24 +0000)]
MFC r349503-349504:

Document the -B, binary logfile, and the -C config file options.
Reference the ipmon.5 man page and ipmon.conf.

PR: 238816

git-svn-id: svn://svn.freebsd.org/base/stable/10@349759 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r349505: Upgrade to Bzip2 version 1.0.7.
delphij [Thu, 4 Jul 2019 07:36:09 +0000 (07:36 +0000)]
MFC r349505: Upgrade to Bzip2 version 1.0.7.

git-svn-id: svn://svn.freebsd.org/base/stable/10@349719 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r349409 and r349410:
hselasky [Wed, 3 Jul 2019 18:26:07 +0000 (18:26 +0000)]
MFC r349409 and r349410:
Fix support for LIBUSB_HOTPLUG_ENUMERATE in libusb. Currently all
devices are enumerated regardless of of the LIBUSB_HOTPLUG_ENUMERATE
flag. Make sure when the flag is not specified no arrival events are
generated for currently enumerated devices.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@349669 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r349370:
hselasky [Wed, 3 Jul 2019 18:19:29 +0000 (18:19 +0000)]
MFC r349370:
Fix parsing of corrupt data in usbdump(8). Check that the transfer
type array lookup is within bounds to avoid segfault.

PR: 238801
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@349666 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r349448:
cy [Wed, 3 Jul 2019 18:11:22 +0000 (18:11 +0000)]
MFC r349448:

Fix a typo.

PR/238816 initially addressed updates to usage() however it has now
become a shopping list of fixes to ipmon man pages and usage().

PR: 238816

git-svn-id: svn://svn.freebsd.org/base/stable/10@349659 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r348993,349135:
mm [Fri, 28 Jun 2019 22:36:27 +0000 (22:36 +0000)]
MFC r348993,349135:
Sync libarchive with vendor including security fixes

r348993:
  - version bumped to 3.4.0
  - check_symlinks_fsobj() without chdir() and fchdir()
  - bsdtar.1 manpage fixes
  - patches from OpenBSD to libarchive_fe/passphrase.c

r349135:
  PR #1212: RAR5 reader - window_mask was not updated correctly
            (OSS-Fuzz 15278)
  OSS-Fuzz 15120: RAR reader - extend use after free bugfix

git-svn-id: svn://svn.freebsd.org/base/stable/10@349525 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoCorrect Konrad Zuse's year of birth.
grog [Sat, 22 Jun 2019 23:36:28 +0000 (23:36 +0000)]
Correct Konrad Zuse's year of birth.

git-svn-id: svn://svn.freebsd.org/base/stable/10@349296 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r348797:
hselasky [Tue, 11 Jun 2019 08:53:26 +0000 (08:53 +0000)]
MFC r348797:
Fix for reading the configuration descriptor in libusb. Catch invalid
configuration descriptor reads early on to avoid issues with devices
that don't check for a valid USB configuration read request.

Submitted by: takahiro.kurosawa@gmail.com
PR: 238412

git-svn-id: svn://svn.freebsd.org/base/stable/10@348895 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r348631:
hselasky [Mon, 10 Jun 2019 13:37:38 +0000 (13:37 +0000)]
MFC r348631:
In usb(4) fix a lost completion event issue towards libusb(3). It may happen
if a USB transfer is cancelled that we need to fake a completion event.
Implement missing support in ugen_fs_copy_out() to handle this.

This fixes issues with webcamd(8) and firefox.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@348857 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r348604:
hselasky [Mon, 10 Jun 2019 13:17:39 +0000 (13:17 +0000)]
MFC r348604:
In xhci(4) there is no stream ID in the completion TRB.
Instead iterate all the stream IDs in stream mode to find
the matching USB transfer.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@348853 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r348603:
hselasky [Sun, 9 Jun 2019 08:22:38 +0000 (08:22 +0000)]
MFC r348603:
Make sure the DMA tags get freed in mlx5en(4).

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@348832 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r347990:
mm [Tue, 4 Jun 2019 10:36:26 +0000 (10:36 +0000)]
MFC r347990:
Sync libarchive with vendor.

Relevant vendor changes:
  Issue #795: XAR - do not try to add xattrs without an allocated name
  PR #812: non-recursive option for extract and list
  PR #958: support reading metadata from compressed files
  PR #999: add --exclude-vcs option to bsdtar
  Issue #1062: treat empty archives with a GNU volume header as valid
  PR #1074: Handle ZIP files with trailing 0s in the extra fields
            (Android APK archives)
  PR #1109: Ignore padding in Zip extra field data (Android APK archives)
  PR #1167: fix problems related to unreadable directories
  Issue #1168: fix handling of strtol() and strtoul()
  PR #1172: RAR5 - fix invalid window buffer read in E8E9 filter
  PR #1174: ZIP reader - fix of MSZIP signature parsing
  PR #1175: gzip filter - fix reading files larger than 4GB from memory
  PR #1177: gzip filter - fix memory leak with repeated header reads
  PR #1180: ZIP reader - add support for Info-ZIP Unicode Path Extra Field
  PR #1181: RAR5 - fix merge_block() recursion
            (OSS-Fuzz 12999, 13029, 13144, 13478, 13490)
  PR #1183: fix memory leak when decompressing ZIP files with LZMA
  PR #1184: fix RAR5 OSS-Fuzz issues 12466, 14490, 14491, 12817
    OSS-Fuzz 12466: RAR5 - fix buffer overflow when parsing huffman tables
    OSS-Fuzz 14490, 14491: RAR5 - fix bad shift-left operations
    OSS-Fuzz 12817: RAR5 - handle a case with truncated huffman tables
  PR #1186: RAR5 - fix invalid type used for dictionary size mask
            (OSS-Fuzz 14537)
  PR #1187: RAR5 - fix integer overflow (OSS-Fuzz 14555)
  PR #1190: RAR5 - RAR5 don't try to unpack entries marked as directories
            (OSS-Fuzz 14574)
  PR #1196: RAR5 - fix a potential SIGSEGV on 32-bit builds
  OSS-Fuzz 2582: RAR - fix use after free if there is an invalid entry
  OSS-Fuzz 14331: RAR5 - fix maximum owner name length
  OSS-Fuzz 13965: RAR5 - use unsigned int for volume number + range check

  Additional RAR5 reader changes:
    - support symlinks, hardlinks, file owner, file group, versioned files
    - change ARCHIVE_FORMAT_RAR_V5 to 0x100000
    - set correct mode for readonly directories
    - support readonly, hidden and system Windows file attributes

MFC r347999:
Install missing data file for
lib.libarchive.functional_test.test_read_format_zip_utf8_paths

git-svn-id: svn://svn.freebsd.org/base/stable/10@348608 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMF11 r347561.
obrien [Tue, 14 May 2019 04:34:58 +0000 (04:34 +0000)]
MF11 r347561.
MFC r344085: Note that readpassphrase() came into FreeBSD's libc at 4.6.

git-svn-id: svn://svn.freebsd.org/base/stable/10@347562 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r347234:
cy [Fri, 10 May 2019 01:02:07 +0000 (01:02 +0000)]
MFC r347234:

Improve the legibility of the login.access.5 man page by separating
each argument into its own paragraph.

git-svn-id: svn://svn.freebsd.org/base/stable/10@347420 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC: r346856
rmacklem [Mon, 6 May 2019 03:20:02 +0000 (03:20 +0000)]
MFC: r346856
Add #ifdef INET6 around declaration of nbuf.

It was reported that without #ifdef INET6 around the declaration of "nbuf",
a build would report an unused variable. For some reason, I didn't see that
warning when I did a build, but it seems reasonable to add these #ifdef INET6's.

git-svn-id: svn://svn.freebsd.org/base/stable/10@347174 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC: r346365
rmacklem [Fri, 3 May 2019 02:30:01 +0000 (02:30 +0000)]
MFC: r346365
Fix the NFSv4.0 server so that it does not support NFSv4.1 attributes.

During inspection of a packet trace, I noticed that an NFSv4.0 mount
reported that it supported attributes that are only defined for NFSv4.1.
In practice, this bug appears to be benign, since NFSv4.0 clients will
not use attributes that were added for NFSv4.1.
However, this was not correct and this patch fixes the NFSv4.0 server
so that it only supports attributes defined for NFSv4.0.
It also adds a definition for NFSv4.1 attributes that can only be set,
although it is only defined as 0 for now.
This is anticipation of the addition of support for the NFSv4.1 mode+mask
attribute soon.

git-svn-id: svn://svn.freebsd.org/base/stable/10@347040 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC: r346709
rmacklem [Thu, 2 May 2019 01:17:55 +0000 (01:17 +0000)]
MFC: r346709
Add support to nfsdumpstate for printing of INET6 addresses for locks.

r346190 added support for printing of INET6 addresses for the "-o" option
(all opens) but missed adding support for INET6 addresses for the "-l" option.
This patch adds that support.

git-svn-id: svn://svn.freebsd.org/base/stable/10@347010 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r346804:
cy [Wed, 1 May 2019 01:49:33 +0000 (01:49 +0000)]
MFC r346804:

Left justify a function header brace as it should be.
No functional change.

git-svn-id: svn://svn.freebsd.org/base/stable/10@346982 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: r346191
rmacklem [Sat, 27 Apr 2019 02:43:27 +0000 (02:43 +0000)]
MFC: r346191
Add support for INET6 addresses to the kernel code that dumps open/lock state.

PR#223036 reported that INET6 callback addresses were not printed by
nfsdumpstate(8). This kernel patch adds INET6 addresses to the dump structure,
so that nfsdumpstate(8) can print them out, post-r346190.

git-svn-id: svn://svn.freebsd.org/base/stable/10@346779 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: r346190
rmacklem [Sat, 27 Apr 2019 02:34:10 +0000 (02:34 +0000)]
MFC: r346190
Fix nfsdumpstate(8) so that it can print out INET6 callback addresses.

The patch adds support for printing of INET6 callback addresses.
It also adds the #ifdef INET, INET6 as requested by bz@.

git-svn-id: svn://svn.freebsd.org/base/stable/10@346778 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r346229 and r346248:
hselasky [Thu, 25 Apr 2019 12:02:17 +0000 (12:02 +0000)]
MFC r346229 and r346248:
Fix spelling and remove superfluous USB keyword.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@346669 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoFix Makefile after r346467 merged incorrect include file.
rmacklem [Sun, 21 Apr 2019 14:45:18 +0000 (14:45 +0000)]
Fix Makefile after r346467 merged incorrect include file.

git-svn-id: svn://svn.freebsd.org/base/stable/10@346487 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: r345995
rmacklem [Sun, 21 Apr 2019 01:33:13 +0000 (01:33 +0000)]
MFC: r345995
Delete the BUGS entry related to failing when jails are enabled.

r345994 has finally fixed the bug that caused the nfsuserd(8) daemon to
fail when jails were enabled, so delete the BUGS entry from the man page.

git-svn-id: svn://svn.freebsd.org/base/stable/10@346468 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: r345994
rmacklem [Sun, 21 Apr 2019 01:25:27 +0000 (01:25 +0000)]
MFC: r345994
Fix nfsuserd so that it handles the mapped localhost address when jails
are enabled.

The nfsuserd(8) daemon does not function correctly when jails are enabled,
since localhost gets mapped to another IP address and, as such, the upcall
RPC fails.
This patch fixes the problem by doing a getsockname(2) of a socket mapped
to localhost to find out what the correct address is for the comparison
test with the upcall's from IP address.
This patch also adds INET6 support and the required #ifdef's for INET and
INET6. It now uses INET6 by default for the upcalls, if the kernel has
INET6 support and the daemon is also built with INET6 support.

git-svn-id: svn://svn.freebsd.org/base/stable/10@346467 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: r345992, r346087
rmacklem [Sun, 21 Apr 2019 01:15:54 +0000 (01:15 +0000)]
MFC: r345992, r346087
Add INET6 support for the upcalls to the nfsuserd daemon.

The kernel code uses UDP to do upcalls to the nfsuserd(8) daemon to get
updates to the username<->uid and groupname<->gid mappings.
A change to AF_LOCAL last year had to be reverted, since it could result
in vnode locking issues on the AF_LOCAL socket.
This patch adds INET6 support and the required #ifdef INET and INET6
to the code.

git-svn-id: svn://svn.freebsd.org/base/stable/10@346466 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: r345866
rmacklem [Thu, 18 Apr 2019 02:54:07 +0000 (02:54 +0000)]
MFC: r345866
Fix malloc stats for the RPCSEC_GSS server code when DEBUG is enabled.

The code enabled when "DEBUG" is defined uses mem_alloc(), which is a
malloc(.., M_RPC, M_WAITOK | M_ZERO), but then calls gss_release_buffer()
which does a free(.., M_GSSAPI) to free the memory.
This patch fixes the problem by replacing mem_alloc() with a
malloc(.., M_GSSAPI, M_WAITOK | M_ZERO).
This bug affects almost no one, since the sources are not normally built
with "DEBUG" defined.

git-svn-id: svn://svn.freebsd.org/base/stable/10@346344 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: r345818, r345828
rmacklem [Tue, 16 Apr 2019 02:48:04 +0000 (02:48 +0000)]
MFC: r345818, r345828
Fix a race in the RPCSEC_GSS server code that caused crashes.

When a new client structure was allocated, it was added to the list
so that it was visible to other threads before the expiry time was
initialized, with only a single reference count.
The caller would increment the reference count, but it was possible
for another thread to decrement the reference count to zero and free
the structure before the caller incremented the reference count.
This could occur because the expiry time was still set to zero when
the new client structure was inserted in the list and the list was
unlocked.

This patch fixes the race by initializing the reference count to two
and initializing all fields, including the expiry time, before inserting
it in the list.

git-svn-id: svn://svn.freebsd.org/base/stable/10@346262 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r345497:
mm [Wed, 10 Apr 2019 21:46:28 +0000 (21:46 +0000)]
MFC r345497:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #1153: fixed 2 bugs in ZIP reader [1]
  PR #1143: ensure archive_read_disk_entry_from_file() uses ARCHIVE_READ_DISK
  Changes to file flags code, support more file flags on FreeBSD:
    UF_OFFLINE, UF_READONLY, UF_SPARSE, UF_REPARSE, UF_SYSTEM
    UF_ARCHIVE is not supported by intention (yet)

PR: 236300 [1]

git-svn-id: svn://svn.freebsd.org/base/stable/10@346105 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r345499:
hselasky [Fri, 5 Apr 2019 11:35:58 +0000 (11:35 +0000)]
MFC r345499:
Change all kernel C-type macros into static inline functions.

The current kernel C-type macros might obscurely hide the fact that
the input argument might be used multiple times.

This breaks code like:
isalpha(*ptr++)

Use static inline functions instead of macros to fix this.

Reviewed by: kib @
Differential Revision: https://reviews.freebsd.org/D19694
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@345943 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r345359, r345384:
markj [Thu, 4 Apr 2019 02:08:36 +0000 (02:08 +0000)]
MFC r345359, r345384:
Don't attempt to measure TSC skew when running as a VM guest.

PR: 218452

git-svn-id: svn://svn.freebsd.org/base/stable/10@345869 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r345611:
rpokala [Wed, 3 Apr 2019 06:37:25 +0000 (06:37 +0000)]
MFC r345611:

Teach jedec_dimm(4) to be more forgiving of non-fatal errors.

It looks like some DIMMs claim to have a TSOD, but actually don't. Some
claim they weren't able to change the SPD page, but they did. Neither of
those should be fatal errors.

git-svn-id: svn://svn.freebsd.org/base/stable/10@345838 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f