]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoMFC r324218:
tuexen [Sat, 7 Apr 2018 19:40:48 +0000 (19:40 +0000)]
MFC r324218:

Whitespace changes: Remove leading spaces followed by a tab.

6 years agoMFC r324216:
tuexen [Sat, 7 Apr 2018 19:38:55 +0000 (19:38 +0000)]
MFC r324216:

Fix a bug which avoided that rules for matching port numbers for SCTP
packets where actually matched.
While there, make clean in the man-page that SCTP port numbers are
supported in rules.

6 years agoMFC r324122:
tuexen [Sat, 7 Apr 2018 19:23:51 +0000 (19:23 +0000)]
MFC r324122:

Fix reporting of probing size. This bug was introduced in r324119.

6 years agoMFC r324120:
tuexen [Sat, 7 Apr 2018 19:22:32 +0000 (19:22 +0000)]
MFC r324120:

Add SCTP and TCP as protocols for sending probe packets.

6 years agoMFC r324119:
tuexen [Sat, 7 Apr 2018 19:21:15 +0000 (19:21 +0000)]
MFC r324119:

* Update function definitions.
* Ensure that the datalen always describes the length after the IPv6
  header consistently, not matter which protocol us used for probes..
* Document that the default length is 20, not 12.
* Don't send inormation in probe packets which is not needed or
  even checked when the responses are processed.
* Address CID 978587.

This is mainly a cleanup preparing the addition of SCTP and TCP
as possible probe packet protocols.

6 years agoMFC r324056:
tuexen [Sat, 7 Apr 2018 19:19:25 +0000 (19:19 +0000)]
MFC r324056:

Remove unused function.

6 years agoMFC r323904:
tuexen [Sat, 7 Apr 2018 19:17:31 +0000 (19:17 +0000)]
MFC r323904:

Add missing locking. Found by Coverity while scanning the usrsctp
library.

6 years agoMFC r323902:
tuexen [Sat, 7 Apr 2018 19:16:06 +0000 (19:16 +0000)]
MFC r323902:

Add missing socket lock.

6 years agoMFC r323861:
tuexen [Sat, 7 Apr 2018 19:14:31 +0000 (19:14 +0000)]
MFC r323861:

Code cleanup, no functional change.

6 years agoMFC r323850:
tuexen [Sat, 7 Apr 2018 19:13:05 +0000 (19:13 +0000)]
MFC r323850:

Free the control structure after using is, not before.
Found by Coverity while scanning the usrsctp library.

6 years agoMFC r323847:
tuexen [Sat, 7 Apr 2018 19:11:21 +0000 (19:11 +0000)]
MFC r323847:

No need to wakeup, since sctp_add_to_readq() does it.

6 years agoMFC r323833:
tuexen [Sat, 7 Apr 2018 19:09:51 +0000 (19:09 +0000)]
MFC r323833:

Protect the address workqueue timer by a mutex.

6 years agoMFC r323776:
tuexen [Sat, 7 Apr 2018 18:08:42 +0000 (18:08 +0000)]
MFC r323776:

Fix a warning.

6 years agoMFC r323774:
tuexen [Sat, 7 Apr 2018 18:06:40 +0000 (18:06 +0000)]
MFC r323774:

Avoid an overflow when computing the staleness.
This issue was found by running libfuzz on the userland stack.

6 years agoMFC r323763:
tuexen [Sat, 7 Apr 2018 18:05:01 +0000 (18:05 +0000)]
MFC r323763:

Remove a no longer used variable.

Reported by: Felix Weinrank

6 years agoMFC r323670:
tuexen [Sat, 7 Apr 2018 18:02:17 +0000 (18:02 +0000)]
MFC r323670:

Fix an accounting bug and use sctp_timer_start to start a timer.

6 years agoMFC r323657:
tuexen [Sat, 7 Apr 2018 17:59:08 +0000 (17:59 +0000)]
MFC r323657:

Remove code not used on any platform currently supported.

6 years agoMFC r323505:
tuexen [Sat, 7 Apr 2018 17:54:38 +0000 (17:54 +0000)]
MFC r323505:

Export the UDP encapsualation port and the path state.

6 years agoMFC r323378:
tuexen [Sat, 7 Apr 2018 17:41:32 +0000 (17:41 +0000)]
MFC r323378:

Fix MTU computation. Coverity scanning usrsctp pointed to this code...

6 years agoMFC r323377:
tuexen [Sat, 7 Apr 2018 17:40:11 +0000 (17:40 +0000)]
MFC r323377:

Fix a locking issue found by Coverity scanning the usrsctp library.

6 years agoMFC r323376:
tuexen [Sat, 7 Apr 2018 17:38:38 +0000 (17:38 +0000)]
MFC r323376:

Fix locking issues found by Coverity scanning the usrsctp library.

6 years agoMFC r323374:
tuexen [Sat, 7 Apr 2018 17:36:53 +0000 (17:36 +0000)]
MFC r323374:

Silence a Coverity warning from scanning the usrsctp library.

6 years agoMFC r323372:
tuexen [Sat, 7 Apr 2018 17:35:04 +0000 (17:35 +0000)]
MFC r323372:

Savely remove a chunk from the control queue.
This bug was found by Coverity scanning the usrsctp library.

6 years agoMFC r323352:
tuexen [Sat, 7 Apr 2018 15:19:10 +0000 (15:19 +0000)]
MFC r323352:

The combination of IPv6 and SCTP is also supported.

6 years agoMFC r322967:
tuexen [Sat, 7 Apr 2018 15:16:57 +0000 (15:16 +0000)]
MFC r322967:

Fix blackhole detection.

There were two bugs related to the blackhole detection:
* The smalles size was tried more than two times.
* The restored MSS was not the original one, but the second
  candidate.

Sponsored by: Netflix, Inc.

6 years agoMFC r322812:
tuexen [Sat, 7 Apr 2018 15:10:08 +0000 (15:10 +0000)]
MFC r322812:

Avoid TCP log messages which are false positives.

The check for timestamps are too early to handle SYN-ACK correctly.
So move it down after the corresponing processing has been done.

MFC r322813:

Avoid TCP log messages which are false positives.

This is https://svnweb.freebsd.org/changeset/base/322812, just for
alternate TCP stacks.

PR: 216832
Obtained from: antonfb@hesiod.org

