summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-05-17arp(8): fixing the deletion failure of IEEE1394 associated addressesstable/10Tai-hwa Liang
Without this, 'arp -d ${IEEE1394_ADDRESS}' gives the following error: arp: delete: cannot locate 10.0.0.71 Reviewed by: glebius MFC after: 2 weeks (cherry picked from commit a0d6d0d0b9aba6d4c025b2f2807e7c4b4c4b2415)
2021-05-17if_firewire: fixing panic upon packet reception for VNET buildTai-hwa Liang
netisr_dispatch_src() needs valid VNET pointer or firewire_input() will panic when receiving a packet. Reviewed by: glebius MFC after: 2 weeks (cherry picked from commit d9b61e7153c64b141436b4d9619b166c6d35a0a6)
2021-04-15Avoid -pedantic warnings about using _Generic in __fp_type_selectDimitry Andric
When compiling parts of math.h with clang using a C standard before C11, and using -pedantic, it will result in warnings similar to: bug254714.c:5:11: warning: '_Generic' is a C11 extension [-Wc11-extensions] return !isfinite(1.0); ^ /usr/include/math.h:111:21: note: expanded from macro 'isfinite' ^ /usr/include/math.h:82:39: note: expanded from macro '__fp_type_select' ^ This is because the block that enables use of _Generic is conditional not only on C11, but also on whether the compiler advertises support for C generic selections via __has_extension(c_generic_selections). To work around the warning without having to pessimize the code, use the __extension__ keyword, which is supported by both clang and gcc. While here, remove the check for __clang__, as _Generic has been supported for a long time by gcc too now. Reported by: yuri PR: 254714
2021-04-01MFC 4e38478c595a:Hans Petter Selasky
ipoib: Fix incorrectly computed IPOIB_CM_RX_SG value. The computed IPOIB_CM_RX_SG is too small. It doesn't account for fallback to mbuf clusters when jumbo frames are not available and it also doesn't account for the packet header and trailer mbuf. This causes a memory overwrite situation when IPOIB_CM is configured. While at it add a kernel assert to ensure the mapping array is not overwritten. PR: 254474 Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 4e38478c595a9e6225b525890d7ee269a203c200)
2021-03-03MFC 12148d4300db:Hans Petter Selasky
Fix for locking order reversal in USB audio driver, when using mmap(). Locking the second lock which causes the LOR, can be skipped because the code updating the shared variables is always executing from the same USB thread. lock order reversal: 1st 0xfffff80005cc3840 pcm7:play:dsp7.p0 (pcm play channel, sleep mutex) @ usb_transfer.c:2342 2nd 0xfffff80005cc3860 pcm7:record:dsp7.r0 (pcm record channel, sleep mutex) @ uaudio.c:2317 lock order pcm record channel -> pcm play channel established at: witness_checkorder+0x461 __mtx_lock_flags+0x98 dsp_mmap_single+0x151 vm_mmap_cdev+0x65 devfs_mmap_f+0x143 kern_mmap_req+0x594 sys_mmap+0x46 amd64_syscall+0x12e fast_syscall_common+0xf8 lock order pcm play channel -> pcm record channel attempted at: witness_checkorder+0xd82 __mtx_lock_flags+0x98 uaudio_chan_play_callback+0xeb usbd_callback_wrapper+0x7ec usb_command_wrapper+0x7e usb_callback_proc+0x8e usb_process+0xf3 fork_exit+0x80 fork_trampoline+0xe Found by: Stefan Ehmann <shoesoft@gmx.net> Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 12148d4300dbbd93260bf2801cdb9eda8b3b05a4)
2021-03-03MFC 9febbc454190:Hans Petter Selasky
Fix for natd(8) sending wrong sequence number after TCP retransmission, terminating a TCP connection. If a TCP packet must be retransmitted and the data length has changed in the retransmitted packet, due to the internal workings of TCP, typically when ACK packets are lost, then there is a 30% chance that the logic in GetDeltaSeqOut() will find the correct length, which is the last length received. This can be explained as follows: If a "227 Entering Passive Mode" packet must be retransmittet and the length changes from 51 to 50 bytes, for example, then we have three cases for the list scan in GetDeltaSeqOut(), depending on how many prior packets were received modulus N_LINK_TCP_DATA=3: case 1: index 0: original packet 51 index 1: retransmitted packet 50 index 2: not relevant case 2: index 0: not relevant index 1: original packet 51 index 2: retransmitted packet 50 case 3: index 0: retransmitted packet 50 index 1: not relevant index 2: original packet 51 This patch simply changes the searching order for TCP packets, always starting at the last received packet instead of any received packet, in GetDeltaAckIn() and GetDeltaSeqOut(). Else no functional changes. Discussed with: rscheff@ Submitted by: Andreas Longwitz <longwitz@incore.de> PR: 230755 Sponsored by: Mellanox Technologies // NVIDIA Networking (cherry picked from commit 9febbc4541903bb8e6b0f1c84988c98b2f7c96ef)
2021-01-11contrib/libarchive: Import libarchive 3.5.1Martin Matuska
(cherry picked from commit 69a18c5826c9633a6d77e18f9f34e02c83d22717)
2021-01-11bsdcat,cpio,tar: derive version string from archive.hXin LI
(cherry picked from commit 2ff66a915526b6509ca57f2046bc7b20b0de8a61)
2020-12-16MFC r368207,368607:Martin Matuska
MFC r368207: Update libarchive to 3.5.0 Relevant vendor changes: Issue #1258: add archive_read_support_filter_by_code() PR #1347: mtree digest reader support Issue #1381: skip hardlinks pointing to itself on extraction PR #1387: fix writing of cpio archives with hardlinks without file type PR #1388: fix rdev field in cpio format for device nodes PR #1389: completed support for UTF-8 encoding conversion PR #1405: more formats in archive_read_support_format_by_code() PR #1408: fix uninitialized size in rar5_read_data PR #1409: system extended attribute support PR #1435: support for decompression of symbolic links in zipx archives Issue #1456: memory leak after unsuccessful archive_write_open_filename MFC r368607: Sync libarchive with vendor. Vendor changes: Issue #1461: Unbreak build without lzma Issue #1462: warc reader: Fix build with gcc11 Issue #1463: Fix code compatibility in test_archive_read_support.c Issue #1464: Use built-in strnlen on platforms where not available Issue #1465: warc reader: fix undefined behaviour in deconst() function Notes: svn path=/stable/10/; revision=368708
2020-12-10Fix bug in ifconfig regarding VLAN creation.Hans Petter Selasky
Detection of VLAN interface type must happen before detection of interface type by prefix. Else the following sequence of commands will try to create a LAGG interface instead of a VLAN interface, which accidentially works, because the data pointed to by the ifr_data pointer is not parsed by the VLAN create ioctl(2). How to reproduce: # ifconfig lagg0 create # ifconfig lagg0.256 create This is a direct commit. Differential Revision: https://reviews.freebsd.org/D27521 Tested by: raul.munoz@custos.es Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/stable/10/; revision=368505
2020-10-30MFC r367070:Cy Schubert
Remove a random equal sign from the example. It should not be there. It's a syntax error. PR: 210303 Reported by: leventelist at gmail.com Notes: svn path=/stable/10/; revision=367155
2020-10-18Correct location and date of the Boston Shoemakers' organization,Greg Lehey
which significantly predated the USA. Reference: http://www.famousdaily.com/history/boston-shoemakers-form-first-us-labor-organization.html Notes: svn path=/stable/10/; revision=366804
2020-08-10MFC r363988:Dimitry Andric
Fix clang 11 -Wformat warnings in yp_mkdb: usr.sbin/yp_mkdb/yp_mkdb.c:91:40: error: format specifies type 'char *' but the argument has type 'void *' [-Werror,-Wformat] printf("%.*s %.*s\n", (int)key.size, key.data, (int)data.size, ~~~~ ^~~~~~~~ usr.sbin/yp_mkdb/yp_mkdb.c:92:7: error: format specifies type 'char *' but the argument has type 'void *' [-Werror,-Wformat] data.data); ^~~~~~~~~ Notes: svn path=/stable/10/; revision=364084
2020-07-30MFC r363453:Cy Schubert
Document the IPFILTER_PREDEFINED environment variable. PR: 248088 Reported by: joeb1@a1poweruser.com Notes: svn path=/stable/10/; revision=363685
2020-06-30MFC r362623:Dimitry Andric
Fix copy/paste mistake in kvm_getswapinfo(3) It seems this manpage was copied from kvm_getloadavg(3), but the DIAGNOSTICS section was not updated completely. Update the section with correct information about a return value of -1. Notes: svn path=/stable/10/; revision=362800
2020-06-19MFC r362078:Ravi Pokala
Decode the "LACP Fast Timeout" LAGG option flag r286700 added the "lacp_fast_timeout" option to `ifconfig', but we forgot to include the new option in the string used to decode the option bits. Add "LACP_FAST_TIMO" to LAGG_OPT_BITS. Also, s/LAGG_OPT_LACP_TIMEOUT/LAGG_OPT_LACP_FAST_TIMO/g , to be clearer that the flag indicates "Fast Timeout" mode. Notes: svn path=/stable/10/; revision=362368
2020-06-18MFC r362045:Hans Petter Selasky
Make sure packets generated by raw IP code is let through by mlx5en(4). Allow the TCP header to reside in the mbuf following the IP header. Else such packets will get dropped. Backtrace: mlx5e_sq_xmit() mlx5e_xmit() ether_output_frame() ether_output() ip_output_send() ip_output() rip_output() sosend_generic() sosend() kern_sendit() sendit() sys_sendto() amd64_syscall() fast_syscall_common() Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=362313
2020-06-18MFC r362044:Hans Petter Selasky
Extend use of unlikely() in the fast path, in mlx5en(4). Typically the TCP/IP headers fit within the first mbuf and should not trigger any of the error cases. Use unlikely() for these cases. No functional change. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=362310
2020-06-18MFC r362043:Hans Petter Selasky
Use const keyword when parsing the TCP/IP header in the fast path in mlx5en(4). When parsing the TCP/IP header in the fast path, make it clear by using the const keyword, no fields are to be modified inside the transmitted packet. No functional change. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=362307
2020-06-16MFC r361977: libusb: improve compatibilityKyle Evans
Specifically, add LIBUSB_CLASS_PHYSICAL and the libusb_has_capability API. Descriptions and functionality for these derived from the documentation at [0]. The current set of capabilities are all supported by libusb. These were detected as missing after updating net/freerdp to 2.1.1, which attempted to use both. [0] http://libusb.sourceforge.net/api-1.0/group__libusb__misc.html Notes: svn path=/stable/10/; revision=362224
2020-06-14MFC r362056:Hans Petter Selasky
Add missing range checks when receiving USB ethernet packets. Found by: Ilja Van Sprundel, IOActive Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=362168
2020-06-12MFC r361294:Martin Matuska
Update libarchive to 3.4.3 Relevant vendor changes: PR #1352: support negative zstd compression levels PR #1359: improve zstd version checking PR #1348: support RHT.security.selinux from GNU tar PR #1357: support for archives compressed with pzstd PR #1367: fix issues in acl tests PR #1372: child handling cleanup PR #1378: fix memory leak from passphrase callback Notes: svn path=/stable/10/; revision=362134
2020-06-08MFC 361721:Cy Schubert
Per-rule hit counts (-h) can be used with either -i (input) or -o (output) filter rule lists. Notes: svn path=/stable/10/; revision=361928
2020-06-08MFC r361827:Hans Petter Selasky
USB HID descriptors may push/pop the current state to allow description of items residing in a so-called union. FreeBSD currently only supports 4 such push levels. If the push level is not restored within the processing of the same HID item, an invalid memory location may be used for subsequent HID item processing. Verify that the push level is always valid when processing HID items. Reported by: Andy Nguyen (Google) Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=361921
2020-06-08MFC r361582:Hans Petter Selasky
Fix check for wMaxPacketSize in USB bluetooth driver, in case device is not FULL speed. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=361916
2020-06-08MFC r361581:Hans Petter Selasky
Implement helper function, usbd_get_max_frame_length(), which allows kernel device drivers to correctly predict the default USB transfer frame length. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=361912
2020-06-08MFC r361577:Hans Petter Selasky
Don't allow USB device drivers to parent own interface. It will prevent proper USB device detach. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=361908
2020-05-22MFC r361075:Hans Petter Selasky
Assign process group of the TTY under the "proctree_lock". This fixes a race where concurrent calls to doenterpgrp() and leavepgrp() while TIOCSCTTY is executing may result in tp->t_pgrp changing value so that tty_rel_pgrp() misses clearing it to NULL. For more details refer to the use of pgdelete() in the kernel. No functional change intended. Panic backtrace: __mtx_lock_sleep() # page fault due to using destroyed mutex tty_signal_pgrp() tty_ioctl() ptsdev_ioctl() kern_ioctl() sys_ioctl() amd64_syscall() Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=361358
2020-05-18MFC r360092:Hans Petter Selasky
Bring HCI error messages up-to-date. See Bluetooth v5.6 core specification Vol.1 Part F: Controller error codes. Submitted by: Marc Veldman <marc@bumblingdork.com> PR: 245737 Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=361157
2020-05-18MFC r360070:Hans Petter Selasky
Add missing feature descriptions to hci_features2str(). The list of possible features in hccontrol/features2str() is incomplete. Refer to "Bluetooth Core Specification 5.2 Vol. 2 Part C. 3.3 Feature Mask Definition". Submitted by: Marc Veldman <marc@bumblingdork.com> PR: 245354 Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=361154
2020-05-01MFC r360322:Dimitry Andric
Fix race between prebuilding libsbuf and libgeom The latter needs the former, but with a multi-job build on a fast machine, the race is sometimes lost. This leads to "ld: error: unable to find library -lsbuf", when linking libgeom.so. Submitted by: kevans Notes: svn path=/stable/10/; revision=360542
2020-04-26Remove stray "DO NOT DELETE" line, which bmake apparently put in withoutDimitry Andric
my knowledge or consent. I did not intend to commit this. Notes: svn path=/stable/10/; revision=360340
2020-04-26Add casts to work around harmless -Werror warnings from clang 10.0.0,Dimitry Andric
such as: usr.sbin/timed/timed/networkdelta.c:160:13: error: implicit conversion from 'long' to 'float' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-int-float-conversion] float ap = LONG_MAX; /* bounds on the median */ ~~ ^~~~~~~~ Direct commit to stable/{10,11,12}, since timed has been removed from FreeBSD 13. Notes: svn path=/stable/10/; revision=360338
2020-04-26MFC r360075:Hans Petter Selasky
Set the maximum exit latency to 0 for XHCI USB 3.0 devices, because we don't implement link power management, LPM. This fixes error code XHCI_TRB_ERROR_BANDWIDTH for isochronous USB 3.0 transactions. Submitted by: Horse Ma <Shichun.Ma@dell.com> Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=360335
2020-04-26MFC r359968:Hans Petter Selasky
Cast all ioctl command arguments through uint32_t internally. Hide debug print showing use of sign extended ioctl command argument under INVARIANTS. The print is available to all and can easily fill up the logs. No functional change intended. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=360332
2020-04-25MFC r348282 (by lwhsu):Dimitry Andric
Remove an uneeded indentation introduced in r286196 to silence gcc warnging Sponsored by: The FreeBSD Foundation Notes: svn path=/stable/10/; revision=360326
2020-04-25MFC r348445 (by lwhsu):Dimitry Andric
Add the missing braces to fix the code not guarded by the if clause and has misleading indentation. This is found by gcc -Wmisleading-indentation Approved by: erj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20428 Notes: svn path=/stable/10/; revision=360304
2020-04-25Fix misleading indentation in sys/dev/drm2/radeon/evergreen.cDimitry Andric
This fixes the following warning from recent versions of clang and gcc: sys/dev/drm2/radeon/evergreen.c:554:4: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] Direct commit to stable/{10,11,12}, since this driver has been removed from FreeBSD 13. Notes: svn path=/stable/10/; revision=360303
2020-04-25MFC r354834 (by jhibbits):Dimitry Andric
bsnmp: Fix operator precedence in error check in table_check_response Summary: The ?: operator has a lower precedence than == and &&, so the result will always be recorded as true. Found by gcc8. Reviewed by: ngie, ae Differential Revision: https://reviews.freebsd.org/D22427 Notes: svn path=/stable/10/; revision=360301
2020-04-13MFC r359446:Hans Petter Selasky
Add support for multiple playback and recording devices per physical USB audio device. This requires some structural refactoring inside the driver, mostly about converting existing audio channel structures into arrays. The main audio mixer is provided by the first PCM instance. The non-first audio instances may only have a software mixer for PCM playback. Tested by: Horse Ma <Shichun.Ma@dell.com> Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=359890
2020-04-13MFC r359440:Hans Petter Selasky
Implement new mixer API to return the device pointer based on the mixer pointer. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=359887
2020-04-13MFC r359356:Hans Petter Selasky
Change default microphone level from 0 to 25. Discussed with: Horse Ma <Shichun.Ma@dell.com> Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=359884
2020-04-13MFC r359355:Hans Petter Selasky
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 Notes: svn path=/stable/10/; revision=359881
2020-04-13MFC r359323:Hans Petter Selasky
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 Notes: svn path=/stable/10/; revision=359878
2020-04-13MFC r359322:Hans Petter Selasky
Make mute controls available for USB audio mixers. Submitted by: Horse Ma <Shichun.Ma@dell.com> Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=359875
2020-04-13MFC r359321:Hans Petter Selasky
Factor out USB audio mixer value range check. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=359872
2020-04-13MFC r359320:Hans Petter Selasky
Avoid scaling USB audio mixer values twice. Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=359869
2020-04-13MFC r359653:Hans Petter Selasky
Count number of times transmit ring is out of buffers in mlx5en(4). Differential Revision: https://reviews.freebsd.org/D24273 Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=359855
2020-04-13MFC r359654:Hans Petter Selasky
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 Notes: svn path=/stable/10/; revision=359847
2020-03-26MFC r359120:Hans Petter Selasky
Correctly implement support for remote wakeup for USB 3.0 device. Submitted by: Horse Ma <Shichun.Ma@dell.com> Sponsored by: Mellanox Technologies Notes: svn path=/stable/10/; revision=359318