270660 Commits

Author SHA1 Message Date
kamil
1f257ef9aa Merge PT_GET_PROCESS_STATE checks into traceme_raise ATF ptrace tests
Assert that PT_GET_PROCESS_STATE for !child and !lwp events returns
non-error and zeroed struct ptrace_state.

These checks are not really special to traceme_raise, it's just an
opportunity to reuse them in an existing tests without writing a dedicated
one.

This behavior is needed to maintain in 3rd party software (GDB).
2019-10-01 22:26:38 +00:00
kamil
2f629ee89a Remove 2 static asserts from the kernel ptrace code
sizeof(pid) and sizeof(lwp) will unlikely ever change and the check can
confuse.

The assert has been moved to ATF t_ptrace_wait.c r.1.132.

Requested by <christos>
2019-10-01 21:49:50 +00:00
christos
8edcd49088 grr forgot one libpcap. 2019-10-01 21:36:54 +00:00
mrg
251c9c162b merge debug/file prefix/merge stuff with upstream, which has gained
a lot of the same features.  builds, but may not actually run right.
adjust for add_path()'s SYSTEM -> INC_SYSTEM.
2019-10-01 21:17:27 +00:00
mrg
ee69d28dd0 final GCC 8.3 sanitizer merge, untested. 2019-10-01 21:13:43 +00:00
kamil
b0c977dcb4 Add a few static asserts in t_ptrace_wait.c for conditions that must be kept
Assert that ptrace_state and siginfo_t's _ptrace_state are synchronized.
2019-10-01 21:13:30 +00:00
msaitoh
332ae65f51 Avoid undefined behavior in g4x_get_stolen_reserved().
The change is the same as newer i915_gem_stolen.c.
2019-10-01 18:44:24 +00:00
kamil
c1b8181461 Restore the old behavior in PT_GET_PROCESS_STATE
For !child and !lwp events return zeroed struct ptrace_state.

There is code that depends on it (GDB).

Fixes PR toolchain/54590 by martin@
2019-10-01 18:44:22 +00:00
msaitoh
e9da462ec6 Use unsigned to avoid undefined behavior in g4x_update_wm(). 2019-10-01 18:41:58 +00:00
chs
02991323a4 in many device attach paths, allocate memory with KM_SLEEP instead of KM_NOSLEEP
and remove code to handle failures that can no longer happen.
2019-10-01 18:00:07 +00:00
sevan
39ad3db35e Add Alan Perlis 2019-10-01 17:58:25 +00:00
chs
0ab44a811f in ifmedia_add(), use a wait-style memory allocation rather than
not waiting and panic'ing if the allocation fails.

Reported-by: syzbot+249ca42197f0b066e154@syzkaller.appspotmail.com
2019-10-01 17:45:25 +00:00
chs
e880b3aa3c in uvm_wait(), panic if the pagedaemon thread does not exist.
this avoids a hang if the system runs out of memory before
the mechanisms for reclaiming memory have been set up.
2019-10-01 17:40:22 +00:00
chs
17b5168399 make this compile again:
- remove unused config attributes
 - rename a local variable to avoid a name conflict