6 years agoMFC r321463:
tuexen [Sat, 7 Apr 2018 14:45:55 +0000 (14:45 +0000)]
MFC r321463:

Remove duplicate statement.

6 years agoMFC r321289:
tuexen [Sat, 7 Apr 2018 14:44:21 +0000 (14:44 +0000)]
MFC r321289:

Fix the explicit EOR mode. If the final messages is not complete, send
an ABORT.
Joint work with rrs@

6 years agoMFC r321205:
tuexen [Sat, 7 Apr 2018 14:43:01 +0000 (14:43 +0000)]
MFC r321205:

Avoid shadowed variables.

6 years agoMFC r321204:
tuexen [Sat, 7 Apr 2018 14:41:44 +0000 (14:41 +0000)]
MFC r321204:

Use memset/memcpy instead of bzero/bcopy.

Just use one variant instead of both. Use the memset/memcpy
ones since they cause less problems in crossplatform deployment.

6 years agoMFC r321197:
tuexen [Sat, 7 Apr 2018 14:40:21 +0000 (14:40 +0000)]
MFC r321197:

Fix the accounting and add code to detect errors in accounting.
Joint work with rrs@

6 years agoMFC r321034:
tuexen [Sat, 7 Apr 2018 14:38:58 +0000 (14:38 +0000)]
MFC r321034:

Fix the handling of Explicit EOR mode.

While there, appropriately handle the overhead depending on
the usage of DATA or I-DATA chunks. Take the overhead only
into account, when required.

Joint work with rrs@

6 years agoMFC r320653:
tuexen [Sat, 7 Apr 2018 14:37:16 +0000 (14:37 +0000)]
MFC r320653:
Move to open state after plausibility checks.

When doing this too early, the MIB counters go wrong.

6 years agoMFC r320650:
tuexen [Sat, 7 Apr 2018 14:35:46 +0000 (14:35 +0000)]
MFC r320650:

Don't hold a refcount on an stcb when it is not needed.
This improves the consistency with other parts of the code.

6 years agoMFC r322324: capsicum_helpers: Add FIODTYPE to default ioctls allowed
kevans [Sat, 7 Apr 2018 03:51:19 +0000 (03:51 +0000)]
MFC r322324: capsicum_helpers: Add FIODTYPE to default ioctls allowed

FIODTYPE will be needed by hexdump(1) to speed up the -s flag on devices
that should be able to support fseek(3); specifically, in an attempt to
correct for the fact that most tape drives don't support seeking yet don't
indicate as such when fseeko(3) is invoked.

6 years agoRegenerate src.conf(5) after r332162
kevans [Sat, 7 Apr 2018 03:02:07 +0000 (03:02 +0000)]
Regenerate src.conf(5) after r332162

This is a direct commit to stable/11

6 years agoMFC r330116, r330118, r330251, r330254
kevans [Sat, 7 Apr 2018 02:56:59 +0000 (02:56 +0000)]
MFC r330116, r330118, r330251, r330254

r330116:
Some missing LOADER_EFI build option descriptions

r330118:
Add missing punctuation to *_LOADER_EFI descriptions...

r330251:
Remove LOADER_EFI description files

LOADER_EFI functionality got folded into EFI as of r330248.

r330254:
Add descriptions for recently added loader options

6 years agoMFC r331651-r331653
brooks [Sat, 7 Apr 2018 00:23:49 +0000 (00:23 +0000)]
MFC r331651-r331653

r331651:
Copy flags over ifr_union directly rather than via casts through
ifr_data.

No functional change in practice.  If the sbni driver supported
64-bit big-endian system, this would be an ABI changes, but it is
i386-only.  The old version leaked a word of stack on 64-bit systems.

This eliminates the only assignment to ifr_data.

r331652:
Revert r331651 to recommit with proper commit metadata.

r331653:
Copy flags over ifr_union directly rather than via casts through
ifr_data.

No functional change in practice.  If the sbni driver supported
64-bit big-endian system, this would be an ABI changes, but it is
i386-only.  The old version leaked a word of stack on 64-bit systems.

This eliminates the only assignment to ifr_data.

Reviewed by: kib
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14874

6 years agoMFC r331648:
brooks [Fri, 6 Apr 2018 23:31:47 +0000 (23:31 +0000)]
MFC r331648:

Improve copy-and-pasted versions of SIOCGIFADDR.

The original implementation used a reference to ifr_data and a cast to
do the equivalent of accessing ifr_addr. This was copied multiple
times since 1996.

Approved by: kib
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14873

6 years agoMFC r330970, r331067, r331767, r331852, r331858
kevans [Fri, 6 Apr 2018 21:50:09 +0000 (21:50 +0000)]
MFC r330970, r331067, r331767, r331852, r331858

r330970:
libefi: UEFI_BOOT_VAR_GUID duplicates EFI_GLOBAL_VARIABLE

Drop UEFI_BOOT_VAR_GUID and use EFI_GLOBAL_VARIABLE.

r331067:
Only print boot order / boot current if we can get the variables from
the loader. Some UEFI implementations don't return all of them.

Sponsored by: Netflix

r331767:
efinet: Do not return only if ReceiveFilter fails

If the network interface or the uefi implementation do not support the
ReceiveFilter interface do not return only and just print a message.
U-Boot doesn't support is and likely never will. Also even if this fails
it doesn't mean that network in EFI isn't supported.

r331852:
fwohcireg.h is 99% the same between the boot loader and the
kernel. Delete it and fix up the 1% difference because there's no need
for them to be different.

r331858:
The Uninorth ID was really for Uninorth 2.

6 years agoMFC r331331: Apply r228478 (CTASSERT => _Static_assert()) to bootstrap.h
kevans [Fri, 6 Apr 2018 21:40:23 +0000 (21:40 +0000)]
MFC r331331: Apply r228478 (CTASSERT => _Static_assert()) to bootstrap.h

6 years agoMFC r330806-r330815, r330837, r330864, r330883
kevans [Fri, 6 Apr 2018 21:37:25 +0000 (21:37 +0000)]
MFC r330806-r330815, r330837, r330864, r330883

pc98 changes associated with the named commits are also included in this
commit, despite not having been made with the original commits due to its
removal in head.

r330806:
Minor cosmetic changes.

