Commit Graph

196840 Commits

Author SHA1 Message Date
Martin Matuska
42efdf8868 MFC r344063,r344088:
MFC r344063:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #1085: Fix a null pointer dereference bug in zip writer
  PR #1110: ZIP reader added support for XZ, LZMA, PPMD8 and BZIP2
            decopmpression
  PR #1116: Add support for 64-bit ar format
  PR #1120: Fix a 7zip crash [1] and a ISO9660 infinite loop [2]
  PR #1125: RAR5 reader - fix an invalid read and a memory leak
  PR #1131: POSIX reader - do not fail when tree_current_lstat() fails
            due to ENOENT [3]
  PR #1134: Delete unnecessary null pointer checks before calls of free()
  OSS-Fuzz 10843: Force intermediate to uint64_t to make UBSAN happy.
  OSS-Fuzz 11011: Avoid buffer overflow in rar5 reader

MFC r344088:
  archive_read_disk_posix.c: initialize delayed_errno

PR:		233006 [3]
Security:	CVE-2019-1000019 [1], CVE-2019-1000020 [2]
2019-02-28 22:57:09 +00:00
David Bright
b82d523565 MFC r344473:
CID 1332000: Logically dead code in sys/dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c

A pointer is first tested for NULL. If non-NULL, another pointer is
set equal to the first. The second pointer is then checked for NULL
and an error path taken if so. This second test and the associated
path is dead code as the pointer value, having just been checked for
NULL, cannot be NULL at this point. Remove the dead code.

Sponsored by:	Dell EMC Isilon
2019-02-27 22:29:37 +00:00
Andriy Voskoboinyk
9ae23c37e6 MFC r344198:
GC ATA_REQUEST_TIMEOUT option remnants

It was removed from code in r249083 and from sys/conf/options in r249213.

PR:		193935, 222170
2019-02-21 09:54:57 +00:00
David Bright
726c292d34 MFC r344024:
CID 1009492: Logically dead code in sys/cam/scsi/scsi_xpt.c

In `probedone()`, for the `PROBE_REPORT_LUNS` case, all paths that
fall to the bottom of the case set `lp` to `NULL`, so the test for a
non-NULL value of `lp` and call to `free()` if true is dead code as
the test can never be true. Fix by eliminating the whole if
statement. To guard against a possible future change that accidentally
violates this assumption, use a `KASSERT()` to catch if `lp` is
non-NULL.

Sponsored by:	Dell EMC Isilon
2019-02-20 22:49:09 +00:00
Andriy Voskoboinyk
53f5c5a262 MFC r343501:
Add NO_6_BYTE / NO_SYNC_CACHE quirks for (C|D|E).* Olympus digital cameras

PR:		97472
Submitted by:	Fabio Luis Girardi <papelhigienico@gmail.com>
Reviewed by:	imp
2019-02-17 02:58:44 +00:00
Andriy Voskoboinyk
a658d1b889 MFC r343980:
ifconfig(8): display 802.11n rates correctly for 'roam:rate' parameter
2019-02-16 01:05:22 +00:00
Andriy Voskoboinyk
737bef022c MFC r343909:
newkey(8): fix 'tmpname' memory leak (always) and input file descriptor leak
when output file cannot be opened

PR:		201732
Reported by:	David Binderman <dcb314@hotmail.com>
2019-02-16 00:37:08 +00:00
Hans Petter Selasky
f83e5ba607 MFC r343905:
Improve Bluetooth device discovery support for Android and Microsoft devices.

Tested using the virtual_bt_speaker(8) tool from the virtual_oss(8)
project at github.com.

PR:			210089
Sponsored by:		Mellanox Technologies
2019-02-15 09:22:23 +00:00
Cy Schubert
2f0b37465d MFC r343591:
Do not obtain an already held read lock. This causes a witness panic when
ipfs is invoked. This is the second of two panics resolving PR 235110.

PR:		235110
Reported by:	David.Boyd49@twc.com
2019-02-14 00:52:03 +00:00
Andriy Voskoboinyk
19b7e9b2eb MFC r343871:
recoverdisk(1): fclose() file supplied via '-r readlist' parameter when
it's no longer needed

PR:		204952
Reported by:	David Binderman <dcb314@hotmail.com>
2019-02-13 09:28:48 +00:00
Andriy Voskoboinyk
75496dd965 MFC r343870:
ipcs(1): drop obsolete error checking

This code is unreachable since r77551.