2019-10-01 17:35:09 +00:00
chs
db38f3713d in shmdt(), wait until shmat() completes before detaching.
Reported-by: syzbot+8f470a1bf36b47ae0040@syzkaller.appspotmail.com
Reported-by: syzbot+45810b4c41ed65d9148d@syzkaller.appspotmail.com
2019-10-01 16:36:58 +00:00
christos
e03122c9ca new tcpdump/libpcap. 2019-10-01 16:08:56 +00:00
christos
831945a111 new libpcap 2019-10-01 16:07:14 +00:00
christos
817e9a7e0a merge conflicts 2019-10-01 16:06:15 +00:00
christos
4c1a0b8852 Friday, September 20, 2019, by mcr@sandelman.ca
A huge thank you to Denis, Francois-Xavier and Guy who did much of the heavy lifting.
  Summary for 4.9.3 tcpdump release
    Fix buffer overflow/overread vulnerabilities:
      CVE-2017-16808 (AoE)
      CVE-2018-14468 (FrameRelay)
      CVE-2018-14469 (IKEv1)
      CVE-2018-14470 (BABEL)
      CVE-2018-14466 (AFS/RX)
      CVE-2018-14461 (LDP)
      CVE-2018-14462 (ICMP)
      CVE-2018-14465 (RSVP)
      CVE-2018-14881 (BGP)
      CVE-2018-14464 (LMP)
      CVE-2018-14463 (VRRP)
      CVE-2018-14467 (BGP)
      CVE-2018-10103 (SMB - partially fixed, but SMB printing disabled)
      CVE-2018-10105 (SMB - too unreliably reproduced, SMB printing disabled)
      CVE-2018-14880 (OSPF6)
      CVE-2018-16451 (SMB)
      CVE-2018-14882 (RPL)
      CVE-2018-16227 (802.11)
      CVE-2018-16229 (DCCP)
      CVE-2018-16301 (was fixed in libpcap)
      CVE-2018-16230 (BGP)
      CVE-2018-16452 (SMB)
      CVE-2018-16300 (BGP)
      CVE-2018-16228 (HNCP)
      CVE-2019-15166 (LMP)
      CVE-2019-15167 (VRRP)
    Fix for cmdline argument/local issues:
      CVE-2018-14879 (tcpdump -V)