Make sure { on the same line as struct for all struct *devdesc.  Move
some type definitions to next to the dv_type define, since that's what
sets the d_type.

r330807:
We can't use d_opendata for blkio storage.

open_disk uses d_opendata for it's own purpse. We can't store blkio
there. Fortunately, blkio is stored elsewhere and we never actually
retrieve blkio from d_opendata. Eliminate it as a source of confusion.
Eliminate all stores of d_opendata in efi since this layer doesn't own
that field.

r330808:
Make struct libi386_devdesc match the struct devdesc better

Move data to top and call it d_opendata.

r330809:
Use the actual struct devdesc at the start of all *_devdesc structs

The current system is fragile and requires very careful layout of all
*_devdesc structures. It also makes it hard to change the base
devdesc. Take a page from CAM and put the 'header' in all the derived
classes and adjust the code to match.

For OFW, move the iHandle h_handle out of a slot conflicting with
d_opendata. Due to quirks in the alignment rules, this worked.
However changing the code to use d_opendata storage now that it's a
pointer is hard, so just have a separate field for it.

All other cleanups were to make the *_devdesc structures match where
they'd taken some liberties that were none-the-less compatible enough
to work.

r330810:
Remove d_type from devdesc. It's not needed as we can fetch it from
d_dev->dv_type when we need it.

r330811:
GC unused routines.

Sponsored by: Netflix

r330812:
Use the one-line-per-file pattern here, and sort the file names.

Sponsored by: Netflix

r330813:
Move the env convenience routines out of boot1.c.

These routines are more generally useful. Even though boot1 is on its
way out, it's better to make these common during the transition than
copy them.

r330814:
Star BootCurrent entry when booting.

Sponsored by: Netflix

r330815:
Print the load and device path as well as BootCurrent and BootOrder

Sponsored by: Netflix

r330837:
biosdisk.c should not set d_opendata.

Same as 330807, d_opendata is owned by open_disk and we should not
set it.

M    stand/i386/libi386/biosdisk.c

r330864:
Prefer uintXX_t to u_intXX_t

A foolish consistency is the hobgoblin of little minds, adored by
little statesmen and philosophers and divines. With consistency a
great soul has simply nothing to do. -- Ralph Waldo Emerson

r330883:
Fix typo that misteriously passes compilation.

6 years agostable/11: Mark EFI as a broken option on pc98
kevans [Fri, 6 Apr 2018 20:56:06 +0000 (20:56 +0000)]
stable/11: Mark EFI as a broken option on pc98

This is a direct commit to stable/11, due to pc98 removal in head.

6 years agoMFC r330365, r330371: OFW changes
kevans [Fri, 6 Apr 2018 20:27:55 +0000 (20:27 +0000)]
MFC r330365, r330371: OFW changes

r330365:
Move "common" Open Firmware parts of the loader used only on PowerPC to
the powerpc/ subdirectory. These have never used by SPARC and we have
no other (and almost certainly will have no other) Open Firmware platforms.
This makes the directory structure simpler and lets us avoid some
cargo-cult MI patterns on code that is, and always was,
architecture-specific.

r330371:
Where we can, pass the kernel an FDT facsimile of the OF device tree rather
than a pointer to Open Firmware by default. This eliminates a number of
potentially unsafe calls to firmware from the kernel and provides better
performance.

This feature is meant to be expanded until it is on by default
unconditionally and, ideally, we can then garbage-collect the
nightmare pile of hacks required to call into Open Firmware from a live
kernel.

6 years agoMFC r329190, r329315, r330131: metadata load file unification
kevans [Fri, 6 Apr 2018 20:24:50 +0000 (20:24 +0000)]
MFC r329190, r329315, r330131: metadata load file unification

r329190: Unify metadata load files for arm, mips, powerpc, sparc64

Summary:
All metadata.c files are very similar, with only trivial changes. Unify them
into a single common file, with minor special-casing where needed.

r329315: stand: Fix ubldr after r329190

metadata load files were consolidated in r329190, and these relocation fixup
bits were inadvertently dropped in the process. Re-add them to fix boot with
ubldr.

r330131: Fix module loading on arm after the metadata.c unification in
r329190. Arm modules need an additional address fixup not needed by other
platforms.

6 years agoMFC r330788: beri loader: Replace getc/putc with beri_ prefixed versions
kevans [Fri, 6 Apr 2018 19:59:27 +0000 (19:59 +0000)]
MFC r330788: beri loader: Replace getc/putc with beri_ prefixed versions

This matches a convention that we use, at least in ubldr, to prefix
getc/putc with a loader-specific prefix to avoid collisions. This was
encountered while trying to build the beri loader with MK_LOADER_LUA=yes.

6 years agoMFC r330249-r330250
kevans [Fri, 6 Apr 2018 19:54:10 +0000 (19:54 +0000)]
MFC r330249-r330250

r330249:
stand: Makefile SUBDIR cleanup

Use SUBDIR.${MK_*} where appropriate. r330248 eliminated most of the
offenders, sweep the rest under the rug.

Differential Revision: https://reviews.freebsd.org/D14545

r330250:
stand: Fix build after r330249

One does not simply convert to SUBDIR.yes in stand without making everything
else in the affected files SUBDIR.yes -- there are better ways to do this.

6 years agoRevert lua bits that snuck in with r332144
kevans [Fri, 6 Apr 2018 19:52:00 +0000 (19:52 +0000)]
Revert lua bits that snuck in with r332144

These will get re-MFC'd differently when we import lualoader from head. This
is a direct commit to stable/11

6 years agoMFC r330077, r330248
kevans [Fri, 6 Apr 2018 19:47:07 +0000 (19:47 +0000)]
MFC r330077, r330248

r330077:
Move EFI up to common makefile. There's no need for all these .if's
based on architecture.

Sponsored by: Netflix

r330248:
Create LOADER_UBOOT, and LOADER_OFW. Move these options out of
Makefile.${MACHINE_ARCH} and remove the now-empty files. Generate the
*32 directories on the necessary architectures (well, currently only
amd64) on the fly. Remove LOADER_EFI variable and co-locate it with
EFI.

6 years agoMFC r330056: libsa: replace remaining _write callbacks by null_write
kevans [Fri, 6 Apr 2018 19:34:21 +0000 (19:34 +0000)]
MFC r330056: libsa: replace remaining _write callbacks by null_write

There are some _write callbacks left only returning EROFS, replace them
by null_write. return EROFS from null_write().

6 years agoMFC r330026: libsa: Move MAXWAIT from net.h to net.c
kevans [Fri, 6 Apr 2018 19:24:04 +0000 (19:24 +0000)]
MFC r330026: libsa: Move MAXWAIT from net.h to net.c

It's not a setting that has any effect or use outside of the net.c context.

6 years agoMFC r329879, r329892
kevans [Fri, 6 Apr 2018 19:21:36 +0000 (19:21 +0000)]
MFC r329879, r329892

r329879:
libsa: Const-ify buffer argument of write(2) analog

r329892:
libsa: Change write(2)-alike prototype to match definition

Broken in r329879.

Apparently old GCC detects this, but modern GCC didn't.  Mea culpa.

6 years agoMFC r329859,r329860: Float protection in stand
kevans [Fri, 6 Apr 2018 19:17:59 +0000 (19:17 +0000)]
MFC r329859,r329860: Float protection in stand

r329859: Do not include float interfaces when using libsa.

We don't support float in the boot loaders, so don't include
interfaces for float or double in systems headers. In addition, take
the unusual step of spiking double and float to prevent any more
accidental seepage.

r329860: Floaty McFloatface is funnier...

6 years agoMFC r329758: Fix compilation with LOADER_DEBUG defined after r329725.
kevans [Fri, 6 Apr 2018 19:11:58 +0000 (19:11 +0000)]
MFC r329758: Fix compilation with LOADER_DEBUG defined after r329725.

6 years agoMFC r329745: load_elf.c: Use consistent indentation
kevans [Fri, 6 Apr 2018 19:10:11 +0000 (19:10 +0000)]
MFC r329745: load_elf.c: Use consistent indentation

As noted in D14267 load_elf.c has a variety of indentation styles.  Move
to standard 8 column hard tab indents, 4 space second level indents.
Also includes some whitespace cleanups found by clang-format.

6 years agoMFC r329345: Eliminate bsd.stand.mk and -fPIC 32-bit intel builds
kevans [Fri, 6 Apr 2018 19:01:08 +0000 (19:01 +0000)]
MFC r329345: Eliminate bsd.stand.mk and -fPIC 32-bit intel builds

OK. We don't really need a bsd.stand.mk, and it was causing a -fPIC
for the toolchain to be added (bogusly) when building on amd64. Pull
all relevant defs back into defs.mk and delete bsd.stand.mk.

This saves about 15-20k on i386 loader and zfsloader which when
combined with Lua give us a lot more stack space in those constrained
environments.

6 years agoMFC r329726, r329737, r329740
kevans [Fri, 6 Apr 2018 18:55:02 +0000 (18:55 +0000)]
MFC r329726, r329737, r329740

r329726:
Honor settings for including / excluding cd9660, ufs, ext2fs and msdos.

The Makefile gives the impression that ext2fs and msdos were excluded
(they weren't) and that you could exclude cd9660 and ufs support (you
couldn't). Allow those to be excluded.

We need to look, in the future, at trimming the number of supported
filesystems, and this will make that easier.

r329737:
Purely whitespace changes bringing this file closer to style(9).

Curiously, changing whitespace seems to cause the md5 of the .o files to differ
these days hence the following testing strategy:

Tested by: objdump -d | md5 (both in-tree clang and lang/gcc6)

r329740:
Further style(9) changes.

Tested by: objdump -d | md5 (both in-tree clang and lang/gcc6)

6 years agoMFC r329725, r329831
kevans [Fri, 6 Apr 2018 18:40:24 +0000 (18:40 +0000)]
MFC r329725, r329831

r329725:
Consolidate three copies of ZFS commands into a central location.

There's no reason to have multiple copies of lszfs and
reloadbe. Consolidate them into one location. Also ldi_get_size is the
same everywhere (except sparc64). Make it the same everywhere as the
common definition is more general and will work on spar64.

r329831:
Fix userboot w/ ZFS after r329725

r329725 cleaned up ZFS commands duplicated in multiple places, but userboot
was not setting HAVE_ZFS when MK_ZFS != "no". This resulted in a failure to
boot (as seen in PR 226118) in bhyve, with the following message:

/boot/userboot.so: Undefined symbol "ldi_get_size"

6 years agoMFC r329268, r329517
kevans [Fri, 6 Apr 2018 18:38:25 +0000 (18:38 +0000)]
MFC r329268, r329517

r329268:
efi: Only scan the BLKIO MEDIA once

Scan only the BLOCK IO MEDIA once instead of each time for each type of
device (fd, cd and hdd).
Leave the mechanism to free and reprobe all devices if one day we want
to implement a "dev rescan" thing.

r329517:
efi: Do not pad the efi devpath structure

This solve problem when booting with efi on armv7

6 years agoMFC efibootmgr: r326725-r326728, r326771, r326800-r326804, r326806, r327163
kevans [Fri, 6 Apr 2018 18:25:03 +0000 (18:25 +0000)]
MFC efibootmgr: r326725-r326728, r326771, r326800-r326804, r326806, r327163
 r327572-r327573, r327610-r327611, r327877, r331069

r326725:
Import Netflix's efibootmgr to help manage UEFI boot variables

efibootmgr manages the UEFI BootXXXX variables that implement the UEFI
Boot Manager protocol defined in the UEFI standards. It is modeled
after the Linux program of the same name with a mostly compatible set
of command line options. Since there's a fair amount of OS specifioc
code due to differeing names and methods of doing things, the
compatibility isn't 100%.

Basic functionality is implemented, though the more advanced next boot
functionality that's been defined elsewhere is unimplemented.

Submitted by: Matt Williams (with unix / efi path xlate by me)
Sponsored by: Netflix

r326726:
Forgotten in 326725

Release Notes: Yes

r326727:
Remove vestiges of -d and -p commands.
Fix two core dumps when optional data isn't specified.

Sponsored by: Netflix

r326728:
Indent multiple device path entries correctly.

Sponsored by: Netflix

r326771:
Unbreak gcc build by using (void) for functions that take no args.

Sponsored by: Netflix

r326800:
Check return value for set_bootvar and give a good error message.

CID: 1383601
Sponsored by: Netflix

r326801:
Don't leak new_data.

CID: 1383605
Sponsored by: Netflix

r326802:
Fix resource leak. Free converted description after printing it.
Also minor style sort of local vars.

CID: 1383606
Sponsored by: Netflix

r326803:
Free load_opt_buf after we're done with it.

CID: 1383607
Sponsored by: Netflix

r326804:
Add sanity testing against maximum sane lengths for device paths for
loader and kernel.

CID: 1383608
Sponsored by: Netflix

r326806:
Actually insert the free(d) call missed in r326802.

Noticed by: rpokala@

r327163:
Remove write-only opt and useless optlen variables.

This squashes the warning gebnerated by GCC 6.x. Since
variables that are now removed had come documentation
value, put relevant bits in comment, so they can be
resurrected from there when actually needed.

r327572:
Ensure that we have a description string. When unspecified, default to "".

Sponsored by: Netflix

r327573:
Free options before setting them. This will prevent us from leaking
memory when we have multiple copies of the same option from being
specified.

Sponsored by: Netflix

r327610:
Fix usage strings. -d and -p were removed before this was committed to
FreeBSD, but the strings weren't updated.

Sponsored by: Netflix

r327611:
There's no need / benefit from deleting the variable before we set it.

Sponsored by: Netflix

r327877:
Fix error in determining the next available boot slot.

Sponsored by: Netflix

r331069:
Make not getting BootOrder a warning, not a fatal error when printing.

Sponsored by: Netflix

Relnotes: yes

6 years agoMFC: r314875, r331963
jkim [Fri, 6 Apr 2018 18:23:42 +0000 (18:23 +0000)]
MFC: r314875, r331963

Catch up with Clang 6.0.

6 years agoMFC efivar changes: r321429, r323056-r323057, r323066, r323259-r323260,
kevans [Fri, 6 Apr 2018 18:10:38 +0000 (18:10 +0000)]
MFC efivar changes: r321429, r323056-r323057, r323066, r323259-r323260,
r323519, r325684, r326050-r326051, r326231, r326287, r326457-r326459,
r326472, r326658, r326805, r327574-r327575, r330279

r321429:
fix typo

r323056:
Fix printing File() nodes in device paths.

Device paths encoded into the FILEPATH_DEVICE_PATH are UCS2 not
ASCII/UTF8. Convert to utf8 and print that when printing File
paths. Also, since File may be at the end of a long device path,
output File() around the path so it doesn't just show up as random
nodes that might accidentally match real node paths names and cause
errors.

r323057:
Fix parsing File() nodes in device paths.

o Add File to the mUefiDevicePathLibDevPathFromTextTable table so we
  don't include 'File()' in the supposed path name. This happens because
  of a possible misfeature in the EDK2 code where any path that's not
  recognized is treated as a File() node.
o Convert utf8 input into ucs2 output rather than just copying the
  utf8 and hoping for the best (no good comes from that).
o Remove bogus comment about needing to add 1. The dummy array already
  is length 1, so that's included in sizeof the struct, so there's no
  need to add it.

Sponsored by: Netflix

r323066:
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

r323259:
Implement efidp_size

efidp_size will return the size, in bytes, of a EFI device path
structure. This is a convenience wrapper in the same style as the
other linux routines. It's implemented by GetDevicePathSize from EDK2
we already needed for other things.

Sponsored by: Netflix

r323260:
Create efi utility printing routines

Split out asciidump, utf8dump, bindump, and hexdump into a separate
file efiutil.c. Implement new efi_print_load_option for printing out
the EFI_LOADER_OPTION data structure used to specify different options
to the UEFI boot manager.

Sponsored by: Netflix

r323519:
Minor fixes to edge cases in efi_get_next_variable_name

Fix allocating more memory for the names (unlikely to be needed, but
still best to get right) to ask for the length the kernel told use we
needed, not the old length of the variable. Mind the proper NUL that
we add in the space we allocate. Free the old name string before we
allcoate a new one to limit what we leak to the last one (free passed
in name for the last one in the list), and detect the last one by rv
!= 0 and errno == ENOENT, rather then just the former to avoid false
positives if errno happens to be ENOENT on entry.

Sponsored by: Netflix

r325684:
Simplify the efivar interface a little.

We started out having Linux compatible libefivar interfaces. This was
in anticipation of porting the GPL'd efibootmgr to FreeBSD via a
port. However, since we need that functionality in the base, that port
isn't going to happened. It also appears that efivar is a private
library that's not used much outside a command line util and
efibootmgr. Reduce compatibility with the Linux version a little by
removing the mode parameter to efi_set_variable (which was unused on
FreeBSD, and not set to something useful in the code we'd
written). Also remove some efi error routines that were never
implemented and existed only to placate early GPL efibootmgr porting
experiments.

Suggested by: Matt Williams
Sponsored by: Netflix

r326050:
Document what the command line arguments actually do. List some of the
size limitations.

Sponsored by: Netflix

r326051:
This program is more useful if it skips leading whitespace when
parsing a textual UEFI Device Path, since otherwise it things the
passed in path is a filename. While here, reduce the repetition of
8192.

Sponsored by: Netflix

r326231:
Add efidp_format_device_path_node to format a single node in a device
path, much like efidp_format_device_path will format the entire path.

Sponsored by: Netflix

r326287:
efivar: add missing getopt 'u' option

r326457:
Read multiple lines when parsing the data. Allow multiple device paths
to be read when formatting device paths. Set the upper limit to 64k
(most of these paths are < 64 bytes).

Sponsored by: Netflix

r326458:
Create a function to translate UEFI paths to unix paths

efivar_device_path_to_unix_path translates from UEFI to Unix
efivar_unix_path_to_device_path translates from Unix to UEFI

At present, only HD() device types are supported (both GPT and
MBR). CdRom and floppy devices aren't supported. ZFS isn't supported
because there's no way in the UEFI standard to specify a ZFS datastore.
Network devices aren't supported either.

Three forms of Unix path are accepted: /path/to/file (for a mounted
filesystem), //path/to/file (uses the EFI partition on the same disk
as /), and dev:/path/to/file (for unmounted filesystem). Two forms are
produced (the first and last).

Sponsored by: Netflix

r326459:
Add -u (--to-unix) and -e (--to-efi) to convert unix or efi paths to
the other.

Sponsored by: Netflix

r326472:
Add forgotten libgeom.

Sponsored by: Netflix

r326658:
Ensure that "out" is initialized in all error paths.

Reported by: gcc
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D13402

r326805:
Iniailize str so ucs2_to_utf8 won't free stack garbage.

CID: 1381037
Sponsored by: Netflix

r327574:
Set dp to NULL when we free it, and tree a NULL dp as an error
condition. This should prevent a double free. In addition, prevent a
leak by freeing dp each loop and when we're done.

CID: 1383577
Sponsored by: Netflix

r327575:
Need to convert '/' back to '\' when creating a path. Ideally, this
would be filesystem type dependent, but that's difficult to accomplish
and it's unclear how the UEFI firmware will cope. Be conservative and
make boot loaders cope instead.

Sponsored by: Netflix

r330279:
libefivar: use standard 2-Clause FreeBSD license

Approved by: imp
Sponsored by: The FreeBSD Foundation

6 years agoMFC r331212,r331213: Move /boot/overlays to /boot/dtb/overlays
kevans [Fri, 6 Apr 2018 17:04:21 +0000 (17:04 +0000)]
MFC r331212,r331213: Move /boot/overlays to /boot/dtb/overlays

r331212: Move /boot/overlays to /boot/dtb/overlays

The former is fairly vague; these are FDT overlays to be applied to the
running system, so /boot/dtb is a sensible location to put it without
cluttering up /boot/dtb even further if desired.

r331213: Amend missed reference to /boot/overlays

6 years agoMFC r330005-r330007, r330021, r330029, r330622, r331207: Solo loader.conf(5)
kevans [Fri, 6 Apr 2018 16:59:58 +0000 (16:59 +0000)]
MFC r330005-r330007, r330021, r330029, r330622, r331207: Solo loader.conf(5)

r330005:
Go back to one loader.conf

We really only need one loader.conf. The other loader.conf was created
because the current one took forever to parse in FORTH. That will be
fixed in the next commit.

r330006:
Take a meat cleaver to defaults/loader.conf

Remove almost all of the _load=XXX options (kept only those relevant
to splash screens, since there were other settings).
Remove the excessively cutesy comment blocks.
Remove excessive comments and replace with similar content
Remove gratuitous blank lines (while leaving some)

We have too many modules to list them all here. There's no purpose in
doing so and it's a giant hassle to maintain. In addition the extra
~500 lines slow this down on small platforms. It slowed it down
so much small platforms forked, which caused other issues...
This is a compromise between those two extremes.

r330007:
loader.conf is loader agnostic, so remove 4th references.

r330021:
These two directories build man pages, so it's incorrect to tag them
NO_OBJ. Also, make sure the loader.conf.5 man gets built and installed.

r330029:
Fix a typo: "now" -> "no".

r330622:
loader.conf(5): Document some other settings

These tend to have less coverage in other places and they don't have
defaults as of yet, so mention them here:
- fdt_overlays
- kernels_autodetect (lualoader only)

r331207:
loader.conf: remove obsolete non-x86 beastie menu statement

As of r330005 the same loader.conf defaults are used on all platforms.

6 years agoMFC r331868:
ian [Fri, 6 Apr 2018 16:48:07 +0000 (16:48 +0000)]
MFC r331868:

Add opt_platform.h for several modules that have #ifdef FDT in the source.

Submitted by: Andre Albsmeier <Andre.Albsmeier@siemens.com>

PR: 227322 227323

6 years agoMFC r320160: dtc: Update to upstream 917526
kevans [Fri, 6 Apr 2018 16:45:00 +0000 (16:45 +0000)]
MFC r320160: dtc: Update to upstream 917526

- Add missing "typename" in divmod's  "using" of
  binary_operator_base::result.

6 years agoMFC r331934:
markj [Fri, 6 Apr 2018 15:09:30 +0000 (15:09 +0000)]
MFC r331934:
Wrap long lines.

6 years agoMFC r331761: align i386 cpu_reset() with amd64 version
avg [Fri, 6 Apr 2018 12:39:33 +0000 (12:39 +0000)]
MFC r331761: align i386 cpu_reset() with amd64 version

6 years agoMFC r330977: g_access: deal with races created by geoms that drop the topology lock
avg [Fri, 6 Apr 2018 12:13:32 +0000 (12:13 +0000)]
MFC r330977: g_access: deal with races created by geoms that drop the topology lock

PR: 225960

6 years agoMFC r330295: ZFS: fix adding vdevs to very large pools
avg [Fri, 6 Apr 2018 11:42:08 +0000 (11:42 +0000)]
MFC r330295: ZFS: fix adding vdevs to very large pools

PR: 226096

6 years agoMFC r331760:
kib [Fri, 6 Apr 2018 09:25:08 +0000 (09:25 +0000)]
MFC r331760:
Make vm_map_max/min/pmap KBI stable.

6 years agostable/11: Bump FreeBSD_Version for recent rc ${name}_limits bits
kevans [Fri, 6 Apr 2018 02:47:43 +0000 (02:47 +0000)]
stable/11: Bump FreeBSD_Version for recent rc ${name}_limits bits

Some ports had their own interpretation of _limits that conflicted with the
new definition as of r328331. r331880 was an MFC of this commit to
stable/11. Bump FreeBSD_Version in stable/11 following r331880 so that ports
can do the right thing.

This is a direct commit to stable/11

Reported by: 0mp

6 years agoMFC r331245:
markj [Thu, 5 Apr 2018 15:52:20 +0000 (15:52 +0000)]
MFC r331245:
Drop KTR_CONTENTION.

6 years agoMFC r331738, r331853:
markj [Thu, 5 Apr 2018 15:37:49 +0000 (15:37 +0000)]
MFC r331738, r331853:
Have TD_LOCKS_DEC() assert that td_locks is positive.

6 years agoMFC: r304147(bde)
rgrimes [Thu, 5 Apr 2018 14:55:44 +0000 (14:55 +0000)]
MFC: r304147(bde)

Remove duplicate definition of get_pcb_td().  gcc works for detecting
this error.

Approved by:  bde (mentor)

6 years agoMFC r331442: Fixup return style(9) in amd64 linux*_sysvec.c
emaste [Thu, 5 Apr 2018 14:25:39 +0000 (14:25 +0000)]
MFC r331442: Fixup return style(9) in amd64 linux*_sysvec.c

6 years agoMFC r331757: Correct comment typo in Hyper-V
emaste [Thu, 5 Apr 2018 12:59:50 +0000 (12:59 +0000)]
MFC r331757: Correct comment typo in Hyper-V

PR: 226665
Submitted by: Ryo ONODERA

6 years agoMFC r332045: Fix kernel memory disclosure in tcp_ctloutput
emaste [Thu, 5 Apr 2018 12:56:40 +0000 (12:56 +0000)]
MFC r332045: Fix kernel memory disclosure in tcp_ctloutput

strcpy was used to copy a string into a buffer copied to userland, which
left uninitialized data after the terminating 0-byte.  Use the same
approach as in tcp_subr.c: strncpy and explicit '\0'.

admbugs: 765, 822
Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Reported by: Vlad Tsyrklevich
Security: Kernel memory disclosure
Sponsored by: The FreeBSD Foundation

6 years agoMFC r332042: Fix kernel memory disclosure in linux_ioctl_socket
emaste [Thu, 5 Apr 2018 12:54:12 +0000 (12:54 +0000)]
MFC r332042: Fix kernel memory disclosure in linux_ioctl_socket

strlcpy is used to copy a string into a buffer to be copied to userland,
previously leaving uninitialized data after the terminating NUL.  Zero
the buffer first to avoid a kernel memory disclosure.

admbugs: 765, 811
Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Reported by: Vlad Tsyrklevich
Sponsored by: The FreeBSD Foundation

6 years agoMFC r332034: linux_ioctl_hdio: fix kernel memory disclosure
emaste [Thu, 5 Apr 2018 12:48:58 +0000 (12:48 +0000)]
MFC r332034: linux_ioctl_hdio: fix kernel memory disclosure

Stack-allocated struct linux_hd_big_geometry has undeclared padding
copied to userland.

admbugs: 765
Reported by: Vlad Tsyrklevich
Security: Kernel memory disclosure
Sponsored by: The FreeBSD Foundation

6 years agoMFC r331718: stand: Add workaround for HP BIOS issues
kevans [Thu, 5 Apr 2018 00:41:33 +0000 (00:41 +0000)]
MFC r331718: stand: Add workaround for HP BIOS issues

hrs@ and kuriyama@ have found that on some HP BIOS, a system will fail to
boot immediately after installation with the claim that it can't work out
which disk they are booting from.

They tracked it down to a buffer overrun, and found that it could be
alleviated by doing a dummy read before-hand.

6 years agoMFC r331739
davidcs [Wed, 4 Apr 2018 23:53:29 +0000 (23:53 +0000)]
MFC r331739
1. Add additional debug prints.
2. Break transmit when IFF_DRV_RUNNING is OFF.
3. set desc_count=0 for default case in switch in ql_rcv_isr()

6 years agoMFC r331005-r331006
bapt [Wed, 4 Apr 2018 20:29:55 +0000 (20:29 +0000)]
MFC r331005-r331006

r331005:
Fix tab vs space indentation

r331006:
Add termcap entries for the st terminal (https://st.suckless.org)

6 years agoMFC r331766, r331768:
ken [Wed, 4 Apr 2018 18:06:52 +0000 (18:06 +0000)]
MFC r331766, r331768:

  ------------------------------------------------------------------------
  r331766 | ken | 2018-03-30 09:28:25 -0600 (Fri, 30 Mar 2018) | 25 lines

  Bring in the Broadcom/Emulex Fibre Channel driver, ocs_fc(4).

  The ocs_fc(4) driver supports the following hardware:

  Emulex 16/8G FC GEN 5 HBAS
   LPe15004 FC Host Bus Adapters
   LPe160XX FC Host Bus Adapters

  Emulex 32/16G FC GEN 6 HBAS
   LPe3100X FC Host Bus Adapters
   LPe3200X FC Host Bus Adapters

  The driver supports target and initiator mode, and also supports FC-Tape.

  Note that the driver only currently works on little endian platforms.  It
  is only included in the module build for amd64 and i386, and in GENERIC
  on amd64 only.

  Submitted by: Ram Kishore Vegesna <ram.vegesna@broadcom.com>
  Reviewed by: mav
  Relnotes: yes
  Sponsored by: Broadcom
  Differential Revision: https://reviews.freebsd.org/D11423

  ------------------------------------------------------------------------
  r331768 | cem | 2018-03-30 10:44:54 -0600 (Fri, 30 Mar 2018) | 9 lines

  ocs_fc(4): Fix GCC build (-Wredundant-decls)

  These objects are defined earlier in the same file; an extern declaration
  after definition is redundant.

  Broken in r331766 (introduction of ocs_fc(4)).

  Sponsored by: Dell EMC Isilon

  ------------------------------------------------------------------------

Differential Revision: https://reviews.freebsd.org/D11423
Relnotes: yes

6 years agoMFC r328951: Refactor cleanvar to remove shell expansion vulnerability
kevans [Wed, 4 Apr 2018 17:00:18 +0000 (17:00 +0000)]
MFC r328951: Refactor cleanvar to remove shell expansion vulnerability

If any process creates a directory named "-P" in /var/run or
/var/spool/lock it will cause the purgedir function to start to rm -r /.

Simplify a lot of complicated shell logic by leveraging find(1).

6 years agoMFC r307826,r328949: Firstboot fs mount changes
kevans [Wed, 4 Apr 2018 16:59:10 +0000 (16:59 +0000)]
MFC r307826,r328949: Firstboot fs mount changes

MFC r307826: Use checkyesno instead of rolling my own..

MFC r328949: Fix firstboot fs mount logic

The firstboot logic has an error which causes the filesystem to be
mounted readonly even though root_rw_mount=YES. This fixes the error to
ensure that the root filesystem is mounted rw as expected after the run
of the firstboot scripts.

6 years agoMFC r330356 (eadler): sys/linux: Fix a few potential infoleaks in Linux IPC
emaste [Wed, 4 Apr 2018 14:09:44 +0000 (14:09 +0000)]
MFC r330356 (eadler): sys/linux: Fix a few potential infoleaks in Linux IPC

admbugs: 765, 812, 813, 814
Submitted by: Domagoj Stolfa <domagoj.stolfa@gmail.com>
Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Reported by: Vlad Tsyrklevich

6 years agoMFC r331413: efidev: Drop a quick note in about efi_cfgtbl/efi_runtime
kevans [Wed, 4 Apr 2018 14:01:10 +0000 (14:01 +0000)]
MFC r331413: efidev: Drop a quick note in about efi_cfgtbl/efi_runtime

There's no real annotation for it, so it's not immediately obvious to the
unfamiliar that these pointers are to locations in the EFI runtime map
unlike the system table pointer immediately above them.

6 years agoMFC r330844: Correct minor typo in comment, efi_dmcap -> efi_tmcap
kevans [Wed, 4 Apr 2018 13:59:42 +0000 (13:59 +0000)]
MFC r330844: Correct minor typo in comment, efi_dmcap -> efi_tmcap

6 years agoMFC r330868, r331241, r331361, r331365: EFIRT Fixes
kevans [Wed, 4 Apr 2018 13:58:18 +0000 (13:58 +0000)]
MFC r330868, r331241, r331361, r331365: EFIRT Fixes

r330868:
EFIRT: SetVirtualAddressMap with 1:1 mapping after exiting boot services

This fixes a problem encountered on the Lenovo Thinkpad X220/Yoga 11e where
runtime services would try to inexplicably jump to other parts of memory
where it shouldn't be when attempting to enumerate EFI vars, causing a
panic.

The virtual mapping is enabled by default and can be disabled by setting
efi_disable_vmap in loader.conf(5).

r331241:
Check if the gettime runtime service is valid.

The U-Boot efi runtime service expects us to set the address map before
calling any runtime services. It will then remap a few functions to their
runtime version. One of these is the gettime function. If we call into
this without having set a runtime map we get a page fault.

Add a check to see if this is valid in efi_init() so we don't try to use
the possibly invalid pointer.

r331361:
Enter into the EFI environment before dereferencing the runtime services
pointer. This may be within the EFI address space and not the FreeBSD
kernel address space.

r331365:
Re-work efidev ordering to fix efirt preloaded by loader on amd64

On amd64, efi_enter calls fpu_kern_enter(). This may not be called until
fpuinitstate has been invoked, resulting in a kernel panic with
efirt_load="YES" in loader.conf(5).

Move fpuinitstate a little earlier in SI_SUB_DRIVERS so that we can squeeze
efirt between it and efirtc at SI_SUB_DRIVERS, SI_ORDER_ANY. efidev must be
after efirt and doesn't really need to be at SI_SUB_DEVFS, so drop it at
SI_SUB_DRIVER, SI_ORDER_ANY.

The not immediately obvious dependency of fpuinitstate by efirt has been
noted in both places.

6 years agoMFC r331743: Add libdl to clibs package
kevans [Wed, 4 Apr 2018 13:54:51 +0000 (13:54 +0000)]
MFC r331743: Add libdl to clibs package

libdl is a filter on libc, and pretty lightweight. Add it to the 'clibs'
package with libc, effectively tying them together in a pkgbase world.

6 years agoMFC r328201:
mmel [Wed, 4 Apr 2018 13:23:06 +0000 (13:23 +0000)]
MFC r328201:

  Convert extres/phy to kobj model.  Similarly as other extres pseudo-drivers,
  implement phy by using kobj model.  This detaches it from provider device, so
  single device driver can export multiple different phys. Additionally, this
  allows phy to be subclassed to more specialized drivers, like is USB OTG phy,
  or PCIe phy with hot-plug capability.

6 years agoMFC r330354 (eadler): sys/fuse: fix off by one error
emaste [Wed, 4 Apr 2018 13:15:12 +0000 (13:15 +0000)]
MFC r330354 (eadler): sys/fuse: fix off by one error

Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Submitted by: Domagoj Stolfa <domagoj.stolfa@gmail.com>

6 years agoMFC (cherry pick)r306197,r306327,r306328,r308390,r308391,r310600,r314703:
mmel [Wed, 4 Apr 2018 11:30:20 +0000 (11:30 +0000)]
MFC (cherry pick)r306197,r306327,r306328,r308390,r308391,r310600,r314703:

  cherry pick from r306197:
    Nvidia Tegra 124 and Jetson TK1 related DTS.
  r306327:
    Update AHCI driver to match new dts tree
  r306328:
    Update PCI driver to match new dts tree
  r308390:
    Rework NVIDIA Tegra124 XUSBPAD driver.
     - Adapt it for new, incompatible, DT bindings introduced by r306197.  -
     Add support for USB super speed pads/ports.
  r308391:
    Add NVIDIA Tegra XHCI driver and coresponding firmware blob.
  r310600:
    Implement drivers for NVIDIA tegra124 display controller, HDMI source and
    host1x module. Unfortunately, tegra124 SoC doesn't have 2D acceleration
    engine and 3D requires not yet started nouveau driver.
  r314703:
    Add support for card detect and write protect gpio pins to Tegra SDHCI.

6 years agoMFC r331828:
hselasky [Wed, 4 Apr 2018 08:41:10 +0000 (08:41 +0000)]
MFC r331828:
Optimise use of Giant in the LinuxKPI.

- Make sure Giant is locked when calling PCI device methods.
Newbus currently requires this.

- Avoid unlocking Giant right before aquiring the sleepqueue lock.
This can save a task switch.

Sponsored by: Mellanox Technologies

6 years agoMFC r331694:
hselasky [Wed, 4 Apr 2018 08:39:59 +0000 (08:39 +0000)]
MFC r331694:
Swap two instances of regular macros with function macros in the LinuxKPI,
to narrow down the substitution scope.

Sponsored by: Mellanox Technologies

6 years agoMFC r331642:
hselasky [Wed, 4 Apr 2018 08:37:24 +0000 (08:37 +0000)]
MFC r331642:
Add support for right and middle click with integrated button to WSP
USB trackpad driver.

Submitted by: James Wright <james.wright@jigsawdezign.com>
PR: 226961
Sponsored by: Mellanox Technologies

6 years agoMFC r328467:
mmel [Wed, 4 Apr 2018 06:11:05 +0000 (06:11 +0000)]
MFC r328467:

  Implement mitigation for Spectre version 2 attacks on ARMv7.

6 years agoMFC r331981:
gordon [Wed, 4 Apr 2018 05:24:59 +0000 (05:24 +0000)]
MFC r331981:

Limit glyph count in vtfont_load to avoid integer overflow.

Invalid font data passed to PIO_VFONT can result in an integer overflow
in glyphsize.  Characters may then be drawn on the console using glyph
map entries that point beyond the end of allocated glyph memory,
resulting in a kernel memory disclosure.

Submitted by:   emaste
Reported by:    Dr. Silvio Cesare of InfoSect
Security:       CVE-2018-6917
Security:       FreeBSD-SA-18:04.vt
Sponsored by:   The FreeBSD Foundation

6 years agoMFC r330074:
mmel [Wed, 4 Apr 2018 02:31:14 +0000 (02:31 +0000)]
MFC r330074:

  Define meaning of remaining clock rounding flags combinations.