PR:		201728
2019-02-12 07:03:37 +00:00
Andriy Voskoboinyk
251ef7900d MFC r343698, r343700:
ifconfig(8): display management / multicast wlan(4) rates properly

For 11n / 11ac we are still using non-11n rates for management and
multicast traffic by default; check 'MCS rate' bit to determine how
to print them correctly.

PR:		161035
2019-02-10 20:42:06 +00:00
Andriy Voskoboinyk
5009172724 MFC r343837:
net80211(4): validate supplied roam:rate values from ifconfig(8)
2019-02-10 20:26:12 +00:00
Andriy Voskoboinyk
75988fabe0 MFC r343604:
bwn(4): reuse ieee80211_tx_complete function
2019-02-08 14:32:27 +00:00
Andriy Voskoboinyk
a11b7e786b MFC r343603:
ipw(4): reuse ieee80211_tx_complete function

This should partially fix 'netstat -b -I wlan0' output
2019-02-08 13:57:28 +00:00
Hans Petter Selasky
c041e9605c MFC r343572:
Add support for Audio Sink and Audio Source profiles to sdpd(8).

This allows user-space programs like virtual_oss(8) to act
as a Bluetooth speaker device.

Sponsored by:		Mellanox Technologies
2019-02-08 10:28:13 +00:00
Andriy Voskoboinyk
d848e0f9f0 MFC r343683:
Do not acquire IEEE80211_LOCK twice in cac_timeout(); reuse
locked function instead.

It is externally visible since r257065.
2019-02-08 04:48:12 +00:00
Bryan Drewery
ee6d36d2b6 MFC r337272:
Fix some filemon path logging issues.
2019-02-07 23:57:28 +00:00
Bryan Drewery
79973f6364 MFC r343633:
Shar files may be seen as binary by grep.
2019-02-07 21:37:06 +00:00
Andriy Voskoboinyk
ffb22e4bfe MFC r343682:
sys/dev/wtap: Check return value from malloc(..., M_NOWAIT) and
drop unneeded cast.
2019-02-06 02:35:56 +00:00
Andriy Voskoboinyk
67741ae5d2 MFC r343681:
run(4): fix allocated memory type for ieee80211_node(4)

PR:		177366
2019-02-06 02:18:11 +00:00
Andriy Voskoboinyk
035ec4b4cd MFC r343574:
Fix compilation with 'option NDISAPI + device ndis' and
without 'device pccard' in the kernel config file.

PR:		171532
Reported by:	Robert Bonomi <bonomi@host128.r-bonomi.com>
2019-02-06 02:07:37 +00:00
Andriy Voskoboinyk
b4274b1660 MFC r343697:
net80211(4): fix rate check when 'roaming' ifconfig(8) option is set to 'auto'

Do not try to clear 'basic rate' bit from roamRate; it cannot be here and,
actually, this operation clears 'MCS rate' bit instead, breaking comparison
for 11n / 11ac modes.
2019-02-06 01:53:01 +00:00
Andriy Voskoboinyk
1016d958e0 MFC r343542:
upgt(4): unbreak build with UPGT_DEBUG
2019-02-06 01:42:26 +00:00
Andriy Voskoboinyk
08bba2c35a MFC r343541:
Drop some unneeded includes from wireless USB drivers.
2019-02-05 03:01:10 +00:00
Andriy Voskoboinyk
719a6c1e73 MFC r343576:
ndiscvt(8): abort if no IDs were found during conversion.

PR:		69268
Submitted by:	<darius@dons.net.au>
2019-02-04 03:44:07 +00:00
Cy Schubert
adf0e8f860 MFC r343600:
Document the instance context pointer.
2019-02-03 00:36:12 +00:00
Andriy Voskoboinyk
ab9314d4a8 MFC r343502:
Remove RADIUS-related files when WITHOUT_RADIUS_SUPPORT=true is set
in src.conf(5)

PR:		234041
2019-02-02 16:57:49 +00:00
Hans Petter Selasky
8da73091b3 MFC r343453:
Add new USB quirk.

PR:			235202
Differential Revision:	https://reviews.freebsd.org/D18917
Sponsored by:		Mellanox Technologies
2019-02-01 10:09:54 +00:00
Andriy Voskoboinyk
b5a8d779b9 MFC r343496:
pcf(4): fix parentheses in if condition

