1. 19 Jun, 2020 2 commits
    • mckusick's avatar
      The binary representation of the superblock (the fs structure) is written · cfac6b7d
      mckusick authored
      out verbatim to the disk: see ffs_sbput() in sys/ufs/ffs/ffs_subr.c.
      It contains a pointer to the fs_summary_info structure. This pointer
      value inadvertently causes garbage to be stored. It is garbage because
      the pointer to the fs_summary_info structure is the address the then
      current stack or heap. Although a mere pointer does not reveal anything
      useful (like a part of a private key) to an attacker, garbage output
      deteriorates reproducibility.
      This commit zeros out the pointer to the fs_summary_info structure
      before writing the out the superblock.
      Reviewed by:  kib
      Tested by:    Peter Holm
      PR:           246983
      Sponsored by: Netflix
    • mckusick's avatar
      Move the pointers stored in the superblock into a separate · fc56f5d1
      mckusick authored
      fs_summary_info structure. This change was originally done
      by the CheriBSD project as they need larger pointers that
      do not fit in the existing superblock.
      This cleanup of the superblock eases the task of the commit
      that immediately follows this one.
      Suggested by: brooks
      Reviewed by:  kib
      PR:           246983
      Sponsored by: Netflix
  2. 18 Jun, 2020 25 commits
    • karels's avatar
      Add support for bcm54213PE in brgphy. · 7604ae54
      karels authored
      This chip is used in the Rasperry Pi 4, and is supported by the if_genet
      driver. Currently we use the ukphy mii driver, this patch switches over
      to the brgphy mii driver instead. To support the rgmii-rxid phy mode,
      which is now the default in the Linux dtb, we add support for clock
      These changes are taken from OpenBSD and NetBSD, except for the bailout
      in brgphy_bcm54xx_clock_delay() in rgmii mode, which was found necessary
      after testing.
      Submitted by:	Robert Crowston, crowston at protomail.com
      Differential Revision:	https://reviews.freebsd.org/D25251
    • 0mp's avatar
      Document that umount -A does not unmount /dev · 65d71eb4
      0mp authored
      Reported by:	kaktus
      Reviewed by:	kaktus
      MFC after:	1 week
      Differential Revision:	https://reviews.freebsd.org/D25351
    • kib's avatar
      rtld: Apply relro to itself. · 173505d3
      kib authored
      Reviewed by:	emaste
      Sponsored by:	The FreeBSD Foundation
      MFC after:	1 week
      Differential revision:	https://reviews.freebsd.org/D25319
    • kib's avatar
      rtld: Parse own phdr and notes. · 9f4b06e5
      kib authored
      Reviewed by:	emaste
      Sponsored by:	The FreeBSD Foundation
      MFC after:	1 week
      Differential revision:	https://reviews.freebsd.org/D25319
    • kaktus's avatar
      hw.bus.info: rework handler · dafdf787
      kaktus authored
      hw.bus.info was added in r68522 as a node, but there was never anything
      connected "behind" it.  Its only purpose is to return a struct u_businfo.
      The only in-base consumer are devinfo(3)/devinfo(8).
      Rewrite the handler as SYSCTL_PROC and mark it as MPSAFE and read-only
      as there never was a writable path.
      Reviewed by:	kib
      Approved by:	kib (mentor)
      Sponsored by:	Mysterious Code Ltd.
      Differential Revision:	https://reviews.freebsd.org/D25321
    • kib's avatar
      Fix execution of linux binary from multithreaded non-Linux process. · 00d3dff5
      kib authored
      If multithreaded non-Linux process execs Linux binary, then non-Linux
      threads different from the one that execing are cleared by
      single-threading at boundary, and then terminating them in
      post_execve(). Since at that time the process is already switched to
      linux ABI, linuxolator is involved in the thread clearing on boundary,
      but cannot find the emul data.
      Handle it by pre-creating emuldata for all threads in the execing process.
      Also remove a code in linux_proc_exec() handler that cleared emul data
      for other threads when execing from multithreaded Linux process. It is
      PR:	247020
      Reported by:	Martin FIlla <freebsd@sysctl.cz>
      Reported by:	Henrique L. Amorim, Independent Security Researcher
      Reported by:	Rodrigo Rubira Branco (BSDaemon), Amazon Web Services
      Reviewed by:	markj
      Tested by:	trasz
      Sponsored by:	The FreeBSD Foundation
      MFC after:	1 week
      Differential revision:	https://reviews.freebsd.org/D25293
    • dim's avatar
      Merge commit 0cecafd647cc from llvm git (by Alina Sbirlea): · 1263c362
      dim authored
        [BasicAA] Make BasicAA a cfg pass.
        Part of the changes in D44564 made BasicAA not CFG only due to it
        using PhiAnalysisValues which may have values invalidated. Subsequent
        patches (rL340613) appear to have addressed this limitation.
        BasicAA should not be invalidated by non-CFG-altering passes. A
        concrete example is MemCpyOpt which preserves CFG, but we are testing
        it invalidates BasicAA.
        llvm-dev RFC:
        Reviewers: john.brawn, sebpop, hfinkel, brzycki
        Subscribers: hiraditya, llvm-commits
        Tags: #llvm
        Differential Revision: https://reviews.llvm.org/D74353
      This fixes an issue with clang's -fintegrated-cc1 feature, which could
      make it output slightly different assembly code, depending on the way it
      was invoked.
      In r361755 we attempted to work around it by disabling the integrated
      cc1 stage, but it did not solve the root cause for all situations.
      Extensive testing and bisecting showed that the above change finally
      makes the output deterministic, even if -fintegrated-cc1 is on.
      Reported by:	Fabian Keil <fk@fabiankeil.de>
      PR:		246630
      MFC after:	3 days
    • markj's avatar
      Add the SCTP_SUPPORT kernel option. · 864f5d9f
      markj authored
      This is in preparation for enabling a loadable SCTP stack.  Analogous to
      IPSEC/IPSEC_SUPPORT, the SCTP_SUPPORT kernel option must be configured
      in order to support a loadable SCTP implementation.
      Discussed with:	tuexen
      MFC after:	2 weeks
      Sponsored by:	The FreeBSD Foundation
    • mav's avatar
      Make polled request timeout less invasive. · ab4eadd6
      mav authored
      Instead of panic after one second of polling, make the normal timeout
      handler to activate, reset the controller and abort the outstanding
      requests.  If all of it won't happen within 10 seconds then something
      in the driver is likely stuck bad and panic is the only way out.
      In particular this fixed device hot unplug during execution of those
      polled commands, allowing clean device detach instead of panic.
      MFC after:	1 week
      Sponsored by:	iXsystems, Inc.
    • 0mp's avatar
      Fix a typo in cpuset_getdomain.2 · 60e7ca0a
      0mp authored
      PR:		247385
      Reported by:	Paul Floyd <paulf free.fr>
      MFC after:	1 week
    • jkim's avatar
      Remove the unnecessary configure.ac. · 41985a74
      jkim authored
    • jkim's avatar
      MFV: r362286 · 1ba583eb
      jkim authored
      Merge flex 2.6.4.
    • tuexen's avatar
      Whitespace changes, not functional change intended. · 54116fd0
      tuexen authored
      MFC after:		1 week
    • trasz's avatar
      Make audit tests depend on /dev/auditpipe. This should fix · ec92a4bd
      trasz authored
      some 416 failing tests on armv7:
      Reviewed by:	asomers
      MFC after:	2 weeks
      Sponsored by:	DARPA
      Differential Revision:	https://reviews.freebsd.org/D25144
    • fernape's avatar
      split(1): Add EXAMPLES section · bd0833e3
      fernape authored
      Add EXAMPLES covering -d, -n and -p
      Include small explanation about the size of the chunks for the -n option
      Approved by:	0mp
      Differential Revision:	https://reviews.freebsd.org/D25198
    • gbe's avatar
      Add HISTORY sections to banner(6), basename(1), limits(1) and vmstat(8) · 6d4bfdc6
      gbe authored
      Reviewed by:	bcr (mentor)
      Approved by:	bcr (mentor)
      MFC after:	7 days
      Differential Revision:	https://reviews.freebsd.org/D25019
    • gbe's avatar
      fgetln(3): Add a Caveats Section · f02a370f
      gbe authored
      Reviewed by:	yuripv, bcr (mentor)
      Approved by:	bcr (mentror)
      Obtained from:	OpenBSD
      MFC after:	7 days
      Differential Revision:	https://reviews.freebsd.org/D24916
    • 0mp's avatar
      Fix the --guid flag description · 7b76a107
      0mp authored
      MFC after:	2 weeks
    • 0mp's avatar
      Clean up and improve manual page for fuser(1) · c8392f60
      0mp authored
      - Mention option's arguments in the list of options (so that now we mention
        "-N system" instead of just "-N").
      - Stylize signals and other constants like O_APPEND with Dv.
      - Sort options.
      - Change indentation width for readability.
      - Fix a couple of typos.
      - Sort symbols list.
      - Use Sy instead of Cm for symbols. They are not command modifiers.
      - Use Ex -std in the EXIT STATUS section for consistency with other manual
      - Use Ql instead of Dq Li for inline code examples as Li has recently been
        deprecated by mdoc.
      Reviewed by:	bcr
      MFC after:	2 weeks
      Differential Revision:	https://reviews.freebsd.org/D25332
    • 0mp's avatar
      Improve periodic(8) manual page presentation · babfadcf
      0mp authored
      - Update synopsis to present all available arguments.
      - Consistently call the argument specifying an arbitrary directory a
      - Do not put macros into -width argument to Bl. They do not expand there.
      - Stylize command modifiers like "daily" with Cm instead of Pa. While
        technically periodic(8) operates on directories with such names, it is
        confusing from the perspective of the manual page reader as Pa and Ar are
        stylized the same way. Also, I cannot recall a single manual page where
        Pa would be used to describe the syntax of command-line arguments.
      MFC after:	2 weeks
    • fernape's avatar
      tee(1): Add EXAMPLES section · c6a498f5
      fernape authored
      Probably the simplest one ever.
      Approved by:	gbe@, 0mp@
      Differential Revision:	https://reviews.freebsd.org/D25206
    • fernape's avatar
      lockf(1): Add EXAMPLES section · c05e9e0e
      fernape authored
       * Add pretty small EXAMPLES section
       * While here, fix a warning in line 98 (new sentence in new line)
      Approved by:	bcr@
      Differential Revision:	https://reviews.freebsd.org/D25205
    • fernape's avatar
      nl(1): Add EXAMPLES section · ede6b26b
      fernape authored
      Add EXAMPLES section covering flags -b[ap] -n -i -s -v
      Approved by:	bcr@
      Differential Revision:	Add EXAMPLES section covering flags -b[ap] -n -i -s -v
    • andrew's avatar
      Stop assuming we can print rman_res_t with %lx · c23278ac
      andrew authored
      This is not the case on armv6 and armv7, where we also build this driver.
      Fix by casting through uintmax_t and using %jx.
      Sponsored by:	Innovate UK
    • avg's avatar
      hdac_intr_handler: keep working until global interrupt status clears · d8c34981
      avg authored
      It is plausible that the hardware interrupts a host only when GIS goes
      from zero to one.  GIS is formed by OR-ing multiple hardware statuses,
      so it's possible that a previously cleared status gets set again while
      another status has not been cleared yet.  Thus, there will be no new
      interrupt as GIS always stayed set.  If we don't re-examine GIS then we
      can leave it set and never get another interrupt again.
      Without this change I frequently saw a problem where snd_hda would stop
      working.  Setting dev.hdac.1.polling=1 would bring it back to life and
      afterwards I could set polling back to zero.  Sometimes the problem
      started right after a boot, sometimes it happened after resuming from
      S3, frequently it would occur when sound output and input are active
      concurrently (such as during conferencing).  I looked at HDAC_INTSTS
      while the sound was not working and I saw that both HDAC_INTSTS_GIS and
      HDAC_INTSTS_CIS were set, but there were no interrupts.
      I have collected some statistics over a period of several days about how
      many loops (calls to hdac_one_intr) the new code did for a single
      |Loops   |Times Happened|
      |0       |301           |
      |1       |12857746      |
      |2       |280           |
      |3       |2             |
      |4+      |0             |
      I believe that previously the sound would get stuck each time we had to loop
      more than once.
      The tested hardware is:
      hdac1: <AMD (0x15e3) HDA Controller> mem 0xfe680000-0xfe687fff at device 0.6 on pci4
      hdacc1: <Realtek ALC269 HDA CODEC> at cad 0 on hdac1
      No objections:	mav
      MFC after:	5 weeks
      Differential Revision: https://reviews.freebsd.org/D25128
  3. 17 Jun, 2020 13 commits