1. 17 Jul, 2019 16 commits
    • Kirk McKusick's avatar
      The error reported in FS-14-UFS-3 can only happen on UFS/FFS · fdf34aa3
      Kirk McKusick authored
      filesystems that have block pointers that are out-of-range for their
      filesystem. These out-of-range block pointers are corrected by
      fsck(8) so are only encountered when an unchecked filesystem is
      A new "untrusted" flag has been added to the generic mount interface
      that can be set when mounting media of unknown provenance or integrity.
      For example, a daemon that automounts a filesystem on a flash drive
      when it is plugged into a system.
      This commit adds a test to UFS/FFS that validates all block numbers
      before using them. Because checking for out-of-range blocks adds
      unnecessary overhead to normal operation, the tests are only done
      when the filesystem is mounted as an "untrusted" filesystem.
      Reported by:  Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE
      Reported as:  FS-14-UFS-3: Out of bounds read in write-2 (ffs_alloccg)
      Reviewed by:  kib
      Sponsored by: Netflix
    • Kristof Provost's avatar
      riscv: Return vm_paddr_t in pmap_early_vtophys() · cd7795a5
      Kristof Provost authored
      We can't use a u_int to compute the physical address in
      pmap_early_vtophys(). Our int is 32-bit, but the physical address is
      64-bit. This works fine if everything lives in below 0x100000000, but as
      soon as it doesn't this breaks.
      MFC after:	1 week
      Sponsored by:	Axiado
    • Warner Losh's avatar
      Remove now-obsolete comment. · 204498d7
      Warner Losh authored
    • Konstantin Belousov's avatar
      bsearch.3: Improve the example. · 345e740a
      Konstantin Belousov authored
      Submitted by:	fernape
      MFC after:	1 week
      Differential revision:	https://reviews.freebsd.org/D19902
    • Mark Johnston's avatar
      Remove an old warning from UPDATING. · c73bd00a
      Mark Johnston authored
      The clang switchover happened long enough ago that we can
      garbage-collect this note.
      Reviewed by:	emaste, imp
      Differential Revision:	https://reviews.freebsd.org/D20978
    • Mark Johnston's avatar
      Add an initial RELNOTES file. · 8dbc2b6e
      Mark Johnston authored
      The intent is to provide a convenient location to document changes
      that are relevant to users of binary FreeBSD distributions, in contrast
      with UPDATING, which exists to document caveats for users who build
      FreeBSD from source.
      This complements the "Relnotes:" tag in commit messages by providing a
      place to document the change in more detail, or in case a "Relnotes:"
      tag was accidentally omitted.  In particular, "Relnotes:" should be
      used if you do not intend to document the change in RELNOTES for some
      Changes to the file should not be MFCed.  For now the file will exist
      only in head, but may be updated via direct commits to stable branches
      depending on how things go.
      I took the liberty of pre-populating the file with some recent release
      notes-worthy changes.
      Reviewed by:	ian (earlier version)
      Discussed with:	cy, gjb, imp, rgrimes
      Differential Revision:	https://reviews.freebsd.org/D20762
    • Alan Somers's avatar
      F_READAHEAD: Fix r349248's overflow protection, broken by r349391 · 0122532e
      Alan Somers authored
      I accidentally broke the main point of r349248 when making stylistic changes
      in r349391.  Restore the original behavior, and also fix an additional
      overflow that was possible when uio->uio_resid was nearly SSIZE_MAX.
      Reported by:	cem
      Reviewed by:	bde
      MFC after:	2 weeks
      MFC-With:	349248
      Sponsored by:	The FreeBSD Foundation
    • Mark Johnston's avatar
      Remove obsolete compatibility code from rtadvd. · 0660822a
      Mark Johnston authored
      MFC after:	1 week
    • Mark Johnston's avatar
      Fix FASTTRAPIOC_GETINSTR. · 61f2f0ba
      Mark Johnston authored
      This ioctl is used when a breakpoint is encountered while disassembling
      a symbol in the target process.  Since only one DTrace consumer can
      toggle or enumerate fasttrap probes from a given process at time, this
      ioctl does not appear to be used in practice.
    • Mark Johnston's avatar
      Reference stdint.h types in ctf.5. · d6eb9861
      Mark Johnston authored
      MFC after:	1 week
    • Thomas Munro's avatar
      tzsetup: upgrade to zone1970.tab · 513419f4
      Thomas Munro authored
      zone.tab is deprecated.  Install zone1970.tab alongside it, and use it
      for tzsetup(8).  This is also useful for other applications that need
      the modern better maintained file.
      Reviewed by: philip
      Approved by: allanjude (mentor)
      MFC after: 2 weeks
      Differential Revision: https://reviews.freebsd.org/D20646
    • Sean Bruno's avatar
      I add the ability to accept the default pin widget configuration to help · fceeeec7
      Sean Bruno authored
      with various laptops using hdaa(4) sound devices.  We don't seem to know
      the "correct" configurations for these devices and the defaults are far
      superiour, e.g. they work if you don't nuke the default configs.
      PR:	200526
      Differential Revision:	https://reviews.freebsd.org/D17772
    • Chuck Tuffli's avatar
      bhyve: update the NVMe CQ based on the status · 31b67520
      Chuck Tuffli authored
      Instead of skipping the NVMe Completion Queue update based on the
      opcode, define a synthetic status value which indicates the completion
      queue entry is invalid. This will also allow deferred completion queue
      updates for other commands.
      Also returns the correct status for unrecognized opcodes ("invalid
      Reviewed by:	imp, jhb, araujo
      Approved by:	imp (mentor), jhb (maintainer)
      MFC after:	2 weeks
      Differential Revision: https://reviews.freebsd.org/D20945
    • Kevin Lo's avatar
      More follow-up to r350075, I forgot to update ObsoleteFiles. · a19253ba
      Kevin Lo authored
      Spotted by:	lwhsu
    • Kevin Lo's avatar
      Add an MLINK for igb. · ba4ecad9
      Kevin Lo authored
      Discussed with:	lwhsu
    • Kevin Lo's avatar
      Mention iflib(4). · 4d302c1a
      Kevin Lo authored
  2. 16 Jul, 2019 24 commits
    • Kirk McKusick's avatar
      Style. · ba554157
      Kirk McKusick authored
      No change intended.
    • Kirk McKusick's avatar
      When a process attempts to allocate space on a full filesystem, a · 1fd136ec
      Kirk McKusick authored
      filesystem full message is sent to the offending process or the
      kernel log if the offending process cannot be identified.
      To prevent an explotion of messages, the kernel ppsratecheck()
      function is used to limit the messages to one per second. This
      revision changes the variable that tracks the rate of these messages
      from a systemwide limit to a per-filesystem limit by moving it from
      a global variable to a variable in the ufsmount structure.
      Suggested by: kib
      Reviewed by:  kib
      Sponsored by: Netflix
    • John Baldwin's avatar
      Use PT_GET_SC_ARGS and PT_GET_SC_RET in truss. · caa449b6
      John Baldwin authored
      This removes all of the architecture-specific functions from truss.
      A per-ABI structure is still needed to map syscall numbers to names
      and FreeBSD errno values to ABI error values as well as hold syscall
      counters.  However, the linker set of ABI structures is now replaced
      with a simple table mapping ABI names to structures.  This approach
      permits sharing the same ABI structure among separate names such as
      i386 a.out and ELF binaries as well as ELF v1 vs ELF v2 for powerpc64.
      A few differences are visible due to using PT_GET_SC_RET to fetch the
      error value of a system call.  Note that ktrace/kdump have had the
      "new" behaviors for a long time already:
      - System calls that return with EJUSTRETURN or ERESTART will now be
        noticed and logged as such.  Previously sigreturn (which uses
        EJUSTRETURN) would report whatever random value was in the register
        holding errno from the previous system call for example.  Now it
        reports EJUSTRETURN.
      - System calls that return errno as their error value such as
        posix_fallocate() and posix_fadvise() now report non-zero return
        values as errors instead of success with a non-zero return value.
      Reviewed by:	kib
      MFC after:	1 month
      Sponsored by:	DARPA
      Differential Revision:	https://reviews.freebsd.org/D20963
    • Warner Losh's avatar
      Assume that the timeout value from the capacity is 1-based · dc9df3a5
      Warner Losh authored
      Neither the 1.3 or 1.4 standards say this number is 1's based, but adding 1
      costs little and copes with those NVMe drives that report '0' in this field
      cheaply. This is consistent with what the Linux driver does as well.
    • Brooks Davis's avatar
      Add missing mode in open(2) calls with O_CREAT. · 1575a795
      Brooks Davis authored
      When O_CREAT is specified, the third, variadic argument is
      required as the permission. If on is not passed, then depending
      on the ABI, either the contents of the third argument register
      or some arbitrary stuff on the stack will be used as the permission.
      This has been merged to NetBSD.
      Reviewed by:	asomers, ngie
      Obtained from:	CheriBSD
      Sponsored by:	DARPA, AFRL
      Differential Revision:	https://reviews.freebsd.org/D20972
    • Cy Schubert's avatar
      As of upstream fil.c CVS r1.53 (March 1, 2009), prior to the import of · caddc9e3
      Cy Schubert authored
      ipfilter 5.1.2 into FreeBSD-10, the fix for, 2580062 from/to targets
      should be able to use any interface name, moved frentry.fr_cksum to
      prior to frentry.fr_func thereby making this code redundant. After
      investigating whether this fix to move fr_cksum was correct and if it
      broke anything, it has been determined that the fix is correct and this
      code is redundant. We remove it here.
      MFC after:	2 weeks
    • Cy Schubert's avatar
      Refactor, removing one compare. · a422d59f
      Cy Schubert authored
      This changes the return code however the caller only tests for 0 and != 0.
      One might ask then, why multiple return codes when the caller only tests
      for 0 and != 0? From what I can tell, Darren probably passed various
      return codes for sake of debugging. The debugging code is long gone
      however we can still use the different return codes using DTrace FBT
      traces. We can still determine why the compare failed by examining the
      differences between the fr1 and fr2 frentry structs, which is a simple
      test in DTrace. This allows reducing the number of tests, improving the
      code while not affecting our ability to capture information for
      diagnostic purposes.
      MFC after:	1 week
    • Michael Tuexen's avatar
      Fix compilation on platforms using gcc. · e4a5561e
      Michael Tuexen authored
      When compiling RACK on platforms using gcc, a warning that tcp_outflags
      is defined but not used is issued and terminates compilation on PPC64,
      for example. So don't indicate that tcp_outflags is used.
      Reviewed by:		rrs@
      Sponsored by:		Netflix, Inc.
      Differential Revision:	https://reviews.freebsd.org/D20971
    • Warner Losh's avatar
      Implement {io,admin}-passthru commands. · 7d88a2f8
      Warner Losh authored
      These are mostly compatible with Linux, with three exceptions.
      1. We don't do metadata segment stuff. Our passthrough interface
         doesn't cope. The code is there, but generates an error.
      2. Linux lets you specify a namespace ID for the command. We current
         do not: we get ours from the namespace device, or pass in a generic
         one. Generally, this will lead to the same command, but FreeBSD's
         is safer since you can't specify the wrong id.
      3. --show-command outputs to stderr instead of stdout so you can both
         see your command, and capture its output with a simple redirect.
      Differential Revision: https://reviews.freebsd.org/D19296
    • Warner Losh's avatar
      Create generic command / arg parsing routines · f634b4c1
      Warner Losh authored
      Create a set of routines and structures to hold the data for the args
      for a command. Use them to generate help and to parse args. Convert
      all the current commands over to the new format. "comnd" is a hat-tip
      to the TOPS-20 %COMND JSYS that (very) loosely inspired much of the
      subsequent command line notions in the industry, but this is far
      simpler (the %COMND man page is longer than this code) and not in the
      kernel... Also, it implements today's de-facto
      	command [verb]+ [opts]* [args]*
      format rather than the old, archaic TOPS-20 command format :)
      This is a snapshot of a work in progress to get the nvme passthru
      stuff committed. In time it will become a private library and used
      by some other programs in the tree that conform to the above pattern.
      Differential Revision: https://reviews.freebsd.org/D19296
    • Mark Johnston's avatar
      Add a regression test which transfers varying number of rights. · dd8bacfd
      Mark Johnston authored
      This exercises the PKG_MAX_SIZE limit mentioned in r350054.
      MFC after:	1 week
      Sponsored by:	The FreeBSD Foundation
    • Mark Johnston's avatar
      Use a platform-independent constant for PKG_MAX_SIZE. · 07cf2bb6
      Mark Johnston authored
      This constant determines the number of rights libnv will attempt to
      transmit in a given control message.  In practice, the upper limit
      defined by the kernel is machine-dependent and is smaller on 64-bit
      kernels than on 32-bit kernels.  To ensure that a 32-bit libnv works
      as expected when run on a 64-bit kernel, use a limit that will work
      on both 32-bit and 64-bit kernels.
      PR:		238511
      Discussed with:	oshogbo
      MFC after:	3 days
      Sponsored by:	The FreeBSD Foundation
      Differential Revision:	https://reviews.freebsd.org/D20942
    • Mark Johnston's avatar
      Convert the nvlist send/recv tests to ATF. · ccf7f846
      Mark Johnston authored
      MFC after:	1 week
      Sponsored by:	The FreeBSD Foundation
    • Brooks Davis's avatar
      Fix two mismatches between function declaration and definition. · a74dca96
      Brooks Davis authored
      In both cases, function pointer arguments were inconsistently declared
      and the result worked because of C's odd rules around function pointer
      (de)references.  With a stricter compiler these fail to compile.
      Reviewed by:	cem
      Obtained from:	CheriBSD
      Sponsored by:	DARPA, AFRL
      Differential Revision:	https://reviews.freebsd.org/D20964
    • Mark Johnston's avatar
      Chase r350037. · 4fa02959
      Mark Johnston authored
      Reported by:	jenkins
      MFC with:	r350037
      Sponsored by:	The FreeBSD Foundation
    • Eric van Gyzen's avatar
      Adds signal number format to kern.corefile · 9d3ecb7e
      Eric van Gyzen authored
      Add format capability to core file names to include signal
      that generated the core. This can help various validation workflows
      where all cores should not be considered equally (SIGQUIT is often
      intentional and not an error unlike SIGSEGV or SIGBUS)
      Submitted by:	David Leimbach (leimy2k@gmail.com)
      Reviewed by:	markj
      MFC after:	1 week
      Relnotes:	sysctl kern.corefile can now include the signal number
      Sponsored by:	Dell EMC Isilon
      Differential Revision:	https://reviews.freebsd.org/D20970
    • Mark Johnston's avatar
      Always use the software DBM bit for now. · 7af2abed
      Mark Johnston authored
      r350004 added most of the machinery needed to support hardware DBM
      management, but it did not intend to actually enable use of the hardware
      DBM bit.
      Reviewed by:	andrew
      MFC with:	r350004
      Sponsored by:	The FreeBSD Foundation
    • Mark Johnston's avatar
      Fix the arm64 page table entry attribute mask. · 32e09b04
      Mark Johnston authored
      It did not include the DBM or contiguous bits.
      Reported by:	andrew
      Reviewed by:	andrew
      MFC after:	3 days
      Sponsored by:	The FreeBSD Foundation
    • Mark Johnston's avatar
      Propagate attribute changes during demotion. · 9da9cb48
      Mark Johnston authored
      After r349117 and r349122, some mapping attribute changes do not trigger
      superpage demotion. However, pmap_demote_l2() was not updated to ensure
      that the replacement L3 entries carry any attribute changes that
      occurred since promotion.
      Reported and tested by:	manu
      Reviewed by:	alc
      MFC after:	1 week
      Sponsored by:	The FreeBSD Foundation
      Differential Revision:	https://reviews.freebsd.org/D20965
    • Michael Tuexen's avatar
      Add support for ICMPv6 messages indicating a parameter problem related · 1f69b3fb
      Michael Tuexen authored
      to an unrecognized next header.
      MFC after:		2 weeks
    • Michael Tuexen's avatar
      Let packet_op() explicitly return the type and code instead of doing · 64694fdc
      Michael Tuexen authored
      this implicitly by encoding it in a number space.
      No functional change intended.
      This is done as a preparation to add support for ICMPv6 mesages
      indicating a parameter problem related to the next header.
      MFC after:		2 weeks
    • Michael Tuexen's avatar
      Whitespace change. No functional change. · 83c022b5
      Michael Tuexen authored
      MFC after:		2 weeks
    • Andriy Gapon's avatar
      bge: check that the bus is a pci bus before using it as such · a70e114d
      Andriy Gapon authored
      This fixes the following panic on powerpc:
        pci_get_vendor failed for pcib1 on bus ofwbus0, error = 2
      PR:		238730
      Reported by:	Dennis Clarke <dclarke@blastwave.org>
      Tested by:	Dennis Clarke <dclarke@blastwave.org>
      MFC after:	2 weeks
    • Mariusz Zaborski's avatar
      strings: extends rights · 5eac9c1c
      Mariusz Zaborski authored
      The libelf is using mmap if it can, if not it was fall backing to read.
      Reported by:	markj