Commit Graph

18015 Commits

Author SHA1 Message Date
Ed Maste
0d5c5243af freebsd-update: Clarify unsupported release upgrade error message
Notify users that upgrading from -CURRENT or -STABLE is unsupported by
freebsd-update.

Also ensure --currently-running provides a correctly formatted release
(as done by -r).

PR:		234771
Submitted by:	Gerald Aryeetey <aryeeteygerald_rogers.com>
Reported by:	yuri
Reviewed by:	bcran
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18803
2019-01-17 21:38:57 +00:00
Edward Tomasz Napierala
50d503b781 Workaround for nscd(8) failure with large entries.
It fixes a case where eg a 2KB group entry would take several seconds
to complete with cache enabled in nsswitch.conf.

MFC after:	2 weeks
Sponsored by:	Chalmers University of Technology
Differential Revision:	https://reviews.freebsd.org/D18392
2019-01-17 20:01:06 +00:00
Eugene Grosbein
2b5691ee44 Re-add new small tool trim(8) to delete contents for blocks
on devices using wear-leveling algorithms as a few weeks passed
after review and discussion of trim(8) ceased and
we still have no utility to perform the job.

Reviewed by:	hackers@
MFC after:	2 weeks
2019-01-17 18:07:59 +00:00
Eugene Grosbein
bd24e861b4 jail(8): stop crashing with SIGSEGV inside run_command() function
while processing not entirely correct jail.conf(5) file
having something like "ip4.addr = 127.0.0.1;" and no "ip4 = ...;"
so extrap variable stays NULL.

Reported by:	marck
MFC after:	1 month
2019-01-17 14:09:55 +00:00
Marcelo Araujo
73f6ccd9e7 Fix broken uart on Win2016 guest.
Obtained from:	Joyent (commit/2bf1a940afbd1382faff159e7c93c72779ca10f4)
MFC after:	3 weeks.
2019-01-16 03:46:27 +00:00
Marcelo Araujo
abfa3c39e7 Use capsicum_helpers(3) that allow us to simplify the code and its functions
will return success when the kernel is built without support of
the capability mode.

It is important to note, that I'm taking a more conservative approach
with these changes and it will be done in small steps.

Reviewed by:	jhb
MFC after:	6 weeks
Differential Revision:	https://reviews.freebsd.org/D18744
2019-01-16 00:39:23 +00:00
Lars Engels
e1bd727904 This new version of bluetooth-config.sh tries to follow the style of other
shell scripts in base, removes the bogus "copyleft", adds the BeerWare license
header and uses rc.subr(8) new 'enable' keyword for adding entries in
rc.conf(5).

Submitted by:	erdgeist <erdgeist@erdgeist.org>
Approved by:	bapt
MFC after:	2 weeks
2019-01-14 08:23:47 +00:00
Baptiste Daroussin
baf46d717b Fix duplication.
The patch adding the manpage was probably applied twice, so it resulted
in duplication of the manpage
2019-01-11 16:18:23 +00:00
Lars Engels
0fc0faf846 Add bluetooth-config script to simplify setting up bluetooth connections to
devices like mice, keyboards, bt-audio, ...

This script currently allows scanning for nearby devices, adds one to
/etc/bluetooth/hosts, adds an entry to hcsecd's conf and if it is a HID, add an
entry to bthidd's configs, as well.

Submitted by:	erdgeist <erdgeist@erdgeist.org>
Approved by:	bapt
MFC after:	2 weeks
Differential Revision:	D3778
Reviewers:	bapt, emax
2019-01-11 15:52:09 +00:00
Rodney W. Grimes
7d9545fcc0 Fix spelling of identifier
Approved by:	phk (mentor)
MFC after:	3 days
2019-01-11 14:21:59 +00:00
Konstantin Belousov
e4e0dad424 cpucontrol: check for the supposed firmware file type and skip
non-regular entry.

do_update() skips entries with DT_DIR type.  This does not eliminate
other entries that might exist in the directory.  More, since NFS
might fill d_type with DT_UNKNOWN, dot and dotdot entries are not
skipped, then mmap(2) call failed for them when update microcode files
are located on NFS.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2019-01-11 08:35:49 +00:00
Andriy Voskoboinyk
5c81ba5ade powerd(8): allow to force a method of battery state query
This change allows to determine power source via sysctl or /dev/apm
when devd(8) is running (used by default).

Based on patch from PR; other changes on top of it:
- '-f' (force) -> '-s' (source) parameter renaming;
- allow 'apm' -> 'devd' transition when '-s devd' is set
(if APM is enabled);
- man page update.

Checked on amd64 with -s devd / sysctl and apm
(an extra build with forced USE_APM define set was done)

PR:		125707
Submitted by:	Konstantin Stepanov <milezv@yandex.ru>
Reviewed by:	bcr, imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D18742
2019-01-06 02:39:03 +00:00
Mark Johnston
04e9edb544 Capsicumize rtsol(8) and rtsold(8).
These programs parse ND6 Router Advertisement messages; rtsold(8) has
required an SA, SA-14:20.rtsold, for a bug in this code.  Thus, they
are good candidates for sandboxing.

