summaryrefslogtreecommitdiffstats
path: root/usr.sbin
Commit message (Collapse)AuthorAgeFilesLines
* Update ntpd to 4.2.8p13 to fix authenticated denial of service.gordon2019-05-1410-30/+50
| | | | | | Approved by: so Security: FreeBSD-SA-19:04.ntp Security: CVE-2019-8936
* Update hostapd/wpa_supplicant to 2.8 to fix multiple vulnerabilities.gordon2019-05-146-43/+144
| | | | | | | | | | | | Approved by: so Security: FreeBSD-SA-19:03.wpa Security: CVE-2019-9494 Security: CVE-2019-9495 Security: CVE-2019-9496 Security: CVE-2019-9497 Security: CVE-2019-9498 Security: CVE-2019-9499 Security: CVE-2019-11555
* Fix insufficient bounds checking in bhyve(8) device model. [SA-18:14.bhyve]gordon2018-12-041-14/+15
| | | | | | | | Submitted by: jhb Reported by: Reno Robert Approved by: so Security: FreeBSD-SA-18:14.bhyve Security: CVE-2018-17160
* MFC r333176:tuexen2018-05-311-2/+5
| | | | | | | | | | | | | | | | Fix in the documentation that the default hop limit is not 30, but the value of the sysctl variable net.inet6.ip6.hlim. This is true since https://svnweb.freebsd.org/base?view=revision&revision=122574 The default of 30 (which was correct up to r122574) was incorrectly documented in https://svnweb.freebsd.org/base?view=revision&revision=130268 Thanks to Timo Voelker for makeing me aware of the inconsistency between to code and the documentation. Approved by: re@ (marius)
* MFC r332877: Correct size for allocation and bzero of fdsr.delphij2018-05-081-2/+2
| | | | Approved by: re (gjb)
* MFC r332559: mountd: fix a crash when getgrouplist reports too many groupsavg2018-05-031-1/+4
| | | | Sponsored by: Panzura
* MFC r332902: pwd_mkdb: default to network (big) endian hash orderemaste2018-04-301-1/+1
| | | | | | | | | | | | | | | For cross-architecture reproducibility. The db(3) functions work with hashes of either endianness, and the current (v4) version password db entries already store integers in network order. Do so with the hash as well so that identical password databases can be created on big- and little-endian hosts. The -B and -L flags exist to set the endianness for legacy (v3) entries when the -l flag is used, and they will still control hash endianness (at least until the backwards compatibility infrastructure is removed [a change that will not be merged to stable/11]). Sponsored by: The FreeBSD Foundation
* MFC r332986:pfg2018-04-281-1/+1
| | | | | | | makefs: Use ENODATA instead of ENOMSG as a translation for missing ENOATTR. This is consistent with what some linux filesystems do and has been adopted in our linuxulator.
* MFC r331463 (partial), r331467, r331468, r331843benno2018-04-254-20/+75
| | | | | | | | | | | | | r331463, r331467, and r331468 are all replaced by r331843 but are included for completeness' sake. r331463 also contained a change to release/amd64/mkisoimages.sh which I've left out since those changes were also obsoleted by a later commit which will be merged later. r331843: Synchronise with NetBSD's version of EFI handling for El Torito images. Sponsored by: iXsystems, Inc.
* MFC r316579benno2018-04-2511-238/+76
| | | | | | | | | | | | | | | | | | | | | | makefs: use emalloc and friends The emalloc set of error-checking memory allocation routines were added to libnetbsd in r316572. Use them in makefs to reduce differences with NetBSD. NetBSD revs: cd9660.c 1.39 ffs.c 1.56 makefs.c 1.42 walk.c 1.27 cd9660/cd9660_archimedes.c 1.2 cd9660/cd9660_eltorito.c 1.20 cd9660/cd9660_write.c 1.16 cd9660/iso9660_rrip.c 1.12 ffs/buf.c 1.17 ffs/mkfs.c 1.26 Sponsored by: iXsystems, Inc.
* MFC r307927benno2018-04-257-11/+24
| | | | | | | | | | | | | | Be more precise when including headers so that we're less likely to depend on namespace pollution and as such become more portable. This means including headers like <sys/types.h> or <stdlib.h>, but also making sure we include system/host headers before local headers. While here: define ENOATTR as ENOMSG in mtree.c. There is no ENOATTR on Linux. With this, makefs is ready for compilation on macOS and Linux. Sponsored by: iXsystems, Inc.
* MFC r315304benno2018-04-255-215/+338
| | | | | | | | | | | | | | | | | makefs: sync option parsing with NetBSD - add support for parsing different types; not just int - homogenize option parsing - fix single letter parsing - remove duplicated code NetBSD revisions: cd9660.c 1.36 1.37 1.38 1.41 1.42 1.43 ffs.c 1.50 1.51 1.52 1.53 1.56 1.57 makefs.c 1.36 1.37 1.38 1.39 1.40 1.42 1.43 1.44 1.46 makefs.h 1.28 1.29 1.31 1.32 Sponsored by: iXsystems, Inc.
* MFC r314117benno2018-04-257-461/+506
| | | | | | | | | | | | | | | | | makefs: eliminate global cd9660 structure For diff reduction with NetBSD NetBSD file versions: cd9660.c 1.39 cd9660.h 1.19 cd9660/cd9660_debug.c 1.12 cd9660/cd9660_eltorito.c 1.20 cd9660/cd9660_write.c 1.16 cd9660/iso9660_rrip.c 1.12 cd9660/iso9660_rrip.h 1.6 Sponsored by: iXsystems, Inc.
* MFC r332518, r332527ian2018-04-242-5/+15
| | | | | | | | | | | | | r332518: Add an option to daemon(8) to specify a delay between restarts of a supervised program. The existing -r option has a hard-coded delay of one second. This change adds a -R option which takes a delay in seconds. This can be used to prevent log spam and rapid restarts, similar to init(8)'s behavior of adding a delay between rapid restarts when it's supervising a program. r332527: Fix cut-and-pasted line to have the right option letter.
* pwd_mkdb: add legacy support deprecation noticeemaste2018-04-242-1/+8
| | | | | | | | | | | | | | | | | MFC r332789: pwd_mkdb: warn that legacy support is deprecated (if specified) r283981 switched pwd_mkdb to emit only v4 database entries by default, and introduced a -l (legacy) option emit v3 entries in addition. The commit message claims that legacy support will be removed in 12.0, so emit a warning now if it is used. MFC r332875: pwd_mkdb: add deprecation notice in manpage too Followon to r332789; as reported on the -current and -stable lists and in review D15144 the -l option will be removed before FreeBSD 12.0. Relnotes: Yes Sponsored by: The FreeBSD Foundation
* MFC r332429, r332431kevans2018-04-191-1/+13
| | | | | | | | | | | | | | | | | | | | r332429: cron(8): Reload database if an existing job in cron.d changed as well Directory mtime will only change if a file is added or removed, not modified. For /var/cron/tabs, this is fine because of how crontab(1) manages it using temp files so all crontab(1) changes will trigger a reload of the database. For /etc/cron.d and /usr/local/etc/cron.d, this is not necessarily the case. Instead of checking their mtime, we should descend into them and check mtime on all jobs also. r332431: cron(8): Correct test sense We're about to use the result of fstat(2) either way, so don't do that if it fails...
* MFC r328336:trasz2018-04-161-0/+2
| | | | Add missing SPDX identifier in iscsid(8).
* MFC r328335:trasz2018-04-165-0/+10
| | | | Add SPDX identifiers for uefisign(8) sources.
* MFC r330515:asomers2018-04-161-1/+1
| | | | spray: fix the spelling in an output string
* MFC r329845, r329872asomers2018-04-165-21/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | r329845: Fix numerous Coverity issues in mptutil Most are memory or file descriptor leaks. Three were unannotated fallthroughs in a switch/case statement. One was an integer overflow before widen. Reported by: Coverity CID: 1007463 1007462 1007461 1007460 1007459 1007458 1007457 CID: 1006855 1006854 1006853 1006852 1006851 1006850 1006849 CID: 1006848 1006845 1006844 1006843 1006842 1006841 1006840 CID: 1006839 1006838 1006837 1006836 1006835 1006834 1006833 CID: 1006832 1006831 1006831 1006830 1006829 1008334 1008170 CID: 1008169 1008168 Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11013 r329872: Delete copypasta Reported by: rpokala X-MFC-With: 329845 Sponsored by: Spectra Logic Corp
* MFC r328338:trasz2018-04-169-0/+18
| | | | Add SPDX tags for automount(8) et al.
* MFC r328337:trasz2018-04-163-0/+6
| | | | Add missing SPDX tags for ctld(8).
* MFC r326248:trasz2018-04-161-2/+3
| | | | .Xr pmcstat(8) from kgmon(8) and gprof(1).
* MFC r325390:trasz2018-04-161-1/+1
| | | | Use proper naming in a debug message.
* MFC r330875:trasz2018-04-162-1/+18
| | | | | Add "usbconfig dump_all_desc", a subcommand to dump all device and config descriptors.
* MFC r327522:trasz2018-04-161-2/+0
| | | | Fix warnings from "mandoc -Tlint -Wwarning".
* MFC r327382:trasz2018-04-161-21/+100
| | | | Improve usbconfig(8) manual page by adding descriptions for subcommands.
* MFC r330764grehan2018-04-151-3/+22
| | | | Add CR2 get/set support.
* MFC r331758: makefs: sync fragment and block size with newfsemaste2018-04-131-2/+2
| | | | | | | | | r222319 in newfs raised the default blocksize for UFS/FFS filesystems from 16K to 32K and the default fragment size from 2K to 4K, with a rationale that most disks were now running with 4K sectors. Relnotes: Yes Sponsored by: The FreeBSD Foundation
* MFC r331180: Plug a possible memory leak.delphij2018-04-101-0/+2
|
* MFC r328434 by maxim:gonzo2018-04-091-1/+1
| | | | | | o A command line flag for the syslog_facility fixed in the SYNOPSIS. PR: 225441
* MFC r328488:tuexen2018-04-072-21/+98
| | | | | | | | When using SCTP for sending probe packets, use INIT chunks for payloads larger than or equal to 32 bytes. For smaller probe packets, keep using SHUTDOWN-ACK chunks, possibly bundled with a PAD chunk. Packets with INIT chunks more likely pass through firewalls. Therefore, use them when possible.
* MFC r324122:tuexen2018-04-071-1/+2
| | | | Fix reporting of probing size. This bug was introduced in r324119.
* MFC r324120:tuexen2018-04-072-8/+244
| | | | Add SCTP and TCP as protocols for sending probe packets.
* MFC r324119:tuexen2018-04-072-75/+39
| | | | | | | | | | | | | * Update function definitions. * Ensure that the datalen always describes the length after the IPv6 header consistently, not matter which protocol us used for probes.. * Document that the default length is 20, not 12. * Don't send inormation in probe packets which is not needed or even checked when the responses are processed. * Address CID 978587. This is mainly a cleanup preparing the addition of SCTP and TCP as possible probe packet protocols.
* MFC efibootmgr: r326725-r326728, r326771, r326800-r326804, r326806, r327163kevans2018-04-064-1/+1050
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r327572-r327573, r327610-r327611, r327877, r331069 r326725: Import Netflix's efibootmgr to help manage UEFI boot variables efibootmgr manages the UEFI BootXXXX variables that implement the UEFI Boot Manager protocol defined in the UEFI standards. It is modeled after the Linux program of the same name with a mostly compatible set of command line options. Since there's a fair amount of OS specifioc code due to differeing names and methods of doing things, the compatibility isn't 100%. Basic functionality is implemented, though the more advanced next boot functionality that's been defined elsewhere is unimplemented. Submitted by: Matt Williams (with unix / efi path xlate by me) Sponsored by: Netflix r326726: Forgotten in 326725 Release Notes: Yes r326727: Remove vestiges of -d and -p commands. Fix two core dumps when optional data isn't specified. Sponsored by: Netflix r326728: Indent multiple device path entries correctly. Sponsored by: Netflix r326771: Unbreak gcc build by using (void) for functions that take no args. Sponsored by: Netflix r326800: Check return value for set_bootvar and give a good error message. CID: 1383601 Sponsored by: Netflix r326801: Don't leak new_data. CID: 1383605 Sponsored by: Netflix r326802: Fix resource leak. Free converted description after printing it. Also minor style sort of local vars. CID: 1383606 Sponsored by: Netflix r326803: Free load_opt_buf after we're done with it. CID: 1383607 Sponsored by: Netflix r326804: Add sanity testing against maximum sane lengths for device paths for loader and kernel. CID: 1383608 Sponsored by: Netflix r326806: Actually insert the free(d) call missed in r326802. Noticed by: rpokala@ r327163: Remove write-only opt and useless optlen variables. This squashes the warning gebnerated by GCC 6.x. Since variables that are now removed had come documentation value, put relevant bits in comment, so they can be resurrected from there when actually needed. r327572: Ensure that we have a description string. When unspecified, default to "". Sponsored by: Netflix r327573: Free options before setting them. This will prevent us from leaking memory when we have multiple copies of the same option from being specified. Sponsored by: Netflix r327610: Fix usage strings. -d and -p were removed before this was committed to FreeBSD, but the strings weren't updated. Sponsored by: Netflix r327611: There's no need / benefit from deleting the variable before we set it. Sponsored by: Netflix r327877: Fix error in determining the next available boot slot. Sponsored by: Netflix r331069: Make not getting BootOrder a warning, not a fatal error when printing. Sponsored by: Netflix Relnotes: yes
* MFC efivar changes: r321429, r323056-r323057, r323066, r323259-r323260,kevans2018-04-068-100/+420
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r323519, r325684, r326050-r326051, r326231, r326287, r326457-r326459, r326472, r326658, r326805, r327574-r327575, r330279 r321429: fix typo r323056: Fix printing File() nodes in device paths. Device paths encoded into the FILEPATH_DEVICE_PATH are UCS2 not ASCII/UTF8. Convert to utf8 and print that when printing File paths. Also, since File may be at the end of a long device path, output File() around the path so it doesn't just show up as random nodes that might accidentally match real node paths names and cause errors. r323057: Fix parsing File() nodes in device paths. o Add File to the mUefiDevicePathLibDevPathFromTextTable table so we don't include 'File()' in the supposed path name. This happens because of a possible misfeature in the EDK2 code where any path that's not recognized is treated as a File() node. o Convert utf8 input into ucs2 output rather than just copying the utf8 and hoping for the best (no good comes from that). o Remove bogus comment about needing to add 1. The dummy array already is length 1, so that's included in sizeof the struct, so there's no need to add it. Sponsored by: Netflix r323066: Add UCS2->UTF8 option. Many UEFI variables are UCS2 strings (some NUL terminated, others not). Add --utf8 (-u) to convert UCS2 strings to UTF8 before printing. Sponsored by: Netflix r323259: Implement efidp_size efidp_size will return the size, in bytes, of a EFI device path structure. This is a convenience wrapper in the same style as the other linux routines. It's implemented by GetDevicePathSize from EDK2 we already needed for other things. Sponsored by: Netflix r323260: Create efi utility printing routines Split out asciidump, utf8dump, bindump, and hexdump into a separate file efiutil.c. Implement new efi_print_load_option for printing out the EFI_LOADER_OPTION data structure used to specify different options to the UEFI boot manager. Sponsored by: Netflix r323519: Minor fixes to edge cases in efi_get_next_variable_name Fix allocating more memory for the names (unlikely to be needed, but still best to get right) to ask for the length the kernel told use we needed, not the old length of the variable. Mind the proper NUL that we add in the space we allocate. Free the old name string before we allcoate a new one to limit what we leak to the last one (free passed in name for the last one in the list), and detect the last one by rv != 0 and errno == ENOENT, rather then just the former to avoid false positives if errno happens to be ENOENT on entry. Sponsored by: Netflix r325684: Simplify the efivar interface a little. We started out having Linux compatible libefivar interfaces. This was in anticipation of porting the GPL'd efibootmgr to FreeBSD via a port. However, since we need that functionality in the base, that port isn't going to happened. It also appears that efivar is a private library that's not used much outside a command line util and efibootmgr. Reduce compatibility with the Linux version a little by removing the mode parameter to efi_set_variable (which was unused on FreeBSD, and not set to something useful in the code we'd written). Also remove some efi error routines that were never implemented and existed only to placate early GPL efibootmgr porting experiments. Suggested by: Matt Williams Sponsored by: Netflix r326050: Document what the command line arguments actually do. List some of the size limitations. Sponsored by: Netflix r326051: This program is more useful if it skips leading whitespace when parsing a textual UEFI Device Path, since otherwise it things the passed in path is a filename. While here, reduce the repetition of 8192. Sponsored by: Netflix r326231: Add efidp_format_device_path_node to format a single node in a device path, much like efidp_format_device_path will format the entire path. Sponsored by: Netflix r326287: efivar: add missing getopt 'u' option r326457: Read multiple lines when parsing the data. Allow multiple device paths to be read when formatting device paths. Set the upper limit to 64k (most of these paths are < 64 bytes). Sponsored by: Netflix r326458: Create a function to translate UEFI paths to unix paths efivar_device_path_to_unix_path translates from UEFI to Unix efivar_unix_path_to_device_path translates from Unix to UEFI At present, only HD() device types are supported (both GPT and MBR). CdRom and floppy devices aren't supported. ZFS isn't supported because there's no way in the UEFI standard to specify a ZFS datastore. Network devices aren't supported either. Three forms of Unix path are accepted: /path/to/file (for a mounted filesystem), //path/to/file (uses the EFI partition on the same disk as /), and dev:/path/to/file (for unmounted filesystem). Two forms are produced (the first and last). Sponsored by: Netflix r326459: Add -u (--to-unix) and -e (--to-efi) to convert unix or efi paths to the other. Sponsored by: Netflix r326472: Add forgotten libgeom. Sponsored by: Netflix r326658: Ensure that "out" is initialized in all error paths. Reported by: gcc Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D13402 r326805: Iniailize str so ucs2_to_utf8 won't free stack garbage. CID: 1381037 Sponsored by: Netflix r327574: Set dp to NULL when we free it, and tree a NULL dp as an error condition. This should prevent a double free. In addition, prevent a leak by freeing dp each loop and when we're done. CID: 1383577 Sponsored by: Netflix r327575: Need to convert '/' back to '\' when creating a path. Ideally, this would be filesystem type dependent, but that's difficult to accomplish and it's unclear how the UEFI firmware will cope. Be conservative and make boot loaders cope instead. Sponsored by: Netflix r330279: libefivar: use standard 2-Clause FreeBSD license Approved by: imp Sponsored by: The FreeBSD Foundation
* MFC r320138:smh2018-03-312-2/+2
| | | | | | Fixed bsdinstall location of vfs.zfs.min_auto_ashift Sponsored by: Multiplay
* Merge clang, llvm, lld, lldb, compiler-rt and libc++ 6.0.0 release, anddim2018-03-311-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | several follow-up fixes. MFC r327952: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 6.0.0 (branches/release_60 r321788). Upstream has branched for the 6.0.0 release, which should be in about 6 weeks. Please report bugs and regressions, so we can get them into the release. Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11 support to build; see UPDATING for more information. MFC r328010: Pull in r322473 from upstream llvm trunk (by Andrei Elovikov): [LV] Don't call recordVectorLoopValueForInductionCast for newly-created IV from a trunc. Summary: This method is supposed to be called for IVs that have casts in their use-def chains that are completely ignored after vectorization under PSE. However, for truncates of such IVs the same InductionDescriptor is used during creation/widening of both original IV based on PHINode and new IV based on TruncInst. This leads to unintended second call to recordVectorLoopValueForInductionCast with a VectorLoopVal set to the newly created IV for a trunc and causes an assert due to attempt to store new information for already existing entry in the map. This is wrong and should not be done. Fixes PR35773. Reviewers: dorit, Ayal, mssimpso Reviewed By: dorit Subscribers: RKSimon, dim, dcaballe, hsaito, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D41913 This should fix "Vector value already set for part" assertions when building the net/iodine and sysutils/daa2iso ports. Reported by: jbeich PR: 224867, 224868 MFC r328090: Pull in r322623 from upstream llvm trunk (by Andrew V. Tischenko): Allow usage of X86-prefixes as separate instrs. Differential Revision: https://reviews.llvm.org/D42102 This should fix parse errors when x86 prefixes (such as 'lock' and 'rep') are followed by various non-mnemonic tokens, e.g. comments, .byte directives and labels. PR: 224669, 225054 MFC r328091: Revert r327340, as the workaround for rep prefixes followed by .byte directives is no longer needed after r328090. MFC r328141 (by emaste): lld: Fix for ld.lld does not accept "AT" syntax for declaring LMA region AT> lma_region expression allows to specify the memory region for section load address. Should fix [upstream LLVM] PR35684. LLVM review: https://reviews.llvm.org/D41397 Obtained from: LLVM r322359 by George Rimar MFC r328143 (by emaste): lld: Handle parsing AT(ADDR(.foo-bar)). The problem we had with it is that anything inside an AT is an expression, so we failed to parse the section name because of the - in it. Requested by: royger Obtained from: LLVM r322801 by Rafael Espindola MFC r328144 (by emaste): lld: Fix incorrect physical address on self-referencing AT command. When a section placement (AT) command references the section itself, the physical address of the section in the ELF header was calculated incorrectly due to alignment happening right after the location pointer's value was captured. The problem was diagnosed and the first version of the patch written by Erick Reyes. Obtained from: LLVM r322421 by Rafael Espindola MFC r328145: Pull in r322016 from upstream llvm trunk (by Sanjay Patel): [ValueTracking] remove overzealous assert The test is derived from a failing fuzz test: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5008 Credit to @rksimon for pointing out the problem. This should fix "Bad flavor while matching min/max" errors when building the graphics/libsixel and science/kst2 ports. Reported by: jbeich PR: 225268, 225269 MFC r328146: Pull in r322106 from upstream llvm trunk (by Alexey Bataev): [COST]Fix PR35865: Fix cost model evaluation for shuffle on X86. Summary: If the vector type is transformed to non-vector single type, the compile may crash trying to get vector information about non-vector type. Reviewers: RKSimon, spatel, mkuper, hfinkel Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41862 This should fix "Not a vector MVT!" errors when building the games/dhewm3 port. Reported by: jbeich PR: 225271 MFC r328286 (by emaste): lld: Don't mark a shared library as needed because of a lazy symbol. Obtained from: LLVM r323221 by Rafael Esp?ndola MFC r328381: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 6.0.0 (branches/release_60 r323338). PR: 224669 MFC r328513: Pull in r322245 from upstream clang trunk (by Craig Topper): [X86] Make -mavx512f imply -mfma and -mf16c in the frontend like it does in the backend. Similarly, make -mno-fma and -mno-f16c imply -mno-avx512f. Withou this "-mno-sse -mavx512f" ends up with avx512f being enabled in the frontend but disabled in the backend. Reported by: pawel PR: 225488 MFC r328542 (by emaste): lld: Use lookup instead of find. NFC, just simpler. Obtained from: LLVM r323395 by Rafael Espindola MFC r328543 (by emaste): lld: Only lookup LMARegion once. NFC. This is similar to how we handle MemRegion. Obtained from: LLVM r323396 by Rafael Espindola MFC r328544 (by emaste): lld: Remove MemRegionOffset. NFC. We can just use a member variable in MemoryRegion. Obtained from: LLVM r323399 by Rafael Espindola MFC r328545 (by emaste): lld: Simplify. NFC. Obtained from: LLVM r323440 by Rafael Espindola MFC r328546 (by emaste): lld: Improve LMARegion handling. This fixes the crash reported at [LLVM] PR36083. The issue is that we were trying to put all the sections in the same PT_LOAD and crashing trying to write past the end of the file. This also adds accounting for used space in LMARegion, without it all 3 PT_LOADs would have the same physical address. Obtained from: LLVM r323449 by Rafael Espindola MFC r328547 (by emaste): lld: Move LMAOffset from the OutputSection to the PhdrEntry. NFC. If two sections are in the same PT_LOAD, their relatives offsets, virtual address and physical addresses are all the same. [Rafael] initially wanted to have a single global LMAOffset, on the assumption that every ELF file was in practiced loaded contiguously in both physical and virtual memory. Unfortunately that is not the case. The linux kernel has: LOAD 0x200000 0xffffffff81000000 0x0000000001000000 0xced000 0xced000 R E 0x200000 LOAD 0x1000000 0xffffffff81e00000 0x0000000001e00000 0x15f000 0x15f000 RW 0x200000 LOAD 0x1200000 0x0000000000000000 0x0000000001f5f000 0x01b198 0x01b198 RW 0x200000 LOAD 0x137b000 0xffffffff81f7b000 0x0000000001f7b000 0x116000 0x1ec000 RWE 0x200000 The delta for all but the third PT_LOAD is the same: 0xffffffff80000000. [Rafael] thinks the 3rd one is a hack for implementing per cpu data, but we can't break that. Obtained from: LLVM r323456 by Rafael Espindola MFC r328548 (by emaste): lld: Put the header in the first PT_LOAD even if that PT_LOAD has a LMAExpr The root problem is that we were creating a PT_LOAD just for the header. That was technically valid, but inconvenient: we should not be making the ELF discontinuous. The solution is to allow a section with LMAExpr to be added to a PT_LOAD if that PT_LOAD doesn't already have a LMAExpr. LLVM PR: 36017 Obtained from: LLVM r323625 by Rafael Espindola MFC r328594 (by emaste): Pull in r322108 from upstream llvm trunk (by Rafael Esp?ndola): Make one of the emitFill methods non virtual. NFC. This is just preparatory work to fix [LLVM] PR35858. MFC r328595 (by emaste): Pull in r322123 from upstream llvm trunk (by Rafael Esp?ndola): Don't create MCFillFragment directly. Instead use higher level APIs that take care of most bookkeeping. MFC r328596 (by emaste): Pull in r322131 from upstream llvm trunk (by Rafael Esp?ndola): Use a MCExpr for the size of MCFillFragment. This allows the size to be found during ralaxation. This fixes [LLVM] pr35858. Requested by: royger MFC r328753: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 6.0.0 (branches/release_60 r323948). PR: 224669 MFC r328817: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 6.0.0 (branches/release_60 r324090). This introduces retpoline support, with the -mretpoline flag. The upstream initial commit message (r323155 by Chandler Carruth) contains quite a bit of explanation. Quoting: Introduce the "retpoline" x86 mitigation technique for variant #2 of the speculative execution vulnerabilities disclosed today, specifically identified by CVE-2017-5715, "Branch Target Injection", and is one of the two halves to Spectre. Summary: First, we need to explain the core of the vulnerability. Note that this is a very incomplete description, please see the Project Zero blog post for details: https://googleprojectzero.blogspot.com/2018/01/reading-privileged-memory-with-side.html The basis for branch target injection is to direct speculative execution of the processor to some "gadget" of executable code by poisoning the prediction of indirect branches with the address of that gadget. The gadget in turn contains an operation that provides a side channel for reading data. Most commonly, this will look like a load of secret data followed by a branch on the loaded value and then a load of some predictable cache line. The attacker then uses timing of the processors cache to determine which direction the branch took *in the speculative execution*, and in turn what one bit of the loaded value was. Due to the nature of these timing side channels and the branch predictor on Intel processors, this allows an attacker to leak data only accessible to a privileged domain (like the kernel) back into an unprivileged domain. The goal is simple: avoid generating code which contains an indirect branch that could have its prediction poisoned by an attacker. In many cases, the compiler can simply use directed conditional branches and a small search tree. LLVM already has support for lowering switches in this way and the first step of this patch is to disable jump-table lowering of switches and introduce a pass to rewrite explicit indirectbr sequences into a switch over integers. However, there is no fully general alternative to indirect calls. We introduce a new construct we call a "retpoline" to implement indirect calls in a non-speculatable way. It can be thought of loosely as a trampoline for indirect calls which uses the RET instruction on x86. Further, we arrange for a specific call->ret sequence which ensures the processor predicts the return to go to a controlled, known location. The retpoline then "smashes" the return address pushed onto the stack by the call with the desired target of the original indirect call. The result is a predicted return to the next instruction after a call (which can be used to trap speculative execution within an infinite loop) and an actual indirect branch to an arbitrary address. On 64-bit x86 ABIs, this is especially easily done in the compiler by using a guaranteed scratch register to pass the target into this device. For 32-bit ABIs there isn't a guaranteed scratch register and so several different retpoline variants are introduced to use a scratch register if one is available in the calling convention and to otherwise use direct stack push/pop sequences to pass the target address. This "retpoline" mitigation is fully described in the following blog post: https://support.google.com/faqs/answer/7625886 We also support a target feature that disables emission of the retpoline thunk by the compiler to allow for custom thunks if users want them. These are particularly useful in environments like kernels that routinely do hot-patching on boot and want to hot-patch their thunk to different code sequences. They can write this custom thunk and use `-mretpoline-external-thunk` *in addition* to `-mretpoline`. In this case, on x86-64 thu thunk names must be: ``` __llvm_external_retpoline_r11 ``` or on 32-bit: ``` __llvm_external_retpoline_eax __llvm_external_retpoline_ecx __llvm_external_retpoline_edx __llvm_external_retpoline_push ``` And the target of the retpoline is passed in the named register, or in the case of the `push` suffix on the top of the stack via a `pushl` instruction. There is one other important source of indirect branches in x86 ELF binaries: the PLT. These patches also include support for LLD to generate PLT entries that perform a retpoline-style indirection. The only other indirect branches remaining that we are aware of are from precompiled runtimes (such as crt0.o and similar). The ones we have found are not really attackable, and so we have not focused on them here, but eventually these runtimes should also be replicated for retpoline-ed configurations for completeness. For kernels or other freestanding or fully static executables, the compiler switch `-mretpoline` is sufficient to fully mitigate this particular attack. For dynamic executables, you must compile *all* libraries with `-mretpoline` and additionally link the dynamic executable and all shared libraries with LLD and pass `-z retpolineplt` (or use similar functionality from some other linker). We strongly recommend also using `-z now` as non-lazy binding allows the retpoline-mitigated PLT to be substantially smaller. When manually apply similar transformations to `-mretpoline` to the Linux kernel we observed very small performance hits to applications running typic al workloads, and relatively minor hits (approximately 2%) even for extremely syscall-heavy applications. This is largely due to the small number of indirect branches that occur in performance sensitive paths of the kernel. When using these patches on statically linked applications, especially C++ applications, you should expect to see a much more dramatic performance hit. For microbenchmarks that are switch, indirect-, or virtual-call heavy we have seen overheads ranging from 10% to 50%. However, real-world workloads exhibit substantially lower performance impact. Notably, techniques such as PGO and ThinLTO dramatically reduce the impact of hot indirect calls (by speculatively promoting them to direct calls) and allow optimized search trees to be used to lower switches. If you need to deploy these techniques in C++ applications, we *strongly* recommend that you ensure all hot call targets are statically linked (avoiding PLT indirection) and use both PGO and ThinLTO. Well tuned servers using all of these techniques saw 5% - 10% overhead from the use of retpoline. We will add detailed documentation covering these components in subsequent patches, but wanted to make the core functionality available as soon as possible. Happy for more code review, but we'd really like to get these patches landed and backported ASAP for obvious reasons. We're planning to backport this to both 6.0 and 5.0 release streams and get a 5.0 release with just this cherry picked ASAP for distros and vendors. This patch is the work of a number of people over the past month: Eric, Reid, Rui, and myself. I'm mailing it out as a single commit due to the time sensitive nature of landing this and the need to backport it. Huge thanks to everyone who helped out here, and everyone at Intel who helped out in discussions about how to craft this. Also, credit goes to Paul Turner (at Google, but not an LLVM contributor) for much of the underlying retpoline design. Reviewers: echristo, rnk, ruiu, craig.topper, DavidKreitzer Subscribers: sanjoy, emaste, mcrosier, mgorny, mehdi_amini, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D41723 PR: 224669 MFC r329033: Pull in r324594 from upstream clang trunk (by Alexander Ivchenko): Fix for #31362 - ms_abi is implemented incorrectly for values >=16 bytes. Summary: This patch is a fix for following issue: https://bugs.llvm.org/show_bug.cgi?id=31362 The problem was caused by front end lowering C calling conventions without taking into account calling conventions enforced by attribute. In this case win64cc was no correctly lowered on targets other than Windows. Reviewed By: rnk (Reid Kleckner) Differential Revision: https://reviews.llvm.org/D43016 Author: belickim <mateusz.belicki@intel.com> This fixes clang 6.0.0 assertions when building the emulators/wine and emulators/wine-devel ports, and should also make it use the correct Windows calling conventions. Bump __FreeBSD_version to make the fix easy to detect. PR: 224863 MFC r329223: Pull in r323998 from upstream clang trunk (by Richard Smith): PR36157: When injecting an implicit function declaration in C89, find the right DeclContext rather than injecting it wherever we happen to be. This avoids creating functions whose DeclContext is a struct or similar. This fixes assertion failures when parsing certain not-completely-valid struct declarations. Reported by: ae PR: 225862 MFC r329410: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 6.0.0 (branches/release_60 r325330). PR: 224669 MFC r329983: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 6.0.0 (branches/release_60 r325932). This corresponds to 6.0.0 rc3. PR: 224669 MFC r330384: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 6.0.0 release (upstream r326565). Release notes for llvm, clang and lld will be available here soon: <http://releases.llvm.org/6.0.0/docs/ReleaseNotes.html> <http://releases.llvm.org/6.0.0/tools/clang/docs/ReleaseNotes.html> <http://releases.llvm.org/6.0.0/tools/lld/docs/ReleaseNotes.html> Relnotes: yes PR: 224669 MFC r330686: Pull in r326882 from upstream llvm trunk (by Sjoerd Meijer): [ARM] Fix for PR36577 Don't PerformSHLSimplify if the given node is used by a node that also uses a constant because we may get stuck in an infinite combine loop. bugzilla: https://bugs.llvm.org/show_bug.cgi?id=36577 Patch by Sam Parker. Differential Revision: https://reviews.llvm.org/D44097 This fixes a hang when compiling one particular file in java/openjdk8 for armv6 and armv7. Reported by: swills PR: 226388 MFC r331065: Pull in r327638 from upstream llvm trunk (by Matthew Simpson): [ConstantFolding, InstSimplify] Handle more vector GEPs This patch addresses some additional cases where the compiler crashes upon encountering vector GEPs. This should fix PR36116. Differential Revision: https://reviews.llvm.org/D44219 Reference: https://bugs.llvm.org/show_bug.cgi?id=36116 This fixes an assertion when building the emulators/snes9x port. Reported by: jbeich PR: 225471 MFC r331066: Pull in r321999 from upstream clang trunk (by Ivan A. Kosarev): [CodeGen] Fix TBAA info for accesses to members of base classes Resolves: Bug 35724 - regression (r315984): fatal error: error in backend: Broken function found (Did not see access type in access path!) https://bugs.llvm.org/show_bug.cgi?id=35724 Differential Revision: https://reviews.llvm.org/D41547 This fixes "Did not see access type in access path" fatal errors when building the devel/gdb port (version 8.1). Reported by: jbeich PR: 226658 MFC r331366: Pull in r327101 from upstream llvm trunk (by Rafael Espindola): Don't treat .symver as a regular alias definition. This patch starts simplifying the handling of .symver. For now it just moves the responsibility for creating an alias down to the streamer. With that the asm streamer can pass a .symver unchanged, which is nice since gas cannot parse "foo@bar = zed". In a followup I hope to move the handling down to the writer so that we don't need special hacks for avoiding breaking names with @@@ on windows. Pull in r327160 from upstream llvm trunk (by Rafael Espindola): Delay creating an alias for @@@. With this we only create an alias for @@@ once we know if it should use @ or @@. This avoids last minutes renames and hacks to handle MS names. This only handles the ELF writer. LTO still has issues with @@@ aliases. Pull in r327928 from upstream llvm trunk (by Vitaly Buka): Object: Move attribute calculation into RecordStreamer. NFC Summary: Preparation for D44274 Reviewers: pcc, espindola Subscribers: hiraditya Differential Revision: https://reviews.llvm.org/D44276 Pull in r327930 from upstream llvm trunk (by Vitaly Buka): Object: Fix handling of @@@ in .symver directive Summary: name@@@nodename is going to be replaced with name@@nodename if symbols is defined in the assembled file, or name@nodename if undefined. https://sourceware.org/binutils/docs/as/Symver.html Fixes PR36623 Reviewers: pcc, espindola Subscribers: mehdi_amini, hiraditya Differential Revision: https://reviews.llvm.org/D44274 Together, these changes fix handling of @@@ in .symver directives when doing Link Time Optimization. Reported by: Shawn Webb <shawn.webb@hardenedbsd.org> MFC r331731: Pull in r328738 from upstream lld trunk (by Rafael Espindola): Strip @VER suffices from the LTO output. This fixes pr36623. The problem is that we have to parse versions out of names before LTO so that LTO can use that information. When we get the LTO produced .o files, we replace the previous symbols with the LTO produced ones, but they still have @ in their names. We could just trim the name directly, but calling parseSymbolVersion to do it is simpler. This is a follow-up to r331366, since we discovered that lld could append version strings to symbols twice, when using Link Time Optimization.
* Revert r330897:eadler2018-03-29191-515/+135
| | | | | | | | | | | | | | | | | This was intended to be a non-functional change. It wasn't. The commit message was thus wrong. In addition it broke arm, and merged crypto related code. Revert with prejudice. This revert skips files touched in r316370 since that commit was since MFCed. This revert also skips files that require $FreeBSD$ property changes. Thank you to those who helped me get out of this mess including but not limited to gonzo, kevans, rgrimes. Requested by: gjb (re)
* MFC r330654:hselasky2018-03-261-0/+4
| | | | | | | Check that the address is specified in mlx5tool(8). Submitted by: kib@ Sponsored by: Mellanox Technologies
* MFC r330653:hselasky2018-03-264-0/+325
| | | | | | | | | | | | | | | | | | | | | | | Add kernel and userspace code to dump the firmware state of supported ConnectX-4/5 devices in mlx5core. The dump is obtained by reading a predefined register map from the non-destructive crspace, accessible by the vendor-specific PCIe capability (VSC). The dump is stored in preallocated kernel memory and managed by the mlx5tool(8), which communicates with the driver using a character device node. The utility allows to store the dump in format <address> <value> into a file, to reset the dump content, and to manually initiate the dump. A call to mlx5_fwdump() should be added at the places where a dump must be fetched automatically. The most likely place is right before a firmware reset request. Submitted by: kib@ Sponsored by: Mellanox Technologies
* MFC r316422:eadler2018-03-191-16/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove checks that background (bg) colors are not bright and buggy attempts to keep them that way. The bg brightness bit is interpreted as blinking in some modes, but it would barely be useful to disallow setting it when it would give blinking in code which knew when that is. The old code mostly knew this wrong, and added handling errors. It is in fact impossible to know, since future mode switches may change the meaning of the bit many times on the screen and in history. Old versions of vidcontrol disallowed bg color numbers >= 8 in all cases. This is very VGA/syscons-centric. Syscons uses the VGA defaults of blinking fg instead of bright bg in text mode and bright bg in graphics mode. On VGA, this is very easy to toggle at any time, and vt blows away the VGA text mode default at boot time. r146736 changed this to try to allow bg color numbers in graphics mode only. This is even more VGA/syscons-centric, and there are many bugs in this, and many nearby bugs in the parser. These are increased or decreased by differences and bugs in vt and teken. Perhaps the most obvious bug was that almost any vidcontrol command which changes any color or the mode causes an error if the initial fg color is bright. E.g., in syscons text mode, after "vidcontrol lightwhite" to make the fg bright, another "vidcontrol lightwhite" is rejected and buggy fixup code changes the fg to white. This is because the bright fg color creates a bright bg color for the phantom reverse video attribute, so was rejected. (The reverse video attribute is phantom because teken ignores the user's setting of it and simply reverses the fg attributes to create the bg attributes. Sometimes some layer masks off the brightness/blinking bit, but not here.) Perhaps the next most obvious one was that "vidcontrol lightgreen lightblue" was misparsed as 2 settings of the fg instead of 1 setting of the fg and 1 invalid setting of the bg. This is because the parser supports an undocumented syntax with many parsing bugs (an ambiguity gives this one). I recently fix bugs in teken that broke setting of bright fg's and bg's in the normal way. This gave more settings of then, so the old bugs showed up more often.
* MFC r315190:eadler2018-03-181-0/+3
| | | | Add constants and descriptions for some new PCI class definitions
* MFC r327941:eadler2018-03-172-2/+2
| | | | timed: slave is an infinite loop, mark it as such
* MFC r328839:eadler2018-03-171-1/+1
| | | | | | Add the ThinkPad X1 (sandybridge) to the bsdinstall blacklist Reviewed by: AllanJude (for mfc)
* MFC r324441:eadler2018-03-151-2/+8
| | | | | | Fix freebsd-update(8) erroneous message and exit status when "fetch install" used. PR: 190660
* MFC r327474:eadler2018-03-151-0/+1
| | | | | | | | | | bsdinstall: inform users that typing will not be visible Some users, especially those that are new, might be confused when passwd does not echo anything. Inform users that the password will not be visible. PR: 196113
* MFC r303036,r303038,r306822,r307923,:eadler2018-03-159-25/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | makefs: reorder 'usage' alphabetically From NetBSD, Mon Aug 15 14:45:01 2011 +0000 (wiz) Re-order `usage' alphabetically; rename option arguments in the manpage's `SYNOPSIS' section to match those from `usage' (not the other way around; the `usage'-line (and other parts of makefs.c) contain the correct names); minor punctuation improvements. From Snader_LB. makefs.8 1.36 makefs.c 1.30 Obtained from: NetBSD ------------------------------------------------------------------------ r303038 | emaste | 2016-07-19 18:40:54 +0000 (Tue, 19 Jul 2016) | 56 lines makefs: sync NetBSD IDs with upstream for changes that we already have May 22 21:51:39 2011 +0000 (christos): From Nathan Whitehorn (nwhitehorn at freebsd dot org): Add code to generate bootable ISOs on Powermac and CHRP systems. Synthesize some partition maps (APM and MBR, respectively) pointing to (a) the whole disk, and (b) relevant El Torito boot images that have been added by other code. These partition maps are a little bit funny looking, but they seem to work. FreeBSD has been using this successfully in their release generation on powerpc, as well as generating all non-SPARC install media. SPARC support could probably be added as an extension of this patch. makefs.8 1.33 Tue Aug 23 17:09:11 2011 +0000 (christos): PR/45285: Martin Matuska: makefs does not properly convert ISO level 1 and 2 filenames (buffer overflow) makefs does not properly verify the maximum filename length in the special "." case for both ISO level 1 and ISO level 2 filename conversion. This creates broken images or causes a buffer overflow (ISO level 2). ISO level 1: If a filename contains only dots or up to 8 characters followed by dots the 8+3 limit check doesn't work. ISO level 2: If a filename contains a dot in the first 30 characters and a dot on the 30th character, the length limit check doesn't work and the buffer is overflowed. $ mkdir level1 $ touch level1/12345............ $ makefs -t cd9660 -o isolevel=1 test.iso level1 $ mkdir level2 $ touch level2/1234567890.2345678901234567.....34567890123456789012345 $ makefs -t cd9660 -o isolevel=2 test.iso level2 cd9660.c 1.32 Sun Oct 9 21:33:43 2011 +0000 (christos): add support for setting the ufs label. (Nathan Whitehorn) ffs.c 1.45 ffs.h 1.2 mkfs.c 1.22 makefs.8 1.37 Obtained from: NetBSD ------------------------------------------------------------------------ r306822 | emaste | 2016-10-07 19:12:15 +0000 (Fri, 07 Oct 2016) | 4 lines makefs: diff reduction with NetBSD Obtained from: NetBSD usr.sbin/makefs/cd9660.c 1.33 ------------------------------------------------------------------------ r307923 | marcel | 2016-10-25 16:21:38 +0000 (Tue, 25 Oct 2016) | 7 lines Allow building makefs(8) from another Makefile (such as one in a seperate directory hierarchy used to build tools). This boils down to replacing the use of ${.CURDIR} with either ${SRCDIR} or ${SRCTOP}. SRCDIR is defined as the directory in which the Makefile lives that bmake(1) is currently reading. Use SRCTOP when reaching outside of makefs's directory.
* MFC r327580,r327581:eadler2018-03-153-6/+8
| | | | | | | | bits is never null when we call ot. Add an assert to that effect and remove test for NULL. Remove dead code (comma is either 0 or 1 for sure, no need to test). Close /dev/pci when we're done with it.
OpenPOWER on IntegriCloud