Commit Graph

17298 Commits

Author SHA1 Message Date
Benjamin Kaduk
fe8b4983b4 Fix mdoc typo in auto_master.5
There needs to be a space after the no-space macro in order for it
to be interpreted.

PR:		221986
Submitted by:	Paul Townsend <pt@zendware.com>
2017-09-01 22:04:45 +00:00
Jung-uk Kim
2f6a1a81bb Merge ACPICA 20170831. 2017-08-31 22:47:04 +00:00
Warner Losh
b0da7c79f1 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
2017-08-31 17:53:50 +00:00
Alexander Motin
d4c2de2e0b Fix flags field decoding in ACPI_NFIT_CONTROL_REGION.
It looked like incomplete copy/paste, printing absolute garbage.

While there, print ValidFields field ax hex, since it is a bitmask.

MFC after:	3 days
2017-08-31 09:08:06 +00:00
Benno Rice
88e2cc9eb5 Replace makefs' hand-rolled unescaping with strunvis
mtree path names and link attributes are encoded, generally using strvis. Newer
versions of mtree will use C-style escapes but previously the accepted form was
octal escapes. makefs' mtree code spots the C-style escapes but fails to deal
with octal escapes correctly.

Remove mtree's escape-decoding code (except for a few instances where it's
needed) and instead pass pathnames and link targets through strunvis prior to
use.

Reviewed by:	marcel
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D12104
2017-08-25 16:10:16 +00:00
Bruce Evans
9bc7c36337 Support setting the colors of cursors for the VGA renderer.
Advertise this by changing the defaults to mostly red.  If you don't like
this, change them (almost) back using:
   vidcontrol -c charcolors,base=7,height=0
   vidcontrol -c mousecolors,base=0[,height=15]

The (graphics mode only) mouse cursor colors were hard-coded to a black
border and lightwhite interior.  Black for the border is the worst
possible default, since it is the same as the default black background
and not good for any dark background.  Reversing this gives the better
default of X Windows.  Coloring everything works better still.  Now
the coloring defaults to a lightwhite border and red interior.

Coloring for the character cursor is more complicated and mode
dependent.  The new coloring doesn't apply for hardware cursors.  For
non-block cursors, it only applies in graphics mode.  In text mode,
the cursor color was usually a hard-coded (dull)white for the background
only, unless the foreground was white when it was a hard-coded black
for the background only, unless the foreground was white and the
background was black it was reverse video.  In graphics mode, it was
always reverse video for the block cursor.  Reverse video is worse,
especially over cutmarking regions, since cutmarking still uses simple
reverse video (nothing better is possible in text mode) and double
reverse video for the cursor gives normal video.  Now, graphics mode
uses the same algorithm as the best case for text mode in all cases
for graphics mode.  The hard-coded sequence { white, black, } for the
background is now { red, white, blue, } where the first 2 colors can
be configured.  The blue color at the end is a sentinel which prevents
reverse video being used in most cases but breaks the compatibility
setting for white on black and black on white characters.  This will
be fixed later.  The compatibility setting is most needed for mono modes.

The previous commit to syscons.c changed sc_cnterm() to be more careful.
It followed null pointers in some cases.  But sc_cnterm() has been
unreachable for 15+ years since changes for multiple consoles turned
off calls to the the cnterm destructor for all console drivers.  Before
them, it was only called at boot time.  So no driver with an attached
console has ever been unloadable and not even the non-console destructors
have been tested much.
2017-08-25 07:04:41 +00:00
Kenneth D. Merry
2d73f7e208 Fix a resource leak in an error case in camdd_buf_sg_create().
Submitted by:	Coverity
CID:		1341622
MFC after:	3 days
Sponsored by:	Spectra Logic
2017-08-23 17:52:49 +00:00
Benno Rice
8e7cd863dd Correct typo in usage string.
Submitted by:	peterpakos (GitHub username)
MFC after:	1 day
2017-08-22 23:55:09 +00:00
Glen Barber
ce5dff88a9 Revert part of r322770 in usr.sbin/chown/tests/chown_test.sh,
which incorrectly adds atf_expect_fail() where there is no
failure case.

MFC after:	3 days
MFC with:	r322770
Sponsored by:	The FreeBSD Foundation
2017-08-22 17:23:29 +00:00
Kenneth D. Merry
988bd0d72b Restructure camdd(8) slightly to make it easier to add support for
additional protocols.

Submitted by:	Chuck Tuffli <chuck@tuffli.net>
MFC after:	1 week
Differential Revision:	D11230
2017-08-22 13:08:22 +00:00
Glen Barber
6e810e514a Apply changes from bin/chmod/tests/chmod_test.sh (r321949, r321950,
and r322101), adding atf_expect_fail() before chflags(8) is invoked
if the filesystem is ZFS, which does not support UF_IMMUTABLE.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2017-08-21 20:23:05 +00:00
Bruce Evans
dd51fceb15 Reduce complexity and backwards compatibilty a little by removing new aliases
and repurposing "blink".  Improve accuracy of documentation of historical
mistakes and other bugs.