The approach taken is to run the main executable in capability mode
and use Casper services to provide functionality that cannot be
implemented within the sandbox.  In particular, several custom services
were required.

- A Casper service is used to send Router Solicitation messages on a
  raw ICMP6 socket.  Initially I took the approach of creating a
  socket for each interface upon startup, and connect(2)ing it to
  the all-routers multicast group for the interface.  This permits
  the use of sendmsg(2) in capability mode, but only works if the
  interface's link is up when rtsol(d) starts.  So, instead, the
  rtsold.sendmsg service is used to transmit RS messages on behalf
  of the main process.  One could alternately define a service
  which simply creates and connects a socket for each destination
  address, and returns the socket to the sandboxed process.  However,
  to implement rtsold's -m option we also need to read the ND6 default
  router list, and this cannot be done in capability mode.
- rtsold may execute resolvconf(8) in response to RDNSS and DNSSL
  options in received RA messages.  A Casper service is used to
  fork and exec resolvconf(8), and to reap the child process.
- A service is used to determine whether a given interface's
  link-local address is useable (i.e., not duplicated or undergoing
  DAD).  This information is supplied by getifaddrs(3), which reads
  a sysctl not available in capability mode.  The SIOCGIFCONF socket
  ioctl provides equivalent information and can be used in capability
  mode, but I decided against it for now because of some limitations
  of that interface.

In addition to these new services, cap_syslog(3) is used to send
messages to syslogd.

Reviewed by:	oshogbo
Tested by:	bz (previous versions)
MFC after:	2 months
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D17572
2019-01-05 16:05:39 +00:00
Chuck Tuffli
fbac7e0ba2 Fix bhyve's NVMe Completion Queue entry values
The function which processes Admin commands was not returning the
Command Specific value in Completion Queue Entry, Dword 0 (CDW0). This
effects commands such as Set Features, Number of Queues which returns
the number of queues supported by the device in CDW0. In this case, the
host will only create 1 queue pair (Number of Queues is zero based).
This also masked a bug in the queue counting logic.