PR:		210709
Submitted by:	David Binderman <dcb314@hotmail.com>
2019-02-01 03:26:10 +00:00
Andriy Voskoboinyk
3ea7774c65 MFC r343495:
wlan.4: improve wording

PR:		218075
Submitted by:	Aaron Taylor <halfnote1004@gmail.com>
2019-02-01 02:43:13 +00:00
Andriy Voskoboinyk
1ef2c160ee MFC r343473:
geom_uzip(4): move NULL pointer KASSERT check before it is dereferenced

PR:		203499
Submitted by:	<chadf@triularity.org>

MFC r343475:
geom_uzip(4): set 'gp != NULL' assertion on top of the function

There was yet another access to this variable in g_trace() few
lines upper.

PR:		203499
Reported by:	cem
2019-01-31 11:36:28 +00:00
Cy Schubert
d1ece82051 MFC r343486:
Fix a typo.
2019-01-30 02:39:08 +00:00
Andriy Voskoboinyk
3b390ad105 MFC r343341:
ifconfig: drop unused macros from ifieee80211.c
2019-01-28 00:51:26 +00:00
Marius Strobl
6373632dd0 MFC: r342634 (partial)
o Don't allocate resources for SDMA in sdhci(4) if the controller or the
  front-end doesn't support SDMA or the latter implements a platform-
  specific transfer method instead. While at it, factor out allocation
  and freeing of SDMA resources to sdhci_dma_{alloc,free}() in order to
  keep the code more readable when adding support for ADMA variants.

o Base the size of the SDMA bounce buffer on MAXPHYS up to the maximum
  of 512 KiB instead of using a fixed 4-KiB-buffer. With the default
  MAXPHYS of 128 KiB and depending on the controller and medium, this
  reduces the number of SDHCI interrupts by a factor of ~16 to ~32 on
  sequential reads while an increase of throughput of up to ~84 % was
  seen.

  Front-ends for broken controllers that only support an SDMA buffer
  boundary of a specific size may set SDHCI_QUIRK_BROKEN_SDMA_BOUNDARY
  and supply a size via struct sdhci_slot. According to Linux, only -
  unsupported in stable/10 anyway - Qualcomm MSM-type SDHCI controllers
  are affected by this, though.

  Requested by: Shreyank Amartya (unconditional bump to 512 KiB)

o Introduce a SDHCI_DEPEND macro for specifying the dependency of the
  front-end modules on the sdhci(4) one and bump the module version
  of sdhci(4) to 2 via an also newly introduced SDHCI_VERSION in order
  to ensure that all components are in sync WRT struct sdhci_slot.

o In sdhci(4):
  - Make pointers const were applicable, and
  - replace a few device_printf(9) calls with slot_printf() for
    consistency.
2019-01-27 19:05:18 +00:00
Andriy Voskoboinyk
620c830265 MFC r343190:
net80211: drop m_pullup call from ieee80211_crypto_decap.

For most wireless drivers Rx mbuf is allocated as one
contiguous chunk; only few are using chains for allocations -
but even then at least MCLBYTES (minus Rx descriptor size) is
available in the first mbuf.

In addition to the above, m_pullup was never called here - otherwise,
reallocation will break post-crypto_decap logic (ieee80211_decap,
ieee80211_deliver_data...), so just remove it; length check is left
in case if some truncated frame appears here.

PR:		234241
2019-01-26 12:41:16 +00:00
Cy Schubert
b69546edea MFC r343103:
Remove redundant ipfilter version of pcap-bpf.h. As of r214535 it was
no longer needed.
2019-01-23 02:43:49 +00:00
Cy Schubert
5ac1c8e14e MFC r343073:
Remove an IRIX-only source file.
2019-01-23 02:40:29 +00:00
Rodney W. Grimes
78b4ca619f MFC: 325765 (imp) Add notes about overlapping copies.
Add notes to each of these that specifically state that results are
undefined if the strings overlap. In the case of memcpy, we document
the overlapping behavior on FreeBSD (pre-existing). For str*, it is
left unspecified, however, since the default (and x86) implementations
do not handle overlapping strings properly.

PR: 223653
Approved by:	phk (mentor)
2019-01-22 21:52:07 +00:00
Pedro F. Giffuni
cbabf0751d MFC r343023:
msun: reduce diff between src/e_j0.c and src/e_j0f.c