2019-10-01 16:04:24 +00:00
christos
5b84acda10 sync with libcap-1.9.1 2019-10-01 16:02:55 +00:00
christos
bb7460091b merge conflicts 2019-10-01 16:02:11 +00:00
christos
4a71e5f388 Sunday, July 22, 2018
Summary for 1.9.1 libpcap release
    Mention pcap_get_required_select_timeout() in the main pcap man page
    Fix pcap-usb-linux.c build on systems with musl
    Fix assorted man page and other documentation issues
    Plug assorted memory leaks
    Documentation changes to use https:
    Changes to how time stamp calculations are done
    Lots of tweaks to make newer compilers happier and warning-free and
        to fix instances of C undefined behavior
    Warn if AC_PROG_CC_C99 can't enable C99 support
    Rename pcap_set_protocol() to  pcap_set_protocol_linux().
    Align pcap_t private data on an 8-byte boundary.
    Fix various error messages
    Use 64-bit clean API in dag_findalldevs()
    Fix cleaning up after some errors
    Work around some ethtool ioctl bugs in newer Linux kernels (GitHub
        issue #689)
    Add backwards compatibility sections to some man pages (GitHub issue
        #745)
    Fix autotool configuration on AIX and macOS
    Don't export bpf_filter_with_aux_data() or struct bpf_aux_data;
        they're internal-only and subject to change
    Fix pcapng block size checking
    On macOS, don't build rpcapd or test programs any fatter than they
        need to be
    Fix reading of capture statistics for Linux USB
    Fix packet size values for Linux USB packets (GitHub issue #808)
    Check only VID in VLAN test in filterss (GitHub issue #461)
    Fix pcap_list_datalinks on 802.11 devices on macOS
    Fix overflows with very large snapshot length in pcap file
    Improve parsing of rpcapd configuration file (GitHub issue #767)
    Handle systems without strlcpy() or strlcat() better
    Fix crashes and other errors with invalid filter expressions
    Fix use of uninitialized file descriptor in remote capture
    Fix some CMake issues
    Fix some divide-by-zero issues with the filter compiler
    Work around a GNU libc bug in pcap_nametonetaddr()
    Add support for DLT_LINUX_SLL2
    Fix handling of the packet-count argument for Myricom SNF devices
    Fix --disable-rdma in configure script (GitHub issue #782)
    Fix compilation of TurboCap support (GitHub issue #764)
    Constify first argument to pcap_findalldevs_ex()
    Fix a number of issues when running rpcapd as an inetd-style daemon
    Fix CMake issues with D-Bus libraries
    In rpcapd, clean up termination of a capture session
    Redo remote capture protocol negotiation
    In rpcapd, report the same error for "invalid user name" and
        "invalid password", to make brute-forcing harder
    For remote captures, add an error code for "the server requires TLS"
    Fix pcap_dump_fopen() on Windows to avoid clashes between
        {Win,N}Pcap and application C runtimes
    Fix exporting of functions from Windows DLLs (GitHub issue #810)
    Fix building as part of Npcap
    Allow rpcapd to rebind more rapidly
    Fix building shared libpcap library on midipix (midipix.org)
    Fix hack to detect UTF-16LE adapter names on Windows not to go past
        the end of the string
    Fix handling of "wireless WAN" (mobile phone network modems) on
        Windows with WinPcap/Npcap (GitHub issue #824)
    Have pcap_dump_open_append() create the dump file if it doesn't
        exists (GitHub issue #247)
    Fix the maxmum snapshot length for DLT_USBPCAP
    Use -fPIC when building for 64-bit SPARC on Linux (GitHub issue #837)
    Fix CMake 64-bit library installation directory on some Linux
        distributions
    Boost the TPACKET_V3 timeout to the maximum if a timeout of 0 was
        specified
    Five CVE-2019-15161, CVE-2019-15162, CVE-2019-15163, CVE-2019-15164, CVE-2019-15165
    Fixes for CVE-2018-16301, errors in pcapng reading.
    PCAPNG reader applies some sanity checks before doing malloc().
2019-10-01 16:00:25 +00:00
mrg
c08ccaef18 merge GCC 8.3.0 pass 2. still will not compile yet. these
files are yet to merge:

C gcc/config/rs6000/rs6000.c
C libsanitizer/lsan/lsan_allocator.cc
C libsanitizer/sanitizer_common/sanitizer_internal_defs.h
2019-10-01 11:49:12 +00:00
mlelstv
5cd8663bd1 Don't attach an ld device if the format descriptor is unsupported/unused. 2019-10-01 10:59:49 +00:00
kardel
479b835cf3 PR/54513 ifconfig exits on newly created carp interfaces
downgrade from err(EXIT_FAILURE, ... ) to warn() if ioctl(SIOCGLIFADDR) fails.
ifconfig now survives freshly created carp interfaces.
2019-10-01 10:52:53 +00:00
mrg
3f8cba227b merge GCC 8.3.0 pass 1. will not compile yet. thare are still
about 25 files with merge issues.
2019-10-01 10:38:15 +00:00
jmcneill
3e91ed807f Increase maxusers to 64 for 64-bit kernels 2019-10-01 10:08:05 +00:00
msaitoh
08c191c538 Set MTU correctly if mtu > 1500. 2019-10-01 10:04:11 +00:00
mrg
e9ed101783 add a note about GCC 8.3 import probably needing cleaning. 2019-10-01 09:36:56 +00:00
mrg
14f5a3b000 import GCC 8.3. it includes these new features:
- many optimisations improved: inter-procedural, profile-directed,
  LTO, loops including user-controllable unroll support, and more.
- columns numbers added to line numbers in dwarf
- gcov extended significantly
- many sanitizer updates
- many new warning messages
- many better hints and more useful error messages
- minor ABI changes on x86-64 libstdc++, and some c++17 modes
- draft c++2a features
- better c++17 experimental support
- Armv8.4-A supported, better 8.2-A and 8.3-A support, including
  32 bit arm port.  cortex a-55, a-75 and a-55.a-75 combo support.
- in the GCC bugzilla, 8.1 shows 1149 bugs fixed, 8.2 shows 100, and
  8.3 shows 158.
2019-10-01 09:36:01 +00:00
msaitoh
b7164648bb Increment if_iqdrops when dropping an oversized frame. 2019-10-01 08:13:16 +00:00
cnst
da5825f8ed kern/subr_disk: bounds_check_with_label: really protect against div by zero
Solves kernel panic in NetBSD 8.1 amd64 on VirtualBox 6.0.12 r133076.

Triggered with an NVMe controller without any actual discs behind it:

nvme0 at pci0 dev 14 function 0: vendor 80ee product 4e56 (rev. 0x00)
nvme0: NVMe 1.2
nvme0: interrupting at ioapic0 pin 22
nvme0: ORCL-VBOX-NVME-VER12, firmware 1.0, serial VB1234-56789
ld0 at nvme0 nsid 1
ld0: 0, 0 cyl, 16 head, 63 sec, 1 bytes/sect x 0 sectors

Code path is reached 4 times during normal boot, each time after wd0a
is already mounted; this patch avoids a crash with a dirty filesystem.
2019-09-30 23:23:59 +00:00
rmind
4d18bc5819 npf_ifmap_copylogname: be more defensive. 2019-09-30 22:04:33 +00:00
kamil
90a994c899 Welcome to 9.99.15!
struct proc and eventswitch() API changes.
2019-09-30 21:18:00 +00:00
kamil
5e4bbc4985 Move TRAP_CHLD/TRAP_LWP ptrace information from struct proc to siginfo
Storing struct ptrace_state information inside struct proc was vulnerable
to synchronization bugs, as multiple events emitted in the same time were
overwritting other ones.

Cache the original parent process id in p_oppid. Reusing here p_opptr is
in theory prone to slight race codition.

Change the semantics of PT_GET_PROCESS_STATE, reutning EINVAL for calls
prompting for the value in cases when there wasn't registered an
appropriate event.

Add an alternative approach to check the ptrace_state information, directly
from the siginfo_t value returned from PT_GET_SIGINFO. The original
PT_GET_PROCESS_STATE approach is kept for compat with older NetBSD and
OpenBSD. New code is recommended to keep using PT_GET_PROCESS_STATE.

Add a couple of compile-time asserts for assumptions in the code.

No functional change intended in existing ptrace(2) software.

All ATF ptrace(2) and ATF GDB tests pass.

This change improves reliability of the threading ptrace(2) code.
2019-09-30 21:13:33 +00:00
uwe
1497865af5 Use -width Pa for FILES. 2019-09-30 21:06:16 +00:00
uwe
e1b6f38e10 Fix pasto in table replace -t type 2019-09-30 20:53:12 +00:00
uwe
052f05e3b3 Use -width Pa for FILES. 2019-09-30 20:44:51 +00:00
bouyer
574d42d82d fix double space in comment 2019-09-30 16:59:09 +00:00
bouyer
e1afbabffc Fix 2 bugs, reported by Edgar Fuß on tech-net@
- pfil_run_hooks() can be called recursively, so we have to
  #define FASTROUTE_RECURSION in fil.c
- ip6_if_output()/nd6_output() will free the mbuf on error, to make sure
  to set *mpp to NULL so the caller won't try to free it again.
2019-09-30 16:58:06 +00:00
sevan
f3e3e81ae9 Document standards and correct history.
via Free / OpenBSD.
2019-09-30 13:44:52 +00:00
christos
34c0ab9f83 use __inline
add missing __printflike attributes
2019-09-30 12:20:54 +00:00
knakahara
9b6ccc4b31 Fix a ifa_release() leak for a specific struct rt_addrinfo.
ok by ozaki-r@n.o
2019-09-30 10:22:14 +00:00
mrg
647857abb4 remove HAVE_GCC == 6 support, add HAVE_GCC == 8 support 2019-09-30 08:40:20 +00:00
knakahara
37335b67b8 Fix typo in vmxnet3_legacy_intr().
That causes sysctl hw.vmx*.{rx,tx} effect inversely when vmx(4) uses
INTx or MSI.
2019-09-30 07:13:54 +00:00
rmind
04cb50ac51 libnpf/npfctl: support dynamic NAT rulesets using a name prefix. 2019-09-30 00:37:11 +00:00
mrg
90bf43e918 convert HAVE_GCC == 7 to HAVE_GCC >= 7. 2019-09-30 00:06:02 +00:00
mrg
21303c93e9 convert HAVE_GCC == 7 to HAVE_GCC >= 7. 2019-09-29 23:44:58 +00:00
mrg
4be7da17b5 gcc 7 can now be found in gcc.old. 2019-09-29 22:10:55 +00:00
jakllsch
798696b68b Use AHCI_RFIS_SYNC in ahci_cmd_complete() AT_READREG case.
Ensures CPU sees the current device to host FIS before parsing.
2019-09-29 21:28:20 +00:00