Reviewed by: imp, araujo
Approved by: imp (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D18703
2019-01-04 15:03:35 +00:00
Chuck Tuffli
76e47b9420 Fix bhyve's NVMe queue bookkeeping
Many size / length parameters in NVMe are "0's based", meaning, a value
of 0x0 represents 1, 0x1 represents 2, etc.. While this leads to an
efficient encoding, it can lead to subtle bugs. With respect to queues,
these parameters include:
 - Maximum number of queue entries
 - Maximum number of queues
 - Number of Completion Queues
 - Number of Submission Queues

To be consistent, convert all 0's based values from the host to 1's
based value internally. Likewise, covert internal 1's based values to
0's based values when returned to the host. This fixes an off-by-one bug
when creating IO queues and simplifies some of the code. Note that this
bug is masked by another bug.

While in the neighborhood,
 - fix an erroneous queue ID check (checking CQ count when deleting SQ)
 - check for queue ID of 0x0 in a few places where this is illegal
 - clean up the Set Features, Number of Queues command and check for
   illegal values

Reviewed by: imp, araujo
Approved by: imp (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D18702
2019-01-04 15:03:30 +00:00
Rebecca Cran
70de14d82f Update the efibootmgr(8) man page to document changes to options. 2019-01-01 04:57:46 +00:00
Rebecca Cran
7e02f8b30a Use the --activate efibootmgr(8) flag when creating entries in bootconfig
Sponsored by:	Netflix
2018-12-31 00:26:35 +00:00
Rebecca Cran
5fa62a9335 Fix ESP generation when using a gmirror, and when booting from RO medium
When using a gmirror, entries in /dev can be removed. So instead of using
kern.disks, get the list of disks from "gpart status -sg" instead.

We assume that any 'efi' partition that can't be mounted as msdosfs should
be used as an ESP. However, the ESP on the CD/DVD can't be mounted read-write
and so was being treated as if unformatted. Try the mount as read-only
instead, to catch cases like this.

Relnotes: yes
Sponsored by: Netflix
Differential Revision:	https://reviews.freebsd.org/D18645
2018-12-31 00:20:58 +00:00
Rebecca Cran
9ed0802914 Change the way efibootmgr works by specifying bootnum via -b parameter
Instead of passing the bootnum to each different parameter, require users
to specify -b when running operations that need a bootnum.

This allows activation of a new boot entry at the same time it's created
by adding -a onto the command line.

Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D18648
2018-12-31 00:09:45 +00:00
Rebecca Cran
557a5ad425 Improve the efibootmgr(8) man page
Fix formatting, typos, and attempt to improve the wording.

Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D18646
2018-12-28 21:26:45 +00:00
Chris Rees
488ded9168 There is no way of escaping literal $ signs in auto_master(5), which
makes for difficulty with hidden Samba shares; shares with $ at the end
of their name.  This enables the use of ${DOLLAR} to work around this.

Reviewed by:		bcr (man page)
Approved by:		trasz
Differential Revision:	https://reviews.freebsd.org/D7048
2018-12-28 15:11:22 +00:00
Alexey Dokuchaev
2cb73efc0d Amend the `-i batt' option description and explain that the battery
is specified by its number (index), starting with zero.  Previously,
sometimes users would try to literally invoke `acpiconf -i batt' in
their console and become confused as to why this did not work.

Approved by:		bcr (manpages)
Differential Revision:	https://reviews.freebsd.org/D18659
2018-12-27 08:48:54 +00:00
Rebecca Cran
a2581e8021 Activate support for efibootmgr(8) -b --bootnum parameter
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D18647
2018-12-24 15:38:36 +00:00
Kyle Evans
ac0a7e2a3c config(8): Remove all instances of an option when opting out
Quick follow-up to r342362: options can appear multiple times now, so
clean up all of them as needed. For non-OPTIONS options, this has no effect
since they're already de-duplicated.

MFC after:	1 week
X-MFC-With:	r342362
2018-12-22 06:08:06 +00:00
Kyle Evans
993e5c4fd2 config(8): Allow duplicate options to be specified
config(8)'s option handling has been written to allow duplicate options; if
the value changes, then the latest value is used and an informative message
is printed to stderr like so:

/usr/src/sys/amd64/conf/TEST: option "VERBOSE_SYSINIT" redefined from 0 to 1

Currently, this is only a possibility for cpu types, MAXUSERS, and
MACHINE_ARCH. Anything else duplicated in a config file will use the first
value set and error about duplicated options on subsequent appearances,
which is arguably unfriendly since one could specify:

include GENERIC
nooptions VERBOSE_SYSINIT
options VERBOSE_SYSINIT

to redefine the value later anyways.

Reported by:	mmacy
MFC after:	1 week
2018-12-22 06:02:34 +00:00
Alexander Motin
1f03d0bae1 Fix passing wrong variables to nvlist_destroy() after r333446.
Reported by:	Alexander Fedorov (IT-Grad.ru)
MFC after:	5 days
2018-12-21 17:22:15 +00:00
Rebecca Cran
db8b561345 Rework UEFI ESP generation
Currently, the installer uses pre-created 800KB FAT12 filesystems that
it dd's onto the ESP partition.
This changeset improves that by having the installer generate a FAT32
filesystem directly onto the ESP using newfs_msdos and then copying
loader.efi into /EFI/freebsd.
For live installs it then runs efibootmgr to add a FreeBSD boot entry
in the BIOS.

Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D17947
2018-12-20 19:39:37 +00:00
Marcin Wojtas
c97ed06a4b Fix alignment issue in uefisign
The pe_certificate structure has to be aligned to 8 bytes. [1]
Since this is now checked in edk2, any binaries signed with
older version of this tool will fail verification.

References:
[1] https://docs.microsoft.com/en-us/windows/desktop/Debug/pe-format#the-attribute-certificate-table-image-only

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: trasz
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D18554
2018-12-19 22:47:37 +00:00
Mateusz Guzik
405c3050f1 Remove iBCS2, part1: userspace
iBCS2 was disconnected from the build in 2015 (see r291419)

bsdconfig parts submitted by dteske.

Reviewed by:	kib (previous version)
Sponsored by:	The FreeBSD Foundation
2018-12-19 21:56:54 +00:00
Eugene Grosbein
3398cc6839 periodic/weekly/340.noid: do not use sysrc(8) that depends
on bsdinstall(8) and may be non-functional
for system built WITHOUT_BSDINSTALL. (*)

Also, add a check for jails sharing whole tree with host (path=/)
and do not skip it.

Reported by:	Andre.Albsmeier@siemens.com (*)
MFC after:	1 week
2018-12-15 23:20:08 +00:00
George V. Neville-Neil
53fc043d41 Remove, the now very outdated, timed.
Submitted by:	Kyle Spiers ksspiers at gmail
Reviewed by:	bcr,brooks,bz,sbruno
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D18505
2018-12-15 21:34:40 +00:00
Stefan Eßer
385e98080c Remove CTM from 13-CURRENT after the release of FreeBSD-12.0.
The removal (and creation of a port) has been pre-announced in UPDATING
1 month ago. Packages are available for all supported FreeBSD vesions.

I did not think that another entry in UPDATING is required to note the
actual removal.

No MFC is planned - CTM shall be kept in base for all releases up to 12.x.

Reviewed by:	rgrimes
Approved by:	imp, bcr (manpages)
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D17935
2018-12-15 16:53:15 +00:00
Emmanuel Vadot
50a123aad8 pwm(8): Add percentage value support for duty cycle 2018-12-14 18:38:10 +00:00
Emmanuel Vadot
6a9997ed67 pwm: Convert period and duty to unsigned int
We don't need a 64 bits value to store nanoseconds

Discused with:	ian, jhibbits
2018-12-14 18:37:26 +00:00
Emmanuel Vadot
d9848bd254 pwm: Fix some arches by using %ju and casting to uintmax_t
Reported by:	ci.freebsd.org
2018-12-12 21:25:52 +00:00
Emmanuel Vadot
9312900f6d Add a pwm subsystem so we can configure pwm controller from kernel and userland.
The pwm subsystem consist of API for PWM controllers, pwmbus to register them
and a pwm(8) utility to talk to them from userland.

Reviewed by:	oshgobo (capsicum), bcr (manpage), 0mp (manpage)
Differential Revision:	https://reviews.freebsd.org/D17938
2018-12-12 20:56:56 +00:00
Cy Schubert
b2d7ecdd54 Set default ciphers.
Submitted by:	jkim@
2018-12-12 05:18:53 +00:00
Alexander Motin
49f8782283 Allow CTL device specification in bhyve virtio-scsi.
There was a large refactoring done in CTL to allow multiple ioctl frontend
ports (and respective devices) to be created, particularly for bhyve.
Unfortunately, respective part of bhyve functionality got lost somehow from
the original virtio-scsi commit.  This change allows wanted device path to
be specified in either of two ways:
 -s 6,virtio-scsi,/dev/cam/ctl1.1
 -s 6,virtio-scsi,dev=/dev/cam/ctl2.3
If neither is specified, the default /dev/cam/ctl device is used.

While there, remove per-queue CTL device opening, which makes no sense at
this point.

Reported by:	wg
Reviewed by:	araujo
MFC after:	3 days
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D18504
2018-12-11 20:47:00 +00:00
Cy Schubert
85732ac8bc MFV r341618:
Update wpa 2.6 --> 2.7.
2018-12-09 06:45:49 +00:00
Alexander Motin
6810fd0acf Make virtio-scsi pass SCSI Task Attributes to CTL.
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
2018-12-07 20:55:29 +00:00
Alexander Motin
99fa47de81 Fix several iov handling bugs in bhyve virtio-scsi backend.
- buf_to_iov() does not use buflen parameter, allowing out of bound read.
 - buf_to_iov() leaks memory if seek argument > 0.
 - iov_to_buf() doesn't need to reallocate buffer for every segment.
 - there is no point to use size_t for iov counts, int is more then enough.
 - some iov function arguments can be constified.
 - pci_vtscsi_request_handle() used truncate_iov() incorrectly, allowing
   getting out of buffer and possibly corrupting data.
 - pci_vtscsi_controlq_notify() written returned status at wrong offset.
 - pci_vtscsi_controlq_notify() leaked one buffer per event.

Reported by:	wg
Reviewed by:	araujo
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D18465
2018-12-07 20:30:00 +00:00
Alexander Motin
9ce46e8107 Fill initid explicitly on requests.
Unfortunately ctl_scsi_zero_io() wipes that field, so it was always zero.
While there, targ_port is set by kernel, so user-space should not fill it.

MFC after:	1 week
2018-12-07 19:10:51 +00:00
Sean Eric Fagan
54ff4a6a05 Reduce number of DNS queries in mountd.
As reported by a FreeNAS user (see https://redmine.ixsystems.com/issues/55728),
mountd does more calls to getnameinfo() than it needs to; this changes it to
only call it for the RPC calls it needs the name information for.

Reported by:	Dave Flowers
Reviewed by:	imp, mav
Approved by:	mav (mentor)
MFC after:	2 weeks
Sponsored by:	iXsystems Inc
Differential Revision:	https://reviews.freebsd.org/D18430
2018-12-06 18:21:48 +00:00
Kirk McKusick
fb14e73cb4 Normally when an attempt is made to mount a UFS/FFS filesystem whose
superblock has a check-hash error, an error message noting the
superblock check-hash failure is printed and the mount fails. The
administrator then runs fsck to repair the filesystem and when
successful, the filesystem can once again be mounted.

This approach fails if the filesystem in question is a root filesystem
from which you are trying to boot. Here, the loader fails when trying
to access the filesystem to get the kernel to boot. So it is necessary
to allow the loader to ignore the superblock check-hash error and make
a best effort to read the kernel. The filesystem may be suffiently
corrupted that the read attempt fails, but there is no harm in trying
since the loader makes no attempt to write to the filesystem.

Once the kernel is loaded and starts to run, it attempts to mount its
root filesystem. Once again, failure means that it breaks to its prompt
to ask where to get its root filesystem. Unless you have an alternate
root filesystem, you are stuck.

Since the root filesystem is initially mounted read-only, it is
safe to make an attempt to mount the root filesystem with the failed
superblock check-hash. Thus, when asked to mount a root filesystem
with a failed superblock check-hash, the kernel prints a warning
message that the root filesystem superblock check-hash needs repair,
but notes that it is ignoring the error and proceeding. It does
mark the filesystem as needing an fsck which prevents it from being
enabled for writing until fsck has been run on it. The net effect
is that the reboot fails to single user, but at least at that point
the administrator has the tools at hand to fix the problem.

Reported by:    Rick Macklem (rmacklem@)
Discussed with: Warner Losh (imp@)
Sponsored by:   Netflix
2018-12-06 00:09:39 +00:00
Gordon Tetlow
39040a9ec4 Always treat firmware request and response sizes as unsigned.
This fixes an incomplete bounds check on the guest-supplied request
size where a very large request size could be interpreted as a negative
value and not be caught by the bounds check.

Submitted by:	jhb
Reported by:	Reno Robert
Approved by:	so
Security:	FreeBSD-SA-18:14.bhyve
Security:	CVE-2018-17160
2018-12-04 18:28:25 +00:00
Eugene Grosbein
e0d1669595 Remove trim(8) by multiple demands. 2018-12-01 03:20:10 +00:00
Eugene Grosbein
09057b2c5c trim(8): serveral style fixes
Submitted by:		imp
MFC after:		1 month
Differential Revision:	https://reviews.freebsd.org/D18380
2018-11-30 21:57:02 +00:00
Mariusz Zaborski
1489776d43 iscsi: simplify the capsicumization
Approved by:	trasz
Differential Revision:	https://reviews.freebsd.org/D17962
2018-11-30 19:40:16 +00:00
Mark Johnston
c2c3992b39 Fix age_old_log() after r337468.
We can no longer use sizeof() to get the path buffer's size.  Apply
a straightforward fix for now with the aim of MFCing soon.

PR:		233633
Submitted by:	Katsuyuki Miyoshi <katsu@miyoshi.matsuyama.ehime.jp>
MFC after:	3 days
2018-11-29 16:49:56 +00:00
Eugene Grosbein
26ebe6565d trim.8: fix contents after rename from trim.1
MFC after:	1 month
2018-11-29 16:13:46 +00:00
Eugene Grosbein
1012931de7 trim(8): fix Makefile after rename from trim(1).
MFC after:	1 month
2018-11-29 16:10:54 +00:00
Eugene Grosbein
f0f5e20b78 Rename trim.1 to trim.8 too.
MFC after:	1 month
2018-11-29 16:09:24 +00:00
Eugene Grosbein
fcd7ccb28c Move trim(1) from usr.bin to usr.sbin to become trim(8).
Requested by:	se
MFC after:	1 month
2018-11-29 16:08:16 +00:00
Jamie Gritton
b307954481 In hardened systems, where the security.bsd.unprivileged_proc_debug sysctl
node is set, allow setting security.bsd.unprivileged_proc_debug per-jail.
In part, this is needed to create jails in which the Address Sanitizer
(ASAN) fully works as ASAN utilizes libkvm to inspect the virtual address
space. Instead of having to allow unprivileged process debugging for the
entire system, allow setting it on a per-jail basis.

The sysctl node is still security.bsd.unprivileged_proc_debug and the
jail(8) param is allow.unprivileged_proc_debug. The sysctl code is now a
sysctl proc rather than a sysctl int. This allows us to determine setting
the flag for the corresponding jail (or prison0).

As part of the change, the dynamic allow.* API needed to be modified to
take into account pr_allow flags which may now be disabled in prison0.
This prevents conflicts with new pr_allow flags (like that of vmm(4)) that
are added (and removed) dynamically.

Also teach the jail creation KPI to allow differences for certain pr_allow
flags between the parent and child jail. This can happen when unprivileged
process debugging is disabled in the parent prison, but enabled in the
child.

Submitted by:	Shawn Webb <lattera at gmail.com>
Obtained from:	HardenedBSD (45b3625edba0f73b3e3890b1ec3d0d1e95fd47e1, deba0b5078cef0faae43cbdafed3035b16587afc, ab21eeb3b4c72f2500987c96ff603ccf3b6e7de8)
Relnotes:	yes
Sponsored by:	HardenedBSD and G2, Inc
Differential Revision:	https://reviews.freebsd.org/D18319
2018-11-27 17:51:50 +00:00
Dag-Erling Smørgrav
cdd2df880d Add a “skip_dsn” option to g_part's bootcode verb to prevent g_part_mbr
from setting the volume serial number.  This unbreaks older boot blocks
that don't support serial numbers, and allows boot0cfg to set the serial
number itself if requested by the user.

Submitted by:	lev@, yuripv@
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D17386
2018-11-27 14:58:19 +00:00
Mateusz Piotrowski
e36f62bda6 Cross-reference mergemaster(8) & etcupdate(8).
Suggested by:	Daniel Ebdrup
Reviewed by:	bcr
Approved by:	bcr (doc), krion (mentor, implicit), mat (mentor, implicit)
Differential Revision:	https://reviews.freebsd.org/D18350
2018-11-27 10:31:29 +00:00
Dag-Erling Smørgrav
6b93819730 Check that /etc/resolv.conf exists before trying to read it.
Fix whitespace nit introduced in previous commit.

MFC after:	1 week
2018-11-27 09:46:01 +00:00
Dag-Erling Smørgrav
e86caa0bd0 Style cleanup. 2018-11-27 09:41:47 +00:00
Marcelo Araujo
edce78c2c4 Define AHCI_PORT_IDENT and increase by 1 the VTBLK_BLK_ID_BYTES
to avoid buffer accessed out of bounds, also switch to snprintf(3).

PR:		200859
Submitted by:	Caglar <caglar@10ur.org>
Obtained from:	https://github.com/mist64/xhyve/pull/24
MFC after:	4 weeks
Sponsored by:	iXsystems Inc.
2018-11-20 22:21:19 +00:00
Sean Eric Fagan
93840fdef6 mountd has no way to configure the listen queue depth; rather than add a new
option, we pass -1 down to listen, which causes it to use the
kern.ipc.soacceptqueue sysctl.

Approved by:	mav
MFC after:	2 weeks
Sponsored by:	iXsystems Inc
2018-11-14 19:06:43 +00:00
Renato Botelho
66a12de518 Fix typo introduced in r340439 - s/ETN/ETC/
Reported by:	jhb, yuripv
Approved by:	eugen
MFC after:	3 days
X-MFC-With:	340439
Sponsored by:	Rubicon Communications, LLC (Netgate)
2018-11-14 18:38:27 +00:00
Renato Botelho
f7f458b592 Fix /etc/ntp permissions. According to mtree it must be 0700
Reviewed by:	imp
Approved by:	imp
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
Differential Revision:	https://reviews.freebsd.org/D17973
2018-11-14 16:19:15 +00:00
Stefan Eßer
1894626876 Prepare move of ctm from base to a port (misc/ctm) by:
- Adding a note to UPDATING
- Adding a note to the history section of the manpage ctm.1
- Adding a message printed to STDERR to the ctm program

This version is meant for release in FreeBSD-12.0 and should remain in
FreeBSD-12 over its life-time.

A follow-up commit will remove ctm from -CURRENT after the MFC to 12
has happened.

Approved by:	imp, rgrimes, bcr (man-page)
MFC after:	3 days
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D17969
2018-11-14 08:45:48 +00:00
Conrad Meyer
dee401e833 cpucontrol(8): De-duplicate common update logic
Every µcode-updater must open the cpucontrol devfs node RDWR, open a
firmware file, validate the FW file has a positive length, mmap it, etc.
De-duplicate that identical logic between every individual platform.

Also, constify references to the readonly-mapped firmware files while here.

Sponsored by:	Dell EMC Isilon
2018-11-14 00:21:49 +00:00
Eric van Gyzen
cf44d7bd57 Fix daily mailq script for Postfix and daily_show_success="NO"
Exit with a zero status when Postfix reports "Mail queue is empty" so this
section won't appear in the report at all when daily_show_success="NO".

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2018-11-11 00:39:20 +00:00
Eugene Grosbein
bcfc8c2779 weekly/340.noid: suppress warning on non-existent jail.conf
MFC after:	1 month
2018-11-10 17:49:19 +00:00
Eugene Grosbein
f984e1f8e3 Sigh... Fix another breakage after r340322: spell "sysrc" correctly.
MFC after:	1 month
2018-11-10 14:35:12 +00:00
Eugene Grosbein
2f45576d88 Fix breakage after r340322: add missing "-n" to invocation of sysrc.
MFH:		1 month
2018-11-10 14:25:37 +00:00
Eugene Grosbein
ab478b0185 Prevent periodic/etc/weekly/340.noid from descending into root directories
of jails. Jails have their own user/group databases and this script
can produce multiple false warnings, not to mention significant extra
load in case of large jailed subtrees. Leave this check for jailed
invocations of the same script.

MFC after:	1 month
2018-11-10 14:21:26 +00:00
Eugene Grosbein
1e1a4743ba jail(8): introduce new command option -e to exhibit
a list of configured non-wildcard jails with their parameters,
no matter running or not.

The option -e takes separator argument that is used
to separate printed parameters. It will be used with following
additions to system periodic scripts to differentiate parts
of directory tree belonging jails as opposed to host's.

MFC after:	1 month
2018-11-10 12:03:57 +00:00
Ben Woods
9165316ff6 newsyslog.conf: Restrict included files in default config to [!.]*.conf
The new default config will only include files from the following
directories which end with '.conf' and do not beginning with a '.'
character:
- /etc/newsyslog.conf.d/
- /usr/local/etc/newsyslog.conf.d/

This matches the syslog.conf(5) functionality, and also prevents '.sample' or
'.pkgnew' files being included. This is important for ports which install files
in /usr/local/etc/newsyslog.conf.d/ and also for pkgbase.

Approved by:	eadler
Approved by:	bapt
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D17086
2018-11-10 10:46:38 +00:00
Ed Maste
b6274d1775 kldxref: use appropriate Elf_Off type for offsets
Submitted by:	Mitchell Horne <mhorne063@gmail.com>
Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D13957
2018-11-09 15:02:53 +00:00
Mateusz Piotrowski
a641e44515 Cross-reference nohup(1) and daemon(8).
Reviewed by:	bcr
Approved by:	krion (mentor, implicit), mat (mentor, implicit)
Differential Revision:	https://reviews.freebsd.org/D17920
2018-11-09 13:47:06 +00:00
Hans Petter Selasky
ba2c34f4f2 Put a size limit on the opensm.log and use bzip2(1).
Discussed with:		markj@
Sponsored by:		Mellanox Technologies
2018-11-08 17:00:05 +00:00
Hans Petter Selasky
fa895a749e Revert r340246.
Sponsored by:		Mellanox Technologies
2018-11-08 16:23:09 +00:00
Hans Petter Selasky
5e0e7e1846 Add /var/log/opensm.log to list of rotating log files.
MFC after:		3 days
Sponsored by:		Mellanox Technologies
2018-11-08 12:43:13 +00:00
Marcelo Araujo
0f6f91a8ce Comestic change to try to inline the memset with SSE/AVX instructions.
Also switch from int to size_t to keep portability.

Reviewed by:	brooks
Sponsored by:	iXsystems Inc.
Differential Revision:	https://reviews.freebsd.org/D17795
2018-11-07 06:29:01 +00:00
Marcelo Araujo
2c386b11f8 Revert my bogus attempt to silence coverity on r340045, it created
more bad side effects than good.

PR:		233038
Submitted by:	We Maag <jwmaag@gmail.com>
2018-11-07 04:20:29 +00:00
Kyle Evans
bc82609ae2 Move pmc* bits behind MK_PMC to fix WITHOUT_PMC build
No objection from:	mmacy
MFC after:	3 days
2018-11-05 00:20:58 +00:00
Mariusz Zaborski
377421df96 capsicum: use a new capsicum helpers in tools
Use caph_{rights,ioctls,fcntls}_limit to simplify the code.
2018-11-04 19:24:49 +00:00
Baptiste Daroussin
56b187fca8 nfsd: Factorize code
Factorize code by using struct sockaddr_storage to handle both ipv6 and ipv4

Discussed with:	rmacklem
Reviewed by:	manu
MFC after:	1 month
Sponsored by:	Gandi.net
Differential Revision:	https://reviews.freebsd.org/D13223
2018-11-04 06:39:01 +00:00
Bjoern A. Zeeb
a613be5677 Update the "flag" for draft-ietf-6man-ipv6only-flag.
Having the flag named "6" can possibly be a problem for configurations
where parsing strings and numbers can produce ambivalent results.
Rename the "6" flag to the "S"ix (or Silence-IPv4) flag.
2018-11-03 18:03:24 +00:00
Hans Petter Selasky
fc40159c18 Use correct type for IOCTL request argument.
This fixes signed IOCTL value warnings in uhsoctl().

MFC after:		1 week
Submitted by:		Marcin Cieslak <saper@saper.info>
Sponsored by:		Mellanox Technologies
2018-11-02 22:23:25 +00:00
Marcelo Araujo
be81239ddc Remove printf for debug purpose forgotten on r340046.
Reported by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2018-11-02 13:48:06 +00:00
Marcelo Araujo
6f2d76643e Add support ps/2 scancodes for NumLock, ScrollLock and numerical keypad
keys.

PR:		213835
Submitted by:	Vasily Postnicov <ivan.zhmudo@gmail.com>
MFC after:	4 weeks
Relnotes:	Yes
Sponsored by:	iXsystems Inc.
2018-11-02 08:28:14 +00:00
Marcelo Araujo
250c472a8c Fix resource leak when using strdup(3).
Reported by:	Coverity
CID:		1357337
Sponsored by:	iXsystems Inc.
2018-11-02 08:03:19 +00:00
Marcelo Araujo
93670f79d7 Fix resource leak when using strdup(3).
Reported by:	Coverity
CID:		1357336
Sponsored by:	iXsystems Inc.
2018-11-02 08:01:42 +00:00
Marcelo Araujo
6c8dae3cba Fix resource leak, variable fd going out of scope.
Reported by:	Coverity
CID:		1204383
Sponsored by:	iXsystems Inc.
2018-11-02 07:59:28 +00:00
Marcelo Araujo
ea2c655dd9 Fix resource leak, variables cp, xopts and nopt going out of scope.
Reported by:	Coverity
CID:		1305412
Sponsored by:	iXsystems Inc.
2018-11-02 07:57:28 +00:00
Edward Tomasz Napierala
5ae9f69896 Unbreak nscd(8). Without this change the CMSG gets truncated.
Reviewed by:	des
MFC after:	2 weeks
Sponsored by:	Chalmers University of Technology
Differential Revision:	https://reviews.freebsd.org/D17452
2018-11-01 18:19:10 +00:00
Conrad Meyer
d6e1e31a0e freebsd-update: add a progress report for the "fetching files..."
After patching step is done.

PR:		232857
Submitted by:	mat@
MFC after:	a week
2018-10-31 17:37:54 +00:00
Bjoern A. Zeeb
201100c58b Initial implementation of draft-ietf-6man-ipv6only-flag.
This change defines the RA "6" (IPv6-Only) flag which routers
may advertise, kernel logic to check if all routers on a link
have the flag set and accordingly update a per-interface flag.

If all routers agree that it is an IPv6-only link, ether_output_frame(),
based on the interface flag, will filter out all ETHERTYPE_IP/ARP
frames, drop them, and return EAFNOSUPPORT to upper layers.

The change also updates ndp to show the "6" flag, ifconfig to
display the IPV6_ONLY nd6 flag if set, and rtadvd to allow
announcing the flag.

Further changes to tcpdump (contrib code) are availble and will
be upstreamed.

Tested the code (slightly earlier version) with 2 FreeBSD
IPv6 routers, a FreeBSD laptop on ethernet as well as wifi,
and with Win10 and OSX clients (which did not fall over with
the "6" flag set but not understood).

We may also want to (a) implement and RX filter, and (b) over
time enahnce user space to, say, stop dhclient from running
when the interface flag is set.  Also we might want to start
IPv6 before IPv4 in the future.

All the code is hidden under the EXPERIMENTAL option and not
compiled by default as the draft is a work-in-progress and
we cannot rely on the fact that IANA will assign the bits
as requested by the draft and hence they may change.

Dear 6man, you have running code.

Discussed with:	Bob Hinden, Brian E Carpenter
2018-10-30 20:08:48 +00:00
Edward Tomasz Napierala
323d76db47 Make "nscd -t" work.
Reviewed by:	des@
MFC after:	2 weeks
Sponsored by:	Chalmers University of Technology
Differential Revision:	https://reviews.freebsd.org/D17563
2018-10-30 15:39:33 +00:00
Devin Teske
1b41374f09 Sort i18n messages in bsdinstall zfsboot
No functional change.

Sponsored by:	Smule, Inc.
2018-10-28 22:09:18 +00:00
Devin Teske
97820530b1 Fix dialog autosizing to accomodate for hline
dialog will conditionally ignore the --hline option if not enough space
was available to accomodate for the text width. Traditionally the width
of the widget had to be 10 wider than the text. Recent updates to dialog
have changed the requirement to be at least 12 wider than the hline text
else the hline text is not rendered at the bottom of the widget.

Sponsored by:	Smule, Inc.
2018-10-28 19:29:07 +00:00
Devin Teske
2c9d329756 Adjust for 80-columns.
No functional change.

Sponsored by:	Smule, Inc.
2018-10-28 00:58:39 +00:00
Yuri Pankov
8d56c80545 Provide basic descriptions for VMX exit reason (from "Intel 64 and IA-32
Architectures Software Developer’s Manual Volume 3").  Add the document
to SEE ALSO in bhyve.8 (and pet manlint here a bit).

Reviewed by:	jhb, rgrimes, 0mp
Approved by:	kib (mentor)
Differential Revision:	https://reviews.freebsd.org/D17531
2018-10-27 21:24:28 +00:00
Eugene Grosbein
b25a469f94 rcorder(8): add support for /etc/rc.resume, so it calls "rcorder -k resume"
and runs scripts containing "KEYWORD: resume" with single "resume" argument.

Working example is the port sysutils/cpupdate that defines
extra_commands="resume" to reload CPU microcode cleared
by suspend/resume sequence.

This change does nothing for a system having no scripts with KEYWORD: resume.

MFC after:		1 month
Differential Revision:	https://reviews.freebsd.org/D15247
2018-10-27 17:21:13 +00:00
Navdeep Parhar
9edef078cc cxgbetool(8): Add a subaction (tcbrss <n>) that can be used with "pass"
action to distribute traffic using the half of the VI's RSS indirection
table.

The value specified should either be the start of the VI's RSS slice
(available at dev.<ifname>.<inst>.rss_base since r339700) or the
midpoint (rss_base + rss_size/2).  The traffic that hits the filter will
use the first or second half of the indirection table respectively.
The indirection table can be populated in different ways to achieve
different kinds of traffic/load distributions.  For example, r339749
allows a netmap interface to have half the rx queues in the first half
of the table and the rest in the other.

Sponsored by:	Chelsio Communications
2018-10-27 05:26:09 +00:00
Warner Losh
92f9212ba6 Fix pointer arithmetic botch.
Pointer subtraction to find size only works with char pointers.

Noticed by: jhb@
Sponsored by: Netflix, Inc
2018-10-26 23:44:39 +00:00