aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* MFC r362623:stable/8Dimitry Andric2020-06-301-2/+2
| | | | | | | | | | | 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/8/; revision=362800
* MFC r352710:Dimitry Andric2019-09-284-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/stable/8/; revision=352835
* MFC r338200: Adding device ID for Terratec SiXPack 5.1+.Tai-hwa Liang2018-12-261-0/+1
| | | | Notes: svn path=/stable/8/; revision=342468
* MFC r339582:Hans Petter Selasky2018-10-251-2/+15
| | | | | | | | | | | Drop sequencer mutex around uiomove() and make sure we don't move more bytes than is available, else a panic might happen. Found by: Peter Holm <peter@holm.cc> Sponsored by: Mellanox Technologies Notes: svn path=/stable/8/; revision=339723
* MFC r339581:Hans Petter Selasky2018-10-251-1/+1
| | | | | | | | | | Fix off-by-one which can lead to panics. Found by: Peter Holm <peter@holm.cc> Sponsored by: Mellanox Technologies Notes: svn path=/stable/8/; revision=339718
* MFC r309748 (by glebius):Dimitry Andric2018-09-181-0/+3
| | | | | | | | | | | | | | | | Treat R_X86_64_PLT32 relocs as R_X86_64_PC32. If we load a binary that is designed to be a library, it produces relocatable code via assembler directives in the assembly itself (rather than compiler options). This emits R_X86_64_PLT32 relocations, which are not handled by the kernel linker. Submitted by: gallatin Reviewed by: kib PR: 231451 Notes: svn path=/stable/8/; revision=338756
* MFC r338038: Extending the delay cycles to give the codec more time to pump ↵Tai-hwa Liang2018-08-261-1/+1
| | | | | | | | | | | | | | | | ADC data across the AC-link. Without this patch, some CS4614 cards will need users to reload the driver manually or the hardware won't be initialised properly. Something like: # kldload snd_csa # kldunload snd_csa # kldload snd_csa Tested with: Terratec SiXPack 5.1+ Notes: svn path=/stable/8/; revision=338328
* MFC r336438David C Somayajulu2018-08-091-13/+29
| | | | | | | | | | | | | Fixes for the following issues: 1. Fix taskqueues drain/free to fix panic seen when interface is being bought down and in parallel asynchronous link events happening. 2. Fix bxe_ifmedia_status() Submitted by:Vaishali.Kulkarni@cavium.com and Anand.Khoje@cavium.com Notes: svn path=/stable/8/; revision=337513
* MFC r333004David C Somayajulu2018-05-091-5/+5
| | | | | | | | | | | Fix Issue with adding MUltiCast Addresses. When multicast addresses are added/deleted, the delete the multicast addresses previously programmed in HW and reprogram the new set of multicast addresses. Submitted by: Vaishali.Kulkarni@cavium.com Notes: svn path=/stable/8/; revision=333437
* MFS: r295060, r296462, r296597-296598, r299053, r306229, r306335, r308200Jung-uk Kim2018-01-0430-499/+804
| | | | | | | | | | | | | | | | | | | | | | | | Sync. OpenSSL with stable/9. r295060 (delphij): Fix OpenSSL SSLv2 ciphersuite downgrade vulnerability. [SA-16:11] r296462, r296597-296598 (delphij): Fix multiple OpenSSL vulnerabilities. [SA-16:12] r299053 (delphij): Fix several OpenSSL vulnerabilities. [SA-16:17] r306229, r306335 (delphij): Fix multiple OpenSSL vulnerabilities. [SA-16:26] r308200 (delphij): Fix OpenSSL remote DoS vulnerability. [SA-16:35] Requested by: danfe Notes: svn path=/stable/8/; revision=327537
* Merge OpenSSL 0.9.8zh.Jung-uk Kim2018-01-04300-1858/+764
| | | | | | | Requested by: danfe Notes: svn path=/stable/8/; revision=327536
* MFC r301291:Alexey Dokuchaev2017-12-122-4/+11
| | | | | | | | | | | | | | | libiberty: prevent integer overflow. Take care of very old bug leading to heap-buffer overflow by processing certain file headers via bfd binary. PR: 200888 Obtained from: OpenBSD Approved by: pfg Notes: svn path=/stable/8/; revision=326795
* MFC r326362:Hans Petter Selasky2017-12-084-6/+22
| | | | | | | | | | | | | | Disallow TUN and TAP character device IOCTLs to modify the network device type to any value. This can cause page faults and panics due to accessing uninitialized fields in the "struct ifnet" which are specific to the network device type. Found by: jau@iki.fi PR: 223767 Sponsored by: Mellanox Technologies Notes: svn path=/stable/8/; revision=326694
* MFC r318860:Hans Petter Selasky2017-05-282-2/+6
| | | | | | | | Declare the "snd_fxdiv_table" once. This shaves around 24Kbytes of binary data from sound.ko and the kernel. Notes: svn path=/stable/8/; revision=319068
* MFC r318820:Hans Petter Selasky2017-05-272-7/+7
| | | | | | | | | | | | Increase the allowed maximum number of audio channels from 31 to 127 in the PCM feeder mixer. Without this change a value of 32 channels is treated like zero, due to using a mask of 0x1f, causing a kernel assert when trying to playback bitperfect 32-channel audio. Also update the AWK script which is generating the division tables to handle more than 18 channels. This commit complements r282650. Notes: svn path=/stable/8/; revision=318981
* MFC r317584:Hans Petter Selasky2017-05-161-1/+1
| | | | | | | Correct manual page link to usbdi(9). Notes: svn path=/stable/8/; revision=318339
* MFC r230208, r230252, r234346:Ian Lepore2017-05-062-4/+15
| | | | | | | | | | | | | | Add nfs export support to tmpfs(5) Return EOPNOTSUPP since we only support update mounts for NFS export. tmpfs: Allow update mounts only for certain options. Since r230208 update mounts were allowed if the list of mount options contained the "export" option. This is not correct as tmpfs doesn't really support updating all options. Notes: svn path=/stable/8/; revision=317883
* MFC r314365David C Somayajulu2017-03-245-86/+339
| | | | | | | | | | | | | | 1. state checks in bxe_tx_mq_start_locked() and bxe_tx_mq_start() to sync threads during interface down or detach. 2. add sysctl to set pause frame parameters 3. increase max segs for TSO packets to BXE_TSO_MAX_SEGMENTS (32) 4. add debug messages for PHY 5. HW LRO support restricted to FreeBSD versions 8.x and above. Submitted by: Vaishali.Kulkarni@cavium.com Notes: svn path=/stable/8/; revision=315884
* MFC r314328:Hans Petter Selasky2017-03-141-5/+29
| | | | | | | | | | | | | | | | Fix startup race initialising ACPI CM battery structures on MacBookPro. During acpi_cmbat_attach() the acpi_cmbat_init_battery() notification handler is registered. It has been observed this notification handler can be called instantly, before the attach routine has returned. In the notification handler there is a call to device_is_attached() which returns false. Because the softc is set we know an attach is in progress and the fix is simply to wait and try again in this case. Reviewed by: avg @ Notes: svn path=/stable/8/; revision=315266
* MFC r313941:Hans Petter Selasky2017-03-141-0/+9
| | | | | | | | | | | | | | | | | | | | | Make sure the thread constructor and destructor eventhandlers are called for all threads belonging to a procedure. Currently the first thread in a procedure is kept around as an optimisation step and is never freed. Because the first thread in a procedure is never freed nor allocated, its destructor and constructor callbacks are never called which means per thread structures allocated by dtrace and the Linux emulation layers for example, might be present for threads which don't need these structures. This patch adds a thread construction and destruction call for the first thread in a procedure. Tested: dtrace, linux emulation Reviewed by: kib @ Sponsored by: Mellanox Technologies Notes: svn path=/stable/8/; revision=315262
* MFC r314572:Martin Matuska2017-03-051-0/+3
| | | | | | | | | | Fix null pointer dereference in zfs_freebsd_setacl(). Prevents unprivileged users from panicking the kernel by calling __acl_delete_*() on files or directories inside a ZFS mount. Notes: svn path=/stable/8/; revision=314713
* MFC r309400:Hans Petter Selasky2016-12-191-9/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix for endless recursion in the ACPI GPE handler during boot. When handling a GPE ACPI interrupt object the EcSpaceHandler() function can be called which checks the EC_EVENT_SCI bit and then recurse on the EcGpeQueryHandler() function. If there are multiple GPE events pending the EC_EVENT_SCI bit will be set at the next call to EcSpaceHandler() causing it to recurse again via the EcGpeQueryHandler() function. This leads to a slow never ending recursion during boot which prevents proper system startup, because the EC_EVENT_SCI bit never gets cleared in this scenario. The behaviour is reproducible with the ALASKA AMI in combination with a newer Skylake based mainboard in the following way: Enter BIOS and adjust the clock one hour forward. Save and exit the BIOS. System fails to boot due to the above mentioned bug in EcGpeQueryHandler() which was observed recursing multiple times. This patch adds a simple recursion guard to the EcGpeQueryHandler() function and also also adds logic to detect if new GPE events occurred during the execution of EcGpeQueryHandler() and then loop on this function instead of recursing. Reviewed by: jhb Notes: svn path=/stable/8/; revision=310256
* MFC r308437 and r308461:Hans Petter Selasky2016-11-121-2/+16
| | | | | | | | | | | | | | Range check the jitter values to avoid bogus sample rate adjustments. The expected deviation should not be more than 1Hz per second. The USB v2.0 specification also mandates this requirement. Refer to chapter 5.12.4.2 about feedback. Allow higher sample rates to have more jitter than lower ones. PR: 208791 Notes: svn path=/stable/8/; revision=308574
* MFC r307518:Hans Petter Selasky2016-11-0716-86/+7
| | | | | | | | | | | | | | | | | | | | | | | | Fix device delete child function. When detaching device trees parent devices must be detached prior to detaching its children. This is because parent devices can have pointers to the child devices in their softcs which are not invalidated by device_delete_child(). This can cause use after free issues and panic(). Device drivers implementing trees, must ensure its detach function detaches or deletes all its children before returning. While at it remove now redundant device_detach() calls before device_delete_child() and device_delete_children(), mostly in the USB controller drivers. Tested by: Jan Henrik Sylvester <me@janh.de> Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D8070 Notes: svn path=/stable/8/; revision=308404
* MFC r308144 and r308165:Hans Petter Selasky2016-11-071-3/+9
| | | | | | | | | | | | | | | | Fixes for virtual T-axis buttons. Make sure the virtual T-axis buttons gets cleared for USB mice which has less than 6 buttons. Make sure the virtual T-axis buttons generate button release event(s) for continuous tilting. PR: 213919 PR: 213957 Notes: svn path=/stable/8/; revision=308397
* MFC r306478:Hans Petter Selasky2016-10-102-5/+7
| | | | | | | | | | | | Add new USB ID. While at it remove some whitespaces. Submitted by: Jose Luis Duran <jlduran@gmail.com> PR: 213110 Notes: svn path=/stable/8/; revision=306959
* MFC r305590:Hans Petter Selasky2016-09-151-2/+2
| | | | | | | | | | | Correctly map the USB mouse tilt delta values into buttons 5 and 6 instead of 3 and 4 which is used for the scroll wheel, according to X.org. PR: 170358 Notes: svn path=/stable/8/; revision=305831
* MFC r305421:Hans Petter Selasky2016-09-128-28/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | Resolve deadlock between device_detach() and usbd_do_request_flags() by reviving the SX control request lock and refining which lock protects the common scratch area in "struct usb_device". The SX control request lock was removed by r246759 because it caused a lock order reversal with the USB enumeration lock inside usbd_transfer_setup() as a function of r246616. It was thought that reducing the number of locks would resolve the LOR, but because some USB device drivers use usbd_do_request_flags() inside callback functions, like in taskqueues, a deadlock may occur when these are drained from device_detach(). By restoring the SX control request lock usbd_do_request_flags() is allowed to complete its execution when a USB device driver is detaching. By using the SX control request lock to protect the scratch area, the LOR introduced by r246616 is also resolved. Bump the FreeBSD version while at it to force recompilation of all USB kernel modules. Found by: avos@ Notes: svn path=/stable/8/; revision=305736
* MFC r303765 and r304571:Hans Petter Selasky2016-09-091-7/+47
| | | | | | | | | | | | | | | Keep a reference count on USB keyboard polling to allow recursive cngrab() during a panic for example, similar to what the AT-keyboard driver is doing. Make the UKBD USB transfers double buffered and set them up one by one, so they are memory independent which allows for handling panics triggered by the keyboard driver itself, typically via CTRL+ALT+ESC sequences. Or if the USB keyboard driver was processing a key at the moment of panic. Allow UKBD to be attached while keyboard polling is active. Notes: svn path=/stable/8/; revision=305647
* MFC r305284:Hans Petter Selasky2016-09-091-2/+13
| | | | | | | | | | Fix array size issue when using the pre-scaling feature for ISOCHRONOUS USB transfers. Make sure enough length and buffer pointers are allocated when setting up the libusb transfer structure to support the maximum number of frames the kernel can handle. Notes: svn path=/stable/8/; revision=305643
* MFC r304629:Hans Petter Selasky2016-08-291-0/+4
| | | | | | | | | | | | | Don't separate the status stage of the XHCI USB control transfers into its own job because this breaks the simplified QEMU XHCI TRB parser, which expects the complete USB control transfer as a series of back to back TRBs. The old behaviour is kept under #ifdef in case this change breaks enumeration of any USB devices. PR: 212021 Notes: svn path=/stable/8/; revision=305001
* MFC r304597:Hans Petter Selasky2016-08-291-6/+8
| | | | | | | | | | | | | Fix for invalid use of bits in input context. Basically split configuring of EP0 and non-EP0 into xhci_cmd_evaluate_ctx() and xhci_cmd_configure_ep() respectivly. This resolves some errors when using XHCI under QEMU and gets is more in line with the XHCI specification. PR: 212021 Notes: svn path=/stable/8/; revision=304995
* MFC 298950: Fix an off by one error when remapping MSI-X vectors.John Baldwin2016-08-201-2/+2
| | | | | | | | | | | pci_remap_msix() can be used to alter the mapping of allocated MSI-X vectors to the MSI-X table. The code had an off by one error when adding the IRQ resources after performing a remap. This was fatal for any vectors in the table that used the "last" valid IRQ as those vectors were assigned a garbage IRQ value. Notes: svn path=/stable/8/; revision=304511
* MFC r302371:Hans Petter Selasky2016-08-121-1/+1
| | | | | | | | Fix regression issue with XHCI on 32-bit ARMv7 Armada-38x. Make sure "struct xhci_dev_ctx_addr" fits into a single 4K page until further. Notes: svn path=/stable/8/; revision=303999
* MFC r301039:Hans Petter Selasky2016-08-121-3/+19
| | | | | | | | | | | Add support for simplex USB MIDI devices, which only provide BULK or INTERRUPT endpoints for moving data in one direction, like the KeyRig 49 from M-Audio. Requested by: Ivan Klymenko <fidaj@ukr.net> Notes: svn path=/stable/8/; revision=303995
* MFC r301842:Hans Petter Selasky2016-06-291-2/+14
| | | | | | | | | | | Implement code to stop all USB endpoints before executing a USB device reset command, alternate setting command or set configuration command. Else LibUSB v1.0 will not re-open the endpoints which the kernel closes and the USB application might wait infinitely for transfers to complete. Notes: svn path=/stable/8/; revision=302274
* MFC r302076:Hans Petter Selasky2016-06-293-7/+8
| | | | | | | | | | | Update the definition for number of scratch pages to match the latest version of the XHCI specification. Make sure the code can handle the maximum number of allowed scratch pages. Submitted by: Shichun_Ma@Dell.com Notes: svn path=/stable/8/; revision=302268
* MFC r300667:Hans Petter Selasky2016-06-033-2/+32
| | | | | | | | | Check for signals when locking the USB enumeration thread from userspace, so that USB applications can be killed if an enumeration thread should be stuck for various reasons. Notes: svn path=/stable/8/; revision=301255
* MFC r299060:Hans Petter Selasky2016-06-031-1/+3
| | | | | | | | | Extend the UQ_NO_STRINGS quirk to also cover the USB language string descriptor. This fixes enumeration of some older Samsung Galaxy S3 phones. Notes: svn path=/stable/8/; revision=301252
* MFC 299310:John Baldwin2016-05-241-2/+2
| | | | | | | | | | | | | Don't store generated firmware object files in the source directory. Trim the leading directory of a firmware source file from the resulting target object file name so the object file is stored in the object directory. Previously, using 'FIRMWS= /path/to/fw.bin:fw.bin' would store the generated 'fw.bin.fwo' file in the /path/to directory. Now it stores it in the object directory of the kernel module being built. Notes: svn path=/stable/8/; revision=300629
* MFC r298591David C Somayajulu2016-05-102-3/+2
| | | | | | | | 1. Removed -Wno-shift-negative-value from Makefile 2. Fixed warning its absence caused in bxe_elink.c Notes: svn path=/stable/8/; revision=299305
* MFC r298496David C Somayajulu2016-05-101-141/+0
| | | | | | | Remove Unused/Dead Code Notes: svn path=/stable/8/; revision=299304
* MFC r298294David C Somayajulu2016-05-103-67/+169
| | | | | | | | | | | | | | 1. modify fwdump (a.k.a grcdump) so that grcdump memory is allocated and freed on as needed basis. 2. grcdump can be taken at failure points by invoking bxe_grc_dump() when trigger_grcdump sysctl flag is set. When grcdump is taken grcdump_done sysctl flag is set. 3. grcdump_done can be monitored by the user to retrieve the grcdump Submitted by:vaishali.kulkarni@qlogic.com Notes: svn path=/stable/8/; revision=299303
* MFC r270256, r298640:Alexey Dokuchaev2016-04-291-2/+2
| | | | | | | | | ed(1): switch two statements so we check the index before dereferencing. Approved by: pfg Notes: svn path=/stable/8/; revision=298785
* MFC r297884David C Somayajulu2016-04-193-5/+400
| | | | | | | | | Add support for Flash Update Submitted by:nrapendra.singh@qlogic.com;vaishali.kulkarni@qlogic.com;davidcs@freebsd.org Notes: svn path=/stable/8/; revision=298289
* MFC r297873David C Somayajulu2016-04-192-23/+63
| | | | | | | | | | | | 1. Process tx completions in bxe_periodic_callout_func() and restart transmissions if possible. 2. For SIOCSIFFLAGS call bxe_init_locked() only if !BXE_STATE_DISABLED 3. remove code not needed in bxe_init_internal_common() Submitted by:vaishali.kulkarni@qlogic.com;venkata.bhavaraju@qlogic.com Notes: svn path=/stable/8/; revision=298287
* MFC r296342:Hans Petter Selasky2016-04-071-2/+0
| | | | | | | | | | 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. Notes: svn path=/stable/8/; revision=297644
* MFC r297155David C Somayajulu2016-04-062-22/+68
| | | | | | | Modifications to achieve a common source base from FreeBSD7.x thru 10.x Notes: svn path=/stable/8/; revision=297624
* When building on a newer host, boostrap using lex from the stable-8 sourceIan Lepore2016-03-151-0/+1
| | | | | | | | | | | | | to match the yacc being used from that source. This avoids a build error caused by the newer lex emitting a yylex() decl that's already in the source. This is a direct commit to stable-8; there is no corresponding change in later branches to MFC from. For the record, the new lex came in at version 1000032, but slipping it into the 1000013 block makes more sense than creating a whole new .if block for it. Notes: svn path=/stable/8/; revision=296888
* MFC r206424: (by rdivacky in 2010)Ian Lepore2016-03-153-7/+7
| | | | | | | | | | | | | | | | Rename the ALIGN macro to LINT_ALIGN so it does not clash with machine/param.h Bump the alignment to 16bytes because lint1 memory allocator is used for objects that require 16bytes alignment on amd64 (ie. val_t). This makes lint1 work when compiled with compiler(s) that use SSE for memcpy on amd64. (e.g. clang). This allows me to compile stable-8 on a 64-bit build host running 10-stable, without dying during the xlint build. It should work fine on 11-current too. Notes: svn path=/stable/8/; revision=296887