Matthew Dillon [Sun, 4 Feb 2018 19:13:03 +0000 (11:13 -0800)]
kernel - Fix CAM peripheral error handling
* cam_periph.c was bcopy()ing the *ENTIRE* saved ccb back to the
original when working through certain error results. This completely
destroys linked list entry fields.
* Refactor by hacking a restore_ccb() function which does not copy
over the link list entry fields or the callout structure.
* Fixes panics with CDs, particularly audio CDs, and can also fix
other panics.
Panics are related to situations where an AHCI error or errors occur
while multiple CCBs are queued.
* Also always initialize the state tracking field for various scsi
periphals to ensure that stale data does not result in improper
processing in scsi/*.c's *done() functions.
Reported-by: htse
Matthew Dillon [Sun, 4 Feb 2018 19:01:49 +0000 (11:01 -0800)]
ahci - Improve debug output
* TFES errors now also report the slot and ccb pointer
Sascha Wildner [Sun, 4 Feb 2018 12:01:46 +0000 (13:01 +0100)]
bsd.sys.mk: Don't exclude -Wformat-extra-args in FORMAT_AUDIT builds.
Not sure why this was originally added but we surely want to see them.
Reported-by: zrj
Sascha Wildner [Sun, 4 Feb 2018 11:59:59 +0000 (12:59 +0100)]
gdb/lvm: Fix two -Wformat-extra-args warnings.
The gdb one was taken from upstram and the lvm one is in __DragonFly__
specific code.
Sascha Wildner [Sat, 3 Feb 2018 20:41:20 +0000 (21:41 +0100)]
pthread_join.3: Add a missing header in the SYNOPSIS.
zrj [Sat, 3 Feb 2018 08:56:45 +0000 (10:56 +0200)]
cpucontrol(8): Fix -e handling.
We do not have implemented CPUCTL_EVAL_CPU_FEATURES in cpuctl(4) yet.
Sascha Wildner [Sat, 3 Feb 2018 08:00:39 +0000 (09:00 +0100)]
Fix a few mdoc issues.
Sascha Wildner [Sat, 3 Feb 2018 08:00:23 +0000 (09:00 +0100)]
newsyslog.8: Comment out another zstd reference (and fix a typo).
Sascha Wildner [Sat, 3 Feb 2018 07:57:40 +0000 (08:57 +0100)]
callout.9: Remove some obsolete MLINKS.
Eitan Adler [Sat, 3 Feb 2018 04:58:31 +0000 (20:58 -0800)]
[fish] fix style
Eitan Adler [Sat, 3 Feb 2018 04:51:45 +0000 (20:51 -0800)]
[fish] don't allow users to request cards they have made books for
It is not technically legal to request a card you don't have in your
hand, even if you have the book for it. This really only matters if
you're playing with more than one deck, which fish(6) does not support,
but since this is a critical bug, fix it.
zrj [Fri, 2 Feb 2018 20:15:20 +0000 (22:15 +0200)]
newsyslog(8): Add missing fallthrough.
Sascha Wildner [Fri, 2 Feb 2018 15:24:08 +0000 (16:24 +0100)]
Normalize libcrypto and libssl DPADD variable names and adjust Makefiles.
zrj [Tue, 30 Jan 2018 16:47:48 +0000 (18:47 +0200)]
drill(1): Use strdup() for known strings.
zrj [Tue, 30 Jan 2018 16:25:54 +0000 (18:25 +0200)]
libarchive: Use memcpy() when constructing buffers.
Avoid common mistakes that strncpy() will terminate the string.
Results here are not expected to be NULL terminated.
zrj [Tue, 30 Jan 2018 18:36:08 +0000 (20:36 +0200)]
ee(1): Fix ispell_op().
Do not pass NULL to sprintf, use tempname returned by mkstemp(3).
zrj [Wed, 31 Jan 2018 12:08:56 +0000 (14:08 +0200)]
truncate(1): Add support for T.
While there, add fallthrough.
zrj [Wed, 31 Jan 2018 12:06:19 +0000 (14:06 +0200)]
tput(1): Constify.
While there, add fallthrough.
zrj [Wed, 31 Jan 2018 12:02:08 +0000 (14:02 +0200)]
rs(1): Staticize.
While there, add few fallthrough.
zrj [Wed, 31 Jan 2018 11:47:02 +0000 (13:47 +0200)]
jot(1): General cleanup.
* staticize
* constify
* add fallthrough
zrj [Wed, 31 Jan 2018 11:33:32 +0000 (13:33 +0200)]
ident(1): Use NULL instead of 0.
While there, add few cases of fallthrough (few need more investigation).
zrj [Wed, 31 Jan 2018 11:16:43 +0000 (13:16 +0200)]
ctags(1): Add missing fallthrough.
The -v option implies the -x.
zrj [Wed, 31 Jan 2018 11:13:12 +0000 (13:13 +0200)]
colcrt(1): Add missing fallthrough.
zrj [Wed, 31 Jan 2018 11:04:08 +0000 (13:04 +0200)]
at(1): Add missing fallthrough.
While there, constify struct.
zrj [Tue, 30 Jan 2018 21:22:43 +0000 (23:22 +0200)]
kgdb(1): Avoid -Wformat-truncation warning.
No functional change.
zrj [Tue, 30 Jan 2018 19:50:13 +0000 (21:50 +0200)]
window(1): Add some format safety.
While there, add some FALLTHROUGH too.
zrj [Tue, 30 Jan 2018 19:13:11 +0000 (21:13 +0200)]
netstat(1): Add some formats safety.
No functional change intended.
zrj [Tue, 30 Jan 2018 14:43:43 +0000 (16:43 +0200)]
sort(1): Use asprintf(3) when fixing legacy options.
While there, make fix_obsolete_keys() static.
zrj [Tue, 30 Jan 2018 20:31:52 +0000 (22:31 +0200)]
tzsetup(8): Suppress -Wformat-overflow warning.
zrj [Tue, 30 Jan 2018 19:32:45 +0000 (21:32 +0200)]
systat(8): Add some formats safety.
Mainly to suppress -Wformat-overflow
zrj [Tue, 30 Jan 2018 20:28:21 +0000 (22:28 +0200)]
sliplogin(8): Add some formats safety.
Use %hu for printing ipv4 address octects and reduce login name lenght a
bit to allow for prepending path.
zrj [Wed, 31 Jan 2018 12:39:00 +0000 (14:39 +0200)]
sicontrol(8): Add few fallthrough.
zrj [Wed, 31 Jan 2018 10:52:47 +0000 (12:52 +0200)]
route(8): Add some __attribute__((__noreturn__)).
zrj [Wed, 31 Jan 2018 10:44:03 +0000 (12:44 +0200)]
restore(8): Add missing fallthrough.
While there, add few hints for a compiler, panic() can return.
zrj [Wed, 31 Jan 2018 12:22:40 +0000 (14:22 +0200)]
pflogd(8): Add few fallthrough.
zrj [Wed, 31 Jan 2018 12:29:13 +0000 (14:29 +0200)]
ppp(8): Add few fallthrough.
zrj [Wed, 31 Jan 2018 10:28:56 +0000 (12:28 +0200)]
ipfw(8): Add missing fallthrough.
zrj [Tue, 30 Jan 2018 18:10:00 +0000 (20:10 +0200)]
ipfw3(8): Increase stack storage for linename.
To accommodate fully the "Line %d" format and avoid buffer overflow.
Do the same some for ip6fw(8).
zrj [Tue, 30 Jan 2018 17:51:26 +0000 (19:51 +0200)]
ifconfig(8): Use strlcpy() to set the ifr_name field.
While there, change to use IFNAMSIZ too.
zrj [Tue, 30 Jan 2018 20:30:47 +0000 (22:30 +0200)]
dfregress(8): Suppress -Wformat-oveflow warnings.
zrj [Tue, 30 Jan 2018 20:11:21 +0000 (22:11 +0200)]
edquota(8): Use uintmax_t in cvtstoa().
Mainly to suppress the -Wformat-oveflow warnings.
zrj [Tue, 30 Jan 2018 20:06:58 +0000 (22:06 +0200)]
cron(8): Add some format safety.
Mostly no functional change for a common case, just to suppress
the -Wformat-overflow
zrj [Wed, 31 Jan 2018 11:10:33 +0000 (13:10 +0200)]
chat(8): Add missing fallthrough.
Handle them as an error.
zrj [Wed, 31 Jan 2018 10:56:57 +0000 (12:56 +0200)]
boot/common: Add missing fallthrough.
zrj [Wed, 31 Jan 2018 09:10:20 +0000 (11:10 +0200)]
libusb: Use more common "vendor product" order.
While there, make sure that "vendor product" would take only half of
the usb_desc field that is 96 chars long.
zrj [Wed, 31 Jan 2018 10:09:59 +0000 (12:09 +0200)]
libtcplay: Add some format safety.
Limit device prints to 88 chars (should be plenty).
While there, add few missing fallthrough.
zrj [Tue, 30 Jan 2018 17:56:58 +0000 (19:56 +0200)]
libcompat: Use %hu for unsigned shorts.
zrj [Tue, 30 Jan 2018 07:02:49 +0000 (09:02 +0200)]
rpc: Fix xdr_* macros and limit buffer sizes.
While there, constify few things.
Taken-from: FreeBSD
zrj [Mon, 29 Jan 2018 20:44:34 +0000 (22:44 +0200)]
yp*: Staticise.
While there, make few format fixes.
zrj [Tue, 30 Jan 2018 13:05:40 +0000 (15:05 +0200)]
md5(1): Untangle MD5 symbols.
Prefer to use symbols from LibreSSL crypto lib to match SHA ones. Adjust
the function casting to suppress the gcc80 -Wcast-function-type warnings.
While there, print MiB/s instead of bytes/s for benchmarks.
zrj [Mon, 29 Jan 2018 19:20:24 +0000 (21:20 +0200)]
libutil: Use local wrapper for exit(3).
Avoids -Wcast-function-type warning.
zrj [Fri, 2 Feb 2018 07:50:54 +0000 (09:50 +0200)]
cpucontrol(8): Unbreak WORLD_CCOPTLEVEL=2.
Add NO_STRICT_ALIASING for dereferencing type-punned pointers.
zrj [Mon, 29 Jan 2018 15:57:51 +0000 (17:57 +0200)]
init(8): Convert to use sig_atomic_t.
Instead of returning function pointer, now return enum for the next state.
Avoids -Wcast-function-type warnings.
Taken-from: OpenBSD
zrj [Fri, 2 Feb 2018 06:42:39 +0000 (08:42 +0200)]
kernel: Avoid long inactivity pauses on very early boot.
Increase verbosity a bit on certain setups.
François Tigeot [Thu, 1 Feb 2018 20:14:52 +0000 (21:14 +0100)]
drm/linux: Add some dma-buf stubs
zrj [Wed, 31 Jan 2018 19:53:17 +0000 (21:53 +0200)]
kernel: Avoid empty macros when not INVARIANTS.
Visible from MINI64.
zrj [Wed, 31 Jan 2018 19:36:34 +0000 (21:36 +0200)]
kernel/wlan: Avoid empty macros.
Visible from VKERNEL64.
zrj [Wed, 31 Jan 2018 18:43:13 +0000 (20:43 +0200)]
kernel: Avoid empty macros.
Suppresses last 11 -Wempty-body warnings.
zrj [Wed, 31 Jan 2018 18:24:41 +0000 (20:24 +0200)]
kernel/ntfs: Avoid empty macros.
zrj [Wed, 31 Jan 2018 18:16:37 +0000 (20:16 +0200)]
kernel/acpi: Add braces around empty if body.
zrj [Wed, 31 Jan 2018 18:14:11 +0000 (20:14 +0200)]
kernel/hpt*: Avoid empty macros.
Suppresses 14 -Wempty-body warnings.
zrj [Wed, 31 Jan 2018 17:25:08 +0000 (19:25 +0200)]
kernel/twa: Avoid empty macros.
Suppresses 42 -Wempty-body warnings.
zrj [Wed, 31 Jan 2018 17:15:16 +0000 (19:15 +0200)]
kernel/netif: Avoid empty if/else bodies.
zrj [Wed, 31 Jan 2018 17:05:56 +0000 (19:05 +0200)]
ath_hal: Avoid empty macros.
Fix just two callsights to have a terminating semicolon (rest have it)
and remove it from the macros.
zrj [Wed, 31 Jan 2018 15:48:21 +0000 (17:48 +0200)]
ix: Avoid empty macros.
Suppresses 46 -Wempty-body warnings.
zrj [Wed, 31 Jan 2018 15:47:27 +0000 (17:47 +0200)]
drm/ttm: Avoid empty macros.
Suppresses -Wempty-body warnings.
zrj [Wed, 31 Jan 2018 15:19:23 +0000 (17:19 +0200)]
drm/linux: Improve linux/bug.h
Suppresses 399 -Wempty-body warnings.
zrj [Wed, 31 Jan 2018 13:57:28 +0000 (15:57 +0200)]
drm/linux: Improve linux/lockdep.h
Suppresses 170 -Wempty-body warnings.
Matthew Dillon [Thu, 1 Feb 2018 00:12:04 +0000 (16:12 -0800)]
kernel - Fix kernel minidumps
* Refactor minidumps. Fix an overflows due to KVM now being 8TB, fix
improper pdp[] array calculations (cropped up when we want to > 1 PML4e
entry for the kernel), and refactor the page table entry handling code
to improve efficiency and reduce the dump size.
If we had kept the original pte mapping in the minidump it would have
required ~16GB of disk space JUST to hold a pte array that is mostly 0's.
Now it only requires ~2MB.
Dumping performance is improved because the page table array is primarily
flushed to storage in 4KB block sizes, and now only 2MB or so is written
out in this manner.
* minidump now dumps the PDP array of PD entries (representing 1GB each)
for the entire system VA space (user and kernel) - 256TB. This requires
512*512*8 = 2MB of storage.
PD pages and PT pages are no longer linearized into an array in the
minidump. Instead, their physical addresses are included in the dump
map and libkvm accesses the PTEs through the physical map.
NOTE: Only kernel memory proper is actually populated at this time, but
this leaves the door open for e.g. dumping more information without having
to change the minidump format again.
* Revamp the minidump header, magic string, and version to address the new
reality. libkvm should still be able to recognize the old minidump
format, as well as now the new one.
Reminded-by: everyone
François Tigeot [Wed, 31 Jan 2018 21:58:23 +0000 (22:58 +0100)]
drm/linux: Add linux/irqreturn.h
Sascha Wildner [Wed, 31 Jan 2018 09:17:14 +0000 (10:17 +0100)]
LINT64: Add a missing '#'.
Sascha Wildner [Wed, 31 Jan 2018 09:08:41 +0000 (10:08 +0100)]
LINT64: Add some nata(4) options (they remove code, so commented out).
Imre Vadász [Sun, 28 Jan 2018 21:06:29 +0000 (22:06 +0100)]
acpi - Implement a hack to recheck whether devices are present a few times.
* This allows various ACPI devices to attach, which depend on another
device. Often the _STA method declares them absent when the initial ACPI
namespace walk is done, so we re-check the presence of those devices
after each global priority round, when probe-/attach-ing children.
Imre Vadász [Sun, 28 Jan 2018 21:04:55 +0000 (22:04 +0100)]
acpi - Use KOBJ_GPRI_ACPI driver priorities for ig4 and gpio_intel.
* Since we currently don't handle the ACPI _DEP methods appropriately,
use the "global priority hack" from
5025fc65cd2448de8a5b7295c9936b473a7b0194 to enforce that ig4 and
gpio_intel attach before various ACPI namespace devices.
* This uses the KOBJ_GPRI_ACPI+1 and KOBJ_GPRI_ACPI+2 driver global priority
levels for important ACPI drivers, which may have to attach before other
ACPI devices can be used.
* This also adds the KOBJ_GPRI_ACPI global priority level to the sdhci_acpi
driver declaration.
Sascha Wildner [Tue, 30 Jan 2018 08:16:45 +0000 (09:16 +0100)]
boot/efi: Sync our TianoCore EDK II headers with the UDK2018 branch.
Sascha Wildner [Mon, 29 Jan 2018 20:09:27 +0000 (21:09 +0100)]
newsyslog(8): Comment out zstd support for now.
Sascha Wildner [Mon, 29 Jan 2018 20:06:03 +0000 (21:06 +0100)]
newsyslog.8: Comment out /etc/newsyslog.conf.d for now.
Sascha Wildner [Mon, 29 Jan 2018 19:13:14 +0000 (20:13 +0100)]
Sync zoneinfo database with tzdata2018c from ftp://ftp.iana.org/tz/releases
* Revert Irish changes that relied on negative DST offsets.
* Japanese DST transitions (1948-1951) were Sundays at 00:00, not
Saturdays or Sundays at 02:00.
For a detailed list of changes, see share/zoneinfo/NEWS.
Sascha Wildner [Mon, 29 Jan 2018 18:42:12 +0000 (19:42 +0100)]
etc/newsyslog.conf: Pull in the confs that are installed by various ports.
Leave /etc/newsyslog.conf.d commented out for now.
While here, fix a typo in the comments.
Taken-from: FreeBSD
Sascha Wildner [Mon, 29 Jan 2018 18:25:02 +0000 (19:25 +0100)]
newsyslog(8): Further reduce differences with FreeBSD.
zrj [Mon, 29 Jan 2018 14:48:15 +0000 (16:48 +0200)]
vidcontrol(8): Avoid -Wformat-truncation warning.
The vinfo.font_size is unsigned short, so use %hu instead of %d.
zrj [Mon, 29 Jan 2018 14:33:20 +0000 (16:33 +0200)]
config(8): Allow for appending path elements.
Mainly to suppress -Wformat-truncation warning.
zrj [Mon, 29 Jan 2018 14:28:05 +0000 (16:28 +0200)]
crunchgen(1): Allow for appending extensions.
Mainly to suppress -Wformat-truncation warning.
Antonio Huete Jimenez [Mon, 29 Jan 2018 01:06:09 +0000 (02:06 +0100)]
newsyslog - implement 'p' flag
Implement the 'p' flag for newsyslog from NetBSD. This flag results in
the first log file for a given file to not be compressed.
While here, don't change file attributes during a no-op run
Obtained-from: FreeBSD (r327451)
Antonio Huete Jimenez [Mon, 29 Jan 2018 01:02:20 +0000 (02:02 +0100)]
newsyslog - Fix misc issues
When building the command to execute for compression, newsyslog was modifying
the generic arguments array instead of its own copy.
Meaning on the second file to compress with the same arguments, the command line
was not the one expected.
Fix it by creating one copy of the arguments per execution and modifying that
copy.
While here, print the command line executed in verbose mode.
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:59:04 +0000 (01:59 +0100)]
newsyslog - Fix typo
Obtained-from: FreeBSD (r326622)
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:57:48 +0000 (01:57 +0100)]
newsyslog - Flexible compression program execution
Allow newsyslog to execute compression commands which
have a semantic different than the traditional gzip(1)
This is done to allow to use zstd(1) as a compression tool without
having to patch it to change its default behavior.
Obtained-from: FreeBSD (r326617)
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:52:57 +0000 (01:52 +0100)]
newsyslog - Allow writing RFC5424 compliant rotation message.
This modification adds the capability to newsyslog to write the
rotation message in a format that is compliant with RFC5424. This
capability is enabled on a per-log file basis through a new value
("T") in the flags field in newsyslog.conf. This is useful on systems
that use the RFC5424 format for log files so that the rotation message
format matches that of the other log messages. There has been recent
mention of adding an RFC5424 compliant mode to syslogd and at least
one alternative system log daemon (rsyslogd) that already has the
capability to use that format.
Obtained-from: FreeBSD (r318960)
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:43:01 +0000 (01:43 +0100)]
newsyslog - Add a new Y flag to newsyslog.conf
This makes newsyslog use zstandard to compress log files.
Given Z is already taken for gzip and zstandard compression level stands in
between gzip and xz (which has the X flag) chosing Y sounds ok :)
Obtained-from: FreeBSD (r316981)
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:39:56 +0000 (01:39 +0100)]
newsyslog - Fix typo
Obtained-from: FreeBSD (r308457)
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:38:39 +0000 (01:38 +0100)]
newsyslog - More basename/dirname changes
Properly patch up dirname()/basename() calls to not clobber ent->log.
It turns out that we had a couple of more calls to dirname()/basename()
in newsyslog(8) that assume the input isn't clobbered. This is bad,
because it apparently breaks log rotation now that the new dirname()
implementation has been merged.
Fix this by first copying the input and then calling
dirname()/basename(). While there, improve the naming of variables in
this function a bit.
Obtained-from: FreeBSD (r305651)
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:36:51 +0000 (01:36 +0100)]
newsyslog - Clean up basename/dirname calls
Pull copies of the input pathname string before calling basename() and
dirname() to make this comply to POSIX. Free these copies at the end of
this function. While there, remove the duplication of the 's' ->
'logfname' string. There is no need for this.
Obtained-from: FreeBSD (r303449)
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:34:42 +0000 (01:34 +0100)]
newsyslog - Remove unneeded sleep
Eliminate unnecessary sleep(10) when -R and -s are specified
After going through the signal work list, during which do_sigwork()
is called and essentially does nothing because -s and -R were
specified on the command line, newsyslog will sleep for 10 seconds
as the (verbose) code says: "Pause 10 seconds to allow daemon(s)
to close log file(s)".
However, the man page verbiage for -R (and -s) seems quite clear
that this sleep() is unnecessary because the daemon was expected
to have already closed the log file before calling newsyslog.
Obtained-from: FreeBSD (r301532)
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:33:18 +0000 (01:33 +0100)]
newsyslog - treat 'c' flag in the config as 'C'
When -C was introduced in r114137 the plan was to have -C and -c being used for
"create" due to a typo in FreeBSD <= 4.8 a temporary compatibility hack has been
added to make -c being like -G aka GLOB and a warning was issued for the user to
be aware of the futur change for -c.
12 years later it is more than time to remove that hack and finish the what was
intent in r114137
Obtained-from: FreeBSD (r290226)
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:31:51 +0000 (01:31 +0100)]
newsyslog - Allow signal names for config
Obtained-from: FreeBSD (r289879)
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:19:07 +0000 (01:19 +0100)]
newsyslog - Fix typo
Obtained-from: FreeBSD (r289677)
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:14:22 +0000 (01:14 +0100)]
newsyslog - Enhance error mesage
If we fail to send a signal after rotation, print
the pidfile from which the corresponding PID was
obtained.
Obtained-from: FreeBSD (r272763)
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:06:29 +0000 (01:06 +0100)]
newsyslog - Initialize the struct tm
Obtained-from: FreeBSD (r257600)
Antonio Huete Jimenez [Mon, 29 Jan 2018 00:02:22 +0000 (01:02 +0100)]
newsyslog - Fix -Wunsequenced
Obtained-from: FreeBSD (r252378)
Antonio Huete Jimenez [Sun, 28 Jan 2018 23:56:19 +0000 (00:56 +0100)]
newsyslog - Specify the correct filename
We want to stat the archived log file rather than the logfile itself.
Obtained-from: FreeBSD (r251240)