PR:	229501
2019-01-21 14:55:10 +00:00
Joerg Wunsch
9caf9f83b8 MFC r342791: fix a typo in chio(4) (which propagates into chio(1)) 2019-01-20 21:49:13 +00:00
Hans Petter Selasky
4170992769 MFC r342884:
Fix loopback traffic when using non-lo0 link local IPv6 addresses.

The loopback interface can only receive packets with a single scope ID,
namely the scope ID of the loopback interface itself. To mitigate this
packets which use the scope ID are appearing as received by the real
network interface, see "origifp" in the patch. The current code would
drop packets which are designated for loopback which use a link-local
scope ID in the destination address or source address, because they
won't match the lo0's scope ID. To fix this restore the network
interface pointer from the scope ID in the destination address for
the problematic cases. See comments added in patch for a more detailed
description.

This issue was introduced with route caching by karels@ .

Reviewed by:		bz (network)
Differential Revision:	https://reviews.freebsd.org/D18769
Sponsored by:		Mellanox Technologies
2019-01-18 08:59:00 +00:00
Hans Petter Selasky
9d1ff4df70 MFC r342778:
Reduce timeout for reading the USB HUB port status to 1000ms and try to filter
out dead USB HUB devices by implementing an error counter, so that the USB
enumeration thread does not spend all its time reading from non-responding
devices, blocking user-space access in the end.

Tested by:	Matthias Apitz <guru@unixarea.de>
Sponsored by:	Mellanox Technologies
2019-01-18 08:49:10 +00:00
Hans Petter Selasky
e264efd0ee MFC r342730:
Improve USB generic debug messages. Print process ID and name when opening
and closing usb/ugenX.Y character device nodes.

Sponsored by:	Mellanox Technologies
2019-01-18 08:45:56 +00:00
Ed Maste
e49e325d07 MFC r343043: scp: disallow empty or current directory
Obtained from:	OpenBSD scp.c 1.198
Security:	CVE-2018-20685
Sponsored by:	The FreeBSD Foundation
2019-01-16 15:19:09 +00:00
Andriy Voskoboinyk
7b4a785027 MFC r342966:
net80211: fix possible panic for some drivers after r342465

Check if rate control structures were allocated before trying to
access them in various places; this was possible before on
allocation failure (unlikely), but was revealed after r342211
where allocation was deferred.

The patch was adjusted a bit since file contents are different enough
since r306591.

Also, 'rate_stats' sysctl is not available here, so the panic is
unlikely to happen here even without this patch.
2019-01-15 02:26:03 +00:00
Andriy Voskoboinyk
f07b3a7049 MFC r342810:
powerd(8): allow to force a method of battery state query

This change allows to determine power source via sysctl or /dev/apm
when devd(8) is running (used by default).

Based on patch from PR; other changes on top of it:
- '-f' (force) -> '-s' (source) parameter renaming;
- allow 'apm' -> 'devd' transition when '-s devd' is set
(if APM is enabled);
- man page update.

PR:		125707
Submitted by:	Konstantin Stepanov <milezv@yandex.ru>
Reviewed by:	bcr, imp
Differential Revision:	https://reviews.freebsd.org/D18742
2019-01-13 02:27:10 +00:00
Cy Schubert
ca266105b5 MFC r342605:
TCP_PAWS_IDLE is does not exist in NetBSD and illumos. In FreeBSD
TCP_PAWS_IDLE is defined in netinet/tcp_seq.h, however this header
isn't included explicitly or implicitly at this point therefore
as far ipfilter is concerned TCP_PAWS_IDLE is not defined. Remove
the #ifdef and include netinet/tcp.h unconditionally.
2019-01-06 00:32:14 +00:00
Marius Strobl
ad1a70e2df MFC: r336610 (partial), r339207, r339267
- Or in the DMA coalescing Rx threshold so the other bits set in E1000_DMACR
  remain intact as intended in igb_init_dmac(). [1]

- Fix igb corrupting checksums with BPF and VLAN
  In stable/11, this merely syncs the code with head as the problem was
  introduced with r311849 in the latter and then fixed by r339207 with
  a different approach than the code used pre-r311849 and in stable/11.

- Use mbuf defines to construct csum offload masks rather than literals

MF11: r340148

Don't use 9k jumbo clusters

Reported by:	Coverity
CID:		1304929 [1]
2019-01-05 19:35:10 +00:00
Hans Petter Selasky
3604972f42 MFC r342549:
Add USB quirk for SPL Crimson Rev 1.

PR:			234380
Sponsored by:		Mellanox Technologies
2019-01-03 09:28:18 +00:00