"blink" now means "set the blink attribute for the target(s)" instead of
"set the blink attribute and clear other attributes [and control flags]".
It was even more confusing to use "blinking" for the single attribute to
keep the old meaning for "blink".

"destructive" is not as historically broken or gone as the previous version
said.

The bugs involving resetting from defaults are now understood and partly
documented (the defaults are mis-initialized).
2017-08-19 12:14:46 +00:00
Ed Maste
8d2dbd281f pw useradd: Validate the user name before creating the entry
Previouly it was possible to create users with spaces in the name with:
pw useradd -u 1234 -g 1234 -n 'test user'

The "-g 1234" is relevant, without it the name was already rejected
as expected:

[fk@test ~]$ sudo pw useradd -u 1234 -n 'test user'
pw: invalid character ` ' at position 4 in userid/group name

Bug unintentionally found with a salt config without explicit name entry:

test user:
  user.present:
    - uid: 1234
    - gid: 1234
    - fullname: Test user
    - shell: /usr/local/bin/bash
    - home: /home/test
    - groups:
      - wheel
      - salt

"Luckily" salt modules rarely bother with input validation either ...

PR:		221416
Submitted by:	Fabian Keil
Obtained from:	ElectroBSD
MFC after:	1 week
2017-08-19 00:32:26 +00:00
Ed Maste
3dc869c257 pw usermod: Properly deal with empty secondary group lists (-G '')
"pw usermod someuser -G ''" is supposed make sure that someuser
doesn't have any secondary group memberships.

Previouly it was a nop because split_groups() only intitialised
"groups" if at least one group was specified. As a result the
existing secondary group memberships were kept.

PR:		221417
Submitted by:	Fabian Keil
Obtained from:	ElectroBSD
MFC after:	1 week
Relnotes:	yes
2017-08-19 00:19:23 +00:00
Enji Cooper
c78c36cd9c Don't leak bpf on early return when YP isn't defined (NIS support)
MFC after:	1 week
Reported by:	cppcheck
2017-08-17 20:41:28 +00:00
Enji Cooper
c354522292 Fix WARNS
- Remove ad hoc inet_ntoa prototype declaration; it's already handled
  by the included headers.
- De-K&Rify the function prototypes for eachres_whoami(..),
  eachres_getfile(..), and main(..).

MFC after:	1 week
PR:		71667
Tested with:	clang (5.0), gcc (4.2.1, 5)
2017-08-17 20:37:01 +00:00
Bruce Evans
eb4fa1ad8c I misplaced a newline in the previous commit. Fix this, and move line
breaks in the vt case to the same places that the man(1) puts then in
the SYNOPSIS.  This was already done for the syscons case.  Man pages
can't depend on the driver, and the SYNOPSIS is hard-coded for syscons
except for -f where it is hard-coded for vt.  The usage message reverses
this for sc.  The only other differences are whitespace and removing
-[dL] and -l for vt.
2017-08-17 20:25:50 +00:00
Bruce Evans
92dedf1b1b Update vidcontrol -c to support all cursor appearance setting
capabilities.

Most of the capabilities (all of the arcane ones) were in FreeBSD-2.0.5,
but were harder to use then, and vidcontrol didn't try.  FreeBSD-4.1.0
added per-vty support, fixed the destructivness of the "destructive"
cursor, and improved APIs.  Start using the new APIs, support all of
their capabilities, and document all of the capabilities and some of
the historical mistakes.

vt doesn't support any of this before or after the change.

Fix minor unrelated bitrot in the usage message for the syscons case.
2017-08-17 18:08:45 +00:00
Bruce Evans
03096857fd Fix setting of the border color. Teken doesn't support syscons' escape
sequence "ESC [ %d A" for this although that was used here.  I will fix
teken later, but use the more portable ioctl KDSBORDER here.

The ioctl is also much easier to use if you check that it works.  For
-b, check it and complain and exit if it failed, so that it is more
obvious that that vt doesn't support border colors.  Don't check it
when restoring the border color in revert(), since revert() is used
on vt for handling other errors.

Fix nearby error handling and style.  For the error of an invalid
color, revert() and print a specific error message using err() instead
of not revert()ing and printing spam using usage().
2017-08-16 15:14:46 +00:00
Enji Cooper
188e46ab03 Add supporting changes for Add limited sandbox capability to "make check"
Non-tests/... changes:
- Add HAS_TESTS= to Makefiles with libraries and programs to enable iteration
  and propagate the appropriate environment down to *.test.mk.

tests/... changes:
- Add appropriate support Makefile.inc's to set HAS_TESTS in a minimal manner,
  since tests/... is a special subdirectory tree compared to the others.

MFC after:	2 months
MFC with:	r322511
Reviewed by:	arch (silence), testing (silence)
Differential Revision:	D12014
2017-08-14 19:21:37 +00:00
Konstantin Belousov
32cb21c90b Remove confusion in the line explaining syntax of the msr read.
Specify words order in the display.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2017-08-14 11:19:31 +00:00
Vladimir Kondratyev
a9a8884bf9 bthidd(8): Add support for Apple's magic mouse
Note: Mouse's bthidd.conf record should contain vendor and device IDs
to make proper device detection. If it does not contain IDs,
regenerate record with "Query" command of recent bthidcontrol(8).

Submitted by:		Dirk Engling <erdgeist@erdgeist.org>
Reviewed by:		emax
Approved by:		bapt (mentor), gonzo (mentor)
Differential Revision:	https://reviews.freebsd.org/D3702
2017-08-12 21:23:33 +00:00
Vladimir Kondratyev
6032284eb9 bthidd(8): Add support for vendor_id, product_id and version.
Extend bthidd.conf format to store vendor and product IDs of remote
Bluetooth HID devices to make possible implementation of device
specific quirks inside bthidd(8).
Add support for querying of this information from device's SDP records
with bthidcontrol(8) "Query" command.

Submitted by:		Dirk Engling <erdgeist@erdgeist.org>
Reviewed by:		emax
Approved by:		bapt (mentor), gonzo (mentor)
Differential Revision:	https://reviews.freebsd.org/D3702
2017-08-12 21:20:51 +00:00
Ed Maste
a230b8a753 bsdinstall: record DHCP config after obtaining lease
Previously we added an ifconfig_$INTERFACE line to rc.conf for each
unsuccessful DCHP attempt.

PR:		219515
Reviewed by:	allanjude
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D11967
2017-08-10 20:26:07 +00:00
Alexander Motin
fb1cf2a9e5 Add two NFIT fields missed in r321298.
MFC after:	2 weeks
2017-08-10 10:59:05 +00:00
Jeremie Le Hen
ac0ced90e0 rwho/ruptime/rwhod shouldn't be gated by RCMDS.
As peter@ points out in pr/220953:
"rwho, rwhod and ruptime are not part of the remote login suite (rsh, rlogin
etc).

They should *not* be in the rcmds package which is disabled by default.  We
rely on rwho/rwhod/ruptime in the freebsd.org cluster."

This commit is a re-commit of r322029 and r322031 with a better commit log, as
pointed out by ngie@.

This also includes the necesary changes to OptionalObsoleteFiles.inc, as
requested by jhb@.

PR:		220953
Reported by:	peter@, jhb@
Differential Revision:	https://reviews.freebsd.org/D11743
2017-08-08 20:17:07 +00:00
Jeremie Le Hen
eba789dcca Revert r322029 and r322031 so as to recommit them with a better commit log.
PR:		220953
Reported by:	ngie@
2017-08-08 20:07:08 +00:00
Marius Strobl
eabfbad050 Revert the parts of r322097 related to /etc/wall_cmos_clock handling as
the previous behavior actually is required for setting up configurations
in which the RTC is using UTC but the timezone is not. Still, besides
uniform error handling, that file should get the same treatment in the
non-interactive variants supported by tzsetup(8).
2017-08-07 21:38:10 +00:00
Andriy Voskoboinyk
c69b68f502 rfcomm_pppd.8: fix a typo (SPD -> SDP).
MFC after:	3 days
2017-08-06 21:54:43 +00:00
Marius Strobl
4b38286169 - Move creation and unlinking of /etc/wall_cmos_clock from the handling
of the initial UTC dialog to install_zoneinfo() so that file gets the
  necessary treatment also when that dialog is skipped via "-s", when
  selecting UTC from the time zone menu or on the command-line instead
  etc.
- Make the initial UTC dialog actually work by giving the relevant files
  the necessary treatment and then exit when choosing "Yes" there instead
  of moving on to the time zone menu regardless.
- Since r301131, /etc/localtime is also installed when selecting UTC in
  interactive configurations (which previously meant only via the time
  zone menu, though). Thus, the code added in r230298 which treats a
  NULL zone file name as UTC and removes /etc/localtime in that case can
  go again.
- Consistently refer to "could not delete" (as chosen by the oldest such
  code in here) when unlink(2) fails instead of a to mixture of "delete"
  and "unlink" in error messages.
2017-08-05 12:59:03 +00:00
Konstantin Belousov
e28f262a86 Fix off by one in calculation of the number of buckets for the pc
addresses.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D11864
2017-08-04 18:02:54 +00:00
Enji Cooper
7921075587 MFhead@r322057 2017-08-04 17:41:49 +00:00
Jeremie Le Hen
4542ad8688 Remove deprecation notice for ruptime/rwho/rwhod.
PR:		220953
Reported by:	peter
2017-08-03 21:37:57 +00:00
Jeremie Le Hen
881d286b1d rwho/ruptime/rwhod shouldn't be gated by RCMDS.
PR:		220953
Reported by:	peter@
Differential Revision:	https://reviews.freebsd.org/D11743
2017-08-03 21:30:12 +00:00
Enji Cooper
f2381beb2c MFhead@r322021 2017-08-03 17:43:26 +00:00
Navdeep Parhar
f856f099cb cxgbe(4): Initial import of the "collect" component of Chelsio unified
debug (cudbg) code, hooked up to the main driver via an ioctl.

The ioctl can be used to collect the chip's internal state in a
compressed dump file.  These dumps can be decoded with the "view"
component of cudbg.

Obtained from:	Chelsio Communications
MFC after:	2 months
Sponsored by:	Chelsio Communications
2017-08-03 14:43:30 +00:00
Enji Cooper
86cc58dc96 MFhead@r321960 2017-08-02 22:28:12 +00:00
Enji Cooper
d2435d7c28 Require strings(1) with :o_flag_preparer and :o_flag_publisher
strings(1) might not be installed on the system, e.g., if MK_TOOLCHAIN == no

MFC after:	1 week
2017-08-02 20:42:39 +00:00
Enji Cooper
d511b20a69 Add HAS_TESTS to all Makefiles that are currently using the
`SUBDIR.${MK_TESTS}+= tests` idiom.

This is a follow up to r321912.
2017-08-02 08:50:42 +00:00
Enji Cooper
4b330699f8 Convert traditional ${MK_TESTS} conditional idiom for including test
directories to SUBDIR.${MK_TESTS} idiom

This is being done to pave the way for future work (and homogenity) in
^/projects/make-check-sandbox .

No functional change intended.

MFC after:	1 weeks
2017-08-02 08:35:51 +00:00
Marcelo Araujo
4271417a84 Log when we have finished pushing users and groups.
Obtained from:	OpenBSD (rev 1.4)
MFC after:	3 weeks.
2017-08-01 05:26:20 +00:00
Ed Maste
e39a96781e bsdinstall: default to UEFI-only boot on arm64
Reviewed by:	allanjude
Sponsored by:	The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D11721
2017-07-30 23:15:30 +00:00
Ed Schouten
4f6a15dd39 Be a bit more liberal about sysctl naming.
On the systems on which I tested this exporter, I never ran into metrics
that were named in such a way that they couldn't be exported to
Prometheus metrics directly. Now it turns out that on systems with NUMA,
the sysctl tree contains metrics named dev.${driver}.${index}.%domain.
For these metrics, the % in the name is problematic, as Prometheus
doesn't allow this symbol to be used.

Remove the assertions that were originally put in place to prevent the
exporter from generating malformed output and add code to deal with it
accordingly. For metric names, convert any unsupported character to an
underscore. For label values, perform string escaping.

PR:		https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221035
Reported by:	lifanov@
2017-07-29 08:35:07 +00:00
Jung-uk Kim
5f9b24fa43 Merge ACPICA 20170728. 2017-07-28 22:23:29 +00:00
Ryan Libby
07451638fa bhyve/vga.c: fix atc_color_select_67 bit shift
Gcc noticed that the result of the bit shift is always zero.  Shift so
that the ATC_CS_C67 bits end up in bits 6 & 7.

Reviewed by:	grehan, tychon
Approved by:	markj (mentor)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D11775
2017-07-28 21:47:10 +00:00
Ryan Libby
558e4950b3 bhyve/pci_e82545.c: squelch gcc warning for noreturn procedure
Gcc complained that e82545_tx_thread has a return type declared but
doesn't return anything.  Annotate the procedure with _Noreturn.

Reviewed by:	grehan
Approved by:	markj (mentor)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D11774
2017-07-28 21:42:59 +00:00
Sean Bruno
4b5e2f8ea0 binmiscctl should use modfind instead of kldfind
kldfind() only matches kernel modules, so if you link imgact_binmisc directly
into the kernel, binmiscctl can't find it, tries to load it, and errors
out with:
  Can't load imgact_binmisc kernel module: File exists

A quick search of other base commands shows that the correct procedure is to
call modfind(), and then try kldload() if that fails.

PR:		218593
Submitted by:	Dan Nelson <dnelson_1901@yahoo.com>
MFC after:	1 week
2017-07-28 18:11:53 +00:00
Scott Long
99cc4d5177 Fix some broken logic used in obtaining the certain config pages. I'm
surprised that this even pretended to work.

PR:		215793
Submitted by:	longwitz@incore.de
2017-07-27 05:31:48 +00:00
Bartek Rutkowski
391aafd7ab Remove stack guard option from hardening menu.
Since kib's change the stack guard is now ON by default,
this option in hardening menu of bsdinstall is no longer needed.

Submitted by:	Bartlomiej Rutkowski <robak@FreeBSD.org>
Reviewed by:	bapt
Approved by:	bapt
MFC after:	1 day
Sponsored by:	Pixeware LTD
Differential Revision:	https://reviews.freebsd.org/D11686
2017-07-21 08:50:22 +00:00
Ed Maste
cebb7b191c acpidump: add GIC ITS srat type
From ACPI 6.2, 5.2.16.5

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2017-07-20 17:36:17 +00:00
Ed Maste
340c00225f acpidump: add ACPI NFIT (NVDIMM Firmware Interface Table)
Submitted by:	Guangyuan Yang <yzgyyang@outlook.com>
MFC after:	3 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D11479
2017-07-20 17:31:27 +00:00
Ed Maste
27941afae6 acpidump: use C99 designated initializers
Submitted by:	Guangyuan Yang <yzgyyang@outlook.com>
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D11659
2017-07-20 15:52:36 +00:00
Enji Cooper
b024603382 Clean up leading whitespace (convert single column spaces to hard tabs)
MFC after:	now
2017-07-20 00:40:03 +00:00
Rick Macklem
6242e8c886 Update the nfsv4 man page to reflect recent changes to support
the newer RFCs (5661 and 7530). The main man changes are for the
case of "numbers in strings" for user/groups that RFC7530 allows
and avoids use of nfsuserd(8).

This is a content change.

Reviewed by:	trasz (earlier version)
MFC after:	1 week
2017-07-19 20:57:41 +00:00
Enji Cooper
d7938e0594 cron(8) manpage updates
- Document /etc/cron.d and /usr/local/etc/cron.d under FILES.
- Reword documentation for -n: add appropriate soft-stop and remove
  contraction to appease igor.

MFC after:	3 days
2017-07-19 19:53:07 +00:00
Enji Cooper
4555b2ad92 Fix trivial whitespace bug introduced in usage message changes for -n
support (r304570).

MFC after:	now
2017-07-19 19:38:25 +00:00
Mark Johnston
5a3924b985 Allow matches of truncated version strings.
Long objdir paths make it easy to hit the version string length limit in
kernel dump headers. The build number and timestamp are unlikely to be
truncated and ought to be sufficient to protect against false positives.

Discussed with:	jhb
MFC after:	1 week
2017-07-19 18:41:16 +00:00
Ed Maste
2775c1d7d5 bsdinstall: improve checksum mismatch error for snapshots
The usual case of a mismatched checksum for installer snapshots
(e.g., -CURRENT, -ALPHA*) is that a newer snapshot has been built and
the old install sets have been replaced.  Provide a specific error
message for checksum mismatches there that suggests looking for a newer
snapshot.

Submitted by:	Guangyuan Yang <yzgyyang@outlook.com>
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D11641
2017-07-19 18:25:52 +00:00
Ed Maste
9acc904146 bsdinstall: remove EOL whitespace 2017-07-18 23:35:19 +00:00
Navdeep Parhar
8f82718fb2 cxgbetool(8): Add loadboot and loadboot-cfg subcommands to install or
remove bootrom and boot config.

MFC after:	2 weeks
Sponsored by:	Chelsio Communications
2017-07-18 03:58:59 +00:00
Benedict Reuschling
4718651cb3 The ctladm man page incorrectly duplicated the text for the
delete subcommand in the modify section. Rewrite the
modify description text in two places to say modify/modified
instead of remove/removed.

PR:		220710
Submitted by:	sseekamp@risei.net
Reviewed by:	mav@
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D11608
2017-07-15 17:59:28 +00:00
Bryan Drewery
7c2f06da87 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-07-10 23:52:04 +00:00
Rick Macklem
3ab05e8674 Document the changes done to nfsuserd by r320757.
This is a content change.
2017-07-06 22:34:34 +00:00
Rick Macklem
77193c0508 Modify the nfsuserd daemon so that it uses an AF_LOCAL socket for upcalls.
This patch modifies the nfsuserd daemon so that it uses an AF_LOCAL socket
for upcalls by default. This should fix the problem with using a UDP
socket upcall to 127.0.0.1 when jails are used.
The AF_LOCAL socket case only supports a single server daemon, since hangs
were observed by the original problem reporter when multiple daemons
were used.
The patch adds a command line option called "-use-udpsock" which makes
the daemon revert to its prepatched behaviour.

Suggested by:	dfr
PR:		205193
Relnotes:	yes
2017-07-06 22:04:37 +00:00
Ed Maste
f5d0a8f7c7 acpidump: warn and exit loop on invalid subtable length
Submitted by:	Guangyuan Yang <yzgyyang@outlook.com>
Sponsored by:	The FreeBSD Foundation
2017-07-06 14:35:47 +00:00
Bartek Rutkowski
2669f7ebf1 usr.sbin/bsdinstall/scripts/hardening: fix options numbers
Submitted by:	Bartek Rutkowski <robak@FreeBSD.org>
Reviewed by:	bapt
Approved by:	bapt
MFC after:	1 day
Differential Revision:	https://reviews.freebsd.org/D11505
2017-07-06 12:19:15 +00:00
Alexander Motin
321728cef1 Report device descr in addition to ident.
Serial number without device model is somewhat less useful.

MFC after:	2 weeks
2017-07-06 09:05:38 +00:00
Enji Cooper
01df7d10a5 Remove SUBDIR ordering/uniquifying in *bin/Makefile
After the addition of SUBDIR.yes, uniquifying/ordering the SUBDIRs doesn't
make a whole lot of sense, and it's in effect a half measure.

Ordering SUBDIR (after adding SUBDIR.yes to it) in bsd.subdir.mk is a
separate change that warrants more discussion/testing, because while
the SUBDIR_PARALLEL work largely fixed dependency ordering for SUBDIRs,
there might be downstream FreeBSD consumers that rely on the SUBDIR
ordering.

MFC after:	2 months
Reviewed by:	bdrewery
Differential Revision:	D11398
2017-07-06 04:15:30 +00:00
Alexander Motin
1a01f934bf Add naive benchmark for SSDs in ZFS SLOG role.
ZFS SLOGs have very specific access pattern with many cache flushes,
which none of benchmarks I know can simulate.  Since SSD vendors rarely
specify cache flush time, this measurement can be useful to explain why
some ZFS pools are slower then expected.  This test writes data chunks
of different size followed by cache flush, alike to what ZFS SLOG does,
and measures average time.

To illustrate, here is result for 6 years old SATA Intel 710 Series SSD:

Synchronous random writes:
         0.5 kbytes:    138.3 usec/IO =      3.5 Mbytes/s
           1 kbytes:    137.7 usec/IO =      7.1 Mbytes/s
           2 kbytes:    151.1 usec/IO =     12.9 Mbytes/s
           4 kbytes:    158.2 usec/IO =     24.7 Mbytes/s
           8 kbytes:    175.6 usec/IO =     44.5 Mbytes/s
          16 kbytes:    210.1 usec/IO =     74.4 Mbytes/s
          32 kbytes:    274.2 usec/IO =    114.0 Mbytes/s
          64 kbytes:    416.5 usec/IO =    150.1 Mbytes/s
         128 kbytes:    776.6 usec/IO =    161.0 Mbytes/s
         256 kbytes:   1503.1 usec/IO =    166.3 Mbytes/s
         512 kbytes:   2968.7 usec/IO =    168.4 Mbytes/s
        1024 kbytes:   5866.8 usec/IO =    170.5 Mbytes/s
        2048 kbytes:  11696.6 usec/IO =    171.0 Mbytes/s
        4096 kbytes:  23329.6 usec/IO =    171.5 Mbytes/s
        8192 kbytes:  46779.5 usec/IO =    171.0 Mbytes/s

, and much newer and supposedly much faster NVMe Samsung 950 PRO SSD:

Synchronous random writes:
         0.5 kbytes:   2092.9 usec/IO =      0.2 Mbytes/s
           1 kbytes:   2013.1 usec/IO =      0.5 Mbytes/s
           2 kbytes:   2014.8 usec/IO =      1.0 Mbytes/s
           4 kbytes:   2090.7 usec/IO =      1.9 Mbytes/s
           8 kbytes:   2044.5 usec/IO =      3.8 Mbytes/s
          16 kbytes:   2084.8 usec/IO =      7.5 Mbytes/s
          32 kbytes:   2137.1 usec/IO =     14.6 Mbytes/s
          64 kbytes:   2173.4 usec/IO =     28.8 Mbytes/s
         128 kbytes:   2923.9 usec/IO =     42.8 Mbytes/s
         256 kbytes:   3085.3 usec/IO =     81.0 Mbytes/s
         512 kbytes:   3112.2 usec/IO =    160.7 Mbytes/s
        1024 kbytes:   2430.6 usec/IO =    411.4 Mbytes/s
        2048 kbytes:   3788.9 usec/IO =    527.9 Mbytes/s
        4096 kbytes:   6198.0 usec/IO =    645.4 Mbytes/s
        8192 kbytes:  10764.9 usec/IO =    743.2 Mbytes/s

While the first one obviously has maximal throughput limitations, the
second one has so high cache flush latency (about 2 millisecond), that
it makes one almost useless in SLOG role, despite of its good throughput
numbers.  Power loss protection is out of scope of this test, but I
suspect it can be related.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2017-07-05 16:20:22 +00:00
Bartek Rutkowski
82ec242f2e Add option to bsdinstall to disable insecure console, update stack guard option
This patch adds new bsdinstall option to hardening section that allows users
to change this behaviour to secure one and updates stack guard option so it
would set the value of relevant sysctl to 512 (2MB)

Submitted by:	Bartek Rutkowski
Reviewed by:	adrian, bapt, emaste
Approved by:	bapt, emaste
MFC after:	1 day
Sponsored by:	Pixeware LTD
Differential Revision:	https://reviews.freebsd.org/D9700
2017-07-05 13:37:27 +00:00
Rick Macklem
2ced567240 Add a Bugs section that indicates that the nfsuserd doesn't work
when jails are being used on the system.
It is hoped that the patches in PR#205193 will someday get tested/debugged
so that they can be committed to fix this.

This is a content change.

PR:		205193
MFC after:	2 weeks
2017-07-04 22:20:30 +00:00
Allan Jude
1f3f7ac7ba Add deprecation notices for all rcmd tools
Submitted by:	bcr
Reviewed by:	emaste, bapt, jhl
MFC after:	immediate
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D11471
2017-07-04 15:44:30 +00:00
Allan Jude
875a1f776c diskinfo(8): correct typo in man page
Reported by:	N.J. Mann <njm@njm.me.uk>
2017-07-02 16:20:49 +00:00
Allan Jude
278a04f5c8 Add -s (serial) and -p (physpath) to diskinfo
Return the bare requested information, intended for scripting.

The serial number of a SAS/SCSI device can be returned with
'camcontrol inquiry disk -S', but there is no similar switch for SATA.

This provides a way to get this information from both SAS and SATA disks

the -s and -p flags are mutually exclusive, and cannot be used with any
other flags.

Reviewed by:	rpokala, wblock
MFC after:	1 month
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D7828
2017-07-01 21:34:57 +00:00
Baptiste Daroussin
d25c1ff64f Add libxo(3) support to sesutil(8)
This is useful to simplify parsing "sesutil map"

Submitted by:	nikita.kozlov@blade-group.com
MFC after:	3 weeks
Relnotes:	yes
Sponsored by:	blade
2017-06-29 18:52:36 +00:00
Steve Wills
d8061eff49 Add hardening menu item for security.bsd.see_jail_proc
Approved by:		allanjude
Differential Revision:	https://reviews.freebsd.org/D11283
2017-06-29 16:39:55 +00:00
Xin LI
97e832c1da Chase malloc() change by removing lg_chunk malloc_conf settings.
In jemalloc 5, there are no longer chunks, and as configured on
FreeBSD (the "retain" option defaults to false), the mmap()
requests are precisely sized for the specific needs, which means
the virtual memory overhead should be lower for small applications.

Reviewed by:	jasone, ian
Differential Revision:	https://reviews.freebsd.org/D11366
2017-06-28 04:19:54 +00:00
Ed Maste
0661ef2af2 makefs: add copies of NetBSD makefs msdos source files
We do not treat makefs as contrib code.  Import copies of makefs msdos
files from NetBSD so that we can track our changes to these files.

These are copied from NetBSD, with only a change to use __FBSDID and
$FreeBSD$ instead of __KERNEL_RCSID and $NetBSD$.  A copy of the
original $NetBSD$ tag remains in each source file.

These two files were missed in r320212.  Also remove a stray blank line
added in msdosfs_vfsops.c.

Submitted by:	Siva Mahadevan
Sponsored by:	The FreeBSD Foundation
2017-06-23 18:58:28 +00:00
Baptiste Daroussin
4d17a48343 sesutil no longer depends on libsbuf
Sponsored by:	Gandi.net
2017-06-23 15:27:23 +00:00
Baptiste Daroussin
20a957e37a Directly print the extra status instead of filling a buffer
then printing it.

This prepares the code to make it libxo friendly

Reviewed by:	manu, Nikita Kozlov (nikita elyzion.net)
MFC after:	2 weeks
Sponsored by:	Gandi.net
2017-06-23 15:09:08 +00:00
Baptiste Daroussin
b556669269 Do not use sprintf(3) when not needed, while here,
prefer snprintf(3) over sprintf(3)
2017-06-23 13:26:13 +00:00
Ed Maste
237d1b14f2 makefs: add copies of NetBSD makefs msdos source files
We do not treat makefs as contrib code.  Import copies of makefs msdos
files from NetBSD so that we can track our changes to these files.

These are copied from NetBSD, with only a change to use __FBSDID and
$FreeBSD$ instead of __KERNEL_RCSID and $NetBSD$.  A copy of the
original $NetBSD$ tag remains in each source file.

Submitted by:	Siva Mahadevan
Sponsored by:	The FreeBSD Foundation
2017-06-22 02:46:36 +00:00
Andriy Gapon
6589ee29df bhyveload: correctly query size of disks
On FreeBSD fstat(2) works fine for querying sizes of plain files,
but not so much for character devices.
So, use DIOCGMEDIASIZE to try to get the correct size for disks
and disk-like devices (e.g. zvols).

PR:		220186
Reviewed by:	tsoome, grehan
MFC after:	1 week
2017-06-21 18:19:27 +00:00
Xin LI
8a3cd533f1 Reduce code duplication in rpc.lockd.
Reuse create_service code instead of duplicating it in
lookup_addresses for kernel NLM.

As a (good) side effect this also fixed a few issues that were
already fixed in the former but never applied to the latter.

Reviewed by:	kevlo
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D11259
2017-06-21 06:34:06 +00:00
Alan Somers
6bd94a4679 Fix usr.sbin/makefs/makefs_ffs_tests when /etc/fstab does not exist
dumpfs prints a harmless warning message (via ufs_disk_fillout(3) and
getfsfile(3)), when /etc/fstab does not exist.  We can ignore it.

PR:		220165
Reported by:	gjb
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
2017-06-20 19:00:55 +00:00
Andriy Gapon
d6609e6a12 fstyp: move sys/ include path after zfs include paths
The reason is that FreeBSD refcount.h shadows ZFS refcount.h and that
will lead to a build error after a planned import of the ARC buf data
scatter-ization.
It's possible that some day we will have an opposite problem where
a ZFS header would shadow an essential FreeBSD header.
So, we need to think about a better long term solution.

Discussed with:	allanjude
MFC after:	17 days
2017-06-20 16:45:48 +00:00
Steven Hartland
98b9d3847d Fixed bsdinstall location of vfs.zfs.min_auto_ashift
vfs.zfs.min_auto_ashift is a sysctl only not a tunable so updated bsdinstall
to use the correct location /etc/sysctl.conf instead of /boot/loader.conf

Reported by:	Aaron Caza
Reviewed by:	allanjude
MFC after:	2 days
Sponsored by:	Multiplay
Differential Revision:	https://reviews.freebsd.org/D11278
2017-06-20 08:03:50 +00:00
Enji Cooper
84c8bb4fbc periodic(8): delete trailing whitespace
MFC after:	1 month
2017-06-20 06:20:09 +00:00
Bryan Drewery
c99b67a794 Utilize SYSROOT from r320119 in places where DESTDIR may be wanting WORLDTMP.
Since buildenv exports SYSROOT all of these uses will now look in
WORLDTMP by default.

sys/boot/efi/loader/Makefile
        A LIBSTAND hack is no longer required for buildenv.

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-06-19 20:47:24 +00:00
Xin LI
df9abd97ac Check return value of seteuid() and bail out if we fail.
MFC after:	2 weeks
2017-06-19 07:02:52 +00:00
Sean Bruno
4c26331158 Quiesce clang warning while building lpc.
usr.sbin/lpr/lpc/lpc.c
  Warning
    passing 'char *[20]' to parameter of type 'const char **' discards
    qualifiers in nested pointer types
    [-Wincompatible-pointer-types-discards-qualifiers]
  Fix:
     Explicitly cast the variable "margv" to const char ** only for it's
     use as a parameter to suppress the error

Submitted by:	Aaron Prieger <aprieger@llnw.com>
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D11019
2017-06-16 20:00:39 +00:00
Ed Maste
c0fcb86aee bsdinstall: correct comment after r320007
Submitted by:	vangyzen
2017-06-16 19:26:33 +00:00
Ed Maste
4ca43ae5f2 bsdinstall: use consistent EFI configuration across platforms
- increase arm64 EFI partition to 200M, as x86
- use EFI_BOOTPART_SIZE and EFI_BOOTPART_PATH macros on x86
- increase ZFS EFI partition to 200M

PR:		201898
Reviewed by:	allanjude, manu
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D11239
2017-06-16 18:58:48 +00:00
Marcelo Araujo
daaa9bf1df Check if pthread_create(3) successfully created the thread prior to call
pthread_join(3). The variable tid is not yet initialized in case
the authentication fails at early stage, that would lead pthread_join be
called with an uninitialized variable.

CID:		1375950
Reported by:	Coverity, cem
Reviewed by:	cem
MFC after:	3 weeks.
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D11150
2017-06-16 01:26:01 +00:00
Marcelo Araujo
bd4862e596 Use nitems() from sys/param.h.
MFC after:	4 weeks.
2017-06-15 06:48:36 +00:00
Marcelo Araujo
d42456e128 Use nitems() from sys/param.h.
MFC after:	4 weeks.
2017-06-15 06:46:40 +00:00
Marcelo Araujo
426729f77f Initialize variables and use byteorder(9) instead of aliasing char array
buf via uint32_t pointer.

CID:		1375949
Reported by:	Coverity, cem
Reviewed by:	cem
MFC after:	3 weeks
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D11153
2017-06-15 06:21:01 +00:00
Glen Barber
1a20115c11 Modernize FreeBSD version numbers in freebsd-update(8).
While here, expand a contraction to make textproc/igor happy.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2017-06-14 18:34:22 +00:00
Allan Jude
3735bba384 bsdinstall: support Auto ZFS mode for ARM64
Reported by:	Shawn Webb
MFC after:	3 days
2017-06-12 19:31:26 +00:00
Allan Jude
46c380e6db bsdinstall: Make ZFS min_auto_ashift adjustment persistent
Reported by:	feld
Reviewed by:	dteske, tsoome
MFC after:	3 days
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D10895
2017-06-12 19:29:31 +00:00