]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMFC r340321: Move definition of $jail_conf variable to /etc/defaults/rc.conf
eugen [Mon, 10 Dec 2018 14:12:04 +0000 (14:12 +0000)]
MFC r340321: Move definition of $jail_conf variable to /etc/defaults/rc.conf
from jail startup script so it can be successfully queried
with the command "sysrc jail_conf".

5 years agoMFC r340319: jail(8): introduce new command option -e to exhibit
eugen [Mon, 10 Dec 2018 13:47:05 +0000 (13:47 +0000)]
MFC r340319: 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.

5 years agoMFC r341448:
kib [Mon, 10 Dec 2018 01:39:40 +0000 (01:39 +0000)]
MFC r341448:
Print type designator 'D' for the KF_TYPE_DEV files.

5 years agoMFC r341447:
kib [Mon, 10 Dec 2018 01:38:48 +0000 (01:38 +0000)]
MFC r341447:
Improve procstat reporting for the linux cdev file descriptors.

5 years agoMFC r341439:
kib [Mon, 10 Dec 2018 00:59:10 +0000 (00:59 +0000)]
MFC r341439:
Provide naive but self-contained implementations of memset(3) and
bzero(3) for rtld.

5 years agoMFC r341441:
kib [Mon, 10 Dec 2018 00:57:56 +0000 (00:57 +0000)]
MFC r341441:
Some fixes for LD_BIND_NOW + ifuncs.

5 years agoMFC r340046, r340050
araujo [Sun, 9 Dec 2018 06:42:06 +0000 (06:42 +0000)]
MFC r340046, r340050

r340046:
Add support ps/2 scancodes for NumLock, ScrollLock and numerical keypad
keys.

PR: 213835
Submitted by: Vasily Postnicov <ivan.zhmudo@gmail.com>
Relnotes: Yes
Sponsored by: iXsystems Inc.

r340050:
Remove printf for debug purpose forgotten on r340046.

Reported by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>

5 years agoMFC r316939:
avos [Sun, 9 Dec 2018 05:35:22 +0000 (05:35 +0000)]
MFC r316939:
[lib80211] fix a missing cleanup path.

PR: lib/218655
Reported by: <valentin.vergez@stormshield.eu>

5 years agoMFC: r340745, fix CU: output of the --debug-dump=decodedline.
sobomax [Sun, 9 Dec 2018 03:07:45 +0000 (03:07 +0000)]
MFC: r340745, fix CU: output of the --debug-dump=decodedline.

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

5 years agoMFC r341397:
kib [Sun, 9 Dec 2018 00:42:56 +0000 (00:42 +0000)]
MFC r341397:
Correct accuracy of the barrier writes accounting.

5 years agoMFC r341377, r341388 (fixup):
cy [Sat, 8 Dec 2018 17:50:00 +0000 (17:50 +0000)]
MFC r341377, r341388 (fixup):

Restore handling of PMTU discovery, removed through an unifdef(1)
following the MFV of r254219 into r255332. In addition the 'FreeBSD'
macro was never defined in ipfilter 5.1.2 thus it never would have
been enabled in the first place.

This work is prompted by a general cleanup of the IP Filter code
prompted by working to resolve a PR. More to follow.

5 years agoMFC r341384:
cy [Sat, 8 Dec 2018 17:28:52 +0000 (17:28 +0000)]
MFC r341384:

Remove IFF_DRVRLOCK as it is used in IRIX only (and we all know IRIX
is dead). This includes collaterally removing code shared by HP/UX,
SGI, and Linux, where IP Filter will in all likelihood for various
reasons never run again.

5 years agoMFC r341375:
kib [Sat, 8 Dec 2018 00:48:10 +0000 (00:48 +0000)]
MFC r341375:
Allow to create swap zone larger than v_page_count / 2.

5 years agoMFC r341374:
kib [Sat, 8 Dec 2018 00:47:22 +0000 (00:47 +0000)]
MFC r341374:
Correct the tunable name in the message.

PR: 231577

5 years agoMFC r340245: ping(8): improve diagnostics in case of wrong arguments.
eugen [Sat, 8 Dec 2018 00:33:20 +0000 (00:33 +0000)]
MFC r340245: ping(8): improve diagnostics in case of wrong arguments.

  For example, in case of super-user:
  $ sudo ping -s -64 127.0.0.1
  PING 127.0.0.1 (127.0.0.1): -64 data bytes
  ping: sendto: Invalid argument

  For unprivileged user:
  $ ping -s -64 127.0.0.1
  ping: packet size too large: 18446744073709551552 > 56: Operation not permitted

  Fix this by switching from strtoul() to strtol() for integer arguments
  and adding explicit checks for negative values.

5 years agoMFC r341280:
cy [Fri, 7 Dec 2018 21:42:41 +0000 (21:42 +0000)]
MFC r341280:

Clean up a rather useless conditional structure member definition.

5 years agoMFC r341008:
ae [Fri, 7 Dec 2018 09:39:37 +0000 (09:39 +0000)]
MFC r341008:
  Fix possible panic during ifnet detach in rtsock.

  The panic can happen, when some application does dump of routing table
  using sysctl interface. To prevent this, set IFF_DYING flag in
  if_detach_internal() function, when ifnet under lock is removed from
  the chain. In sysctl_rtsock() take IFNET_RLOCK_NOSLEEP() to prevent
  ifnet detach during routes enumeration. In case, if some interface was
  detached in the time before we take the lock, add the check, that ifnet
  is not DYING. This prevents access to memory that could be freed after
  ifnet is unlinked.

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

5 years agoMFC r340863:
kib [Fri, 7 Dec 2018 00:39:34 +0000 (00:39 +0000)]
MFC r340863:
Generalize ELF parse_notes().

5 years agoMFC r340862:
kib [Fri, 7 Dec 2018 00:38:21 +0000 (00:38 +0000)]
MFC r340862:
Trivial reduction of the code duplication, reuse the return FALSE code.

5 years agoFix kenv handling in stable/11 following r337333
kevans [Thu, 6 Dec 2018 19:18:51 +0000 (19:18 +0000)]
Fix kenv handling in stable/11 following r337333

The aforementioned commit merged revised static_env/static_hint handling to
allow static_env and loader env to coexist with the variable
loader_env.disabled=0. init_static_kenv had been rewritten slighly in an
attempt to maintain historical behavior: the static environment and loader
environment are mutually exclusive, unless the latter disables the former.

The rewritten version botched this by only setting up the loader environment
if the static environment was empty or if the loader environment was
specifically enabled. It was never given a chance to disable the static
environment, so the default behavior was broken unless the loader
environment was specifically enabled by the static environment.

Rewrite this again to do the right thing:
- Setup the static environment and check loader_env.disabled; if it's
  explicitly enabled, we're done.
- Check static_{env,hints}.disabled and "empty out" the respective
  environments as needed
- Finally, check: if the static environment is not empty and we've not
  explicitly re-enabled the static environment with loader_env.disabled=0,
  we tear the loader environment (which was setup to 'keep things simple')
  down again.

Future commits to head (and subsequently MFC'd) will likely zero these
environments out if they're disabled since this normally happens when
they're merged into the dynamic environment.

This is a direct commit to stable/11 because this particular bug does not
apply to head.

Fixes: r337333
Reported by: bde

5 years agoMFC r339827:
yuripv [Thu, 6 Dec 2018 11:52:07 +0000 (11:52 +0000)]
MFC r339827:
localedef: define characters in "space" class also as "print", except
for the known conflicts ("control" characters can't be "print"able).
POSIX doesn't explicitly forbid this, and actually includes <space>
character in "print".

PR: 225692
Reviewed by: bapt, cem (previous version), pfg (previous version)
Differential Revision: https://reviews.freebsd.org/D17467

5 years agoMFC r339311, r339313:
yuripv [Thu, 6 Dec 2018 11:49:52 +0000 (11:49 +0000)]
MFC r339311, r339313:
Restore some of the ctype definitions reported in the PR from pre-CLDR
data, namely 0xE000-0xF8FF private use area, and 0xFF00-0xFFF half- and
fullwidth punctuation.

While here, update tools/tools/locale/README based on my experience
rebuilding the locale data.

PR: 225692
Reviewed by: bapt, cem (previous version)
Differential Revision: https://reviews.freebsd.org/D17471

5 years agoMFC r340111:
bapt [Thu, 6 Dec 2018 08:27:56 +0000 (08:27 +0000)]
MFC r340111:

nfsd: Factorize code

Factorize code by using struct sockaddr_storage to handle both ipv6 and ipv4

Discussed with: rmacklem
Reviewed by: manu
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D13223

5 years agoMFC r341265:
cy [Thu, 6 Dec 2018 04:28:39 +0000 (04:28 +0000)]
MFC r341265:

Remove an old comment/code and replace with a comment that
directly references a NetBSD commit.

5 years agonetmap: fix module Makefile
vmaffione [Wed, 5 Dec 2018 15:05:26 +0000 (15:05 +0000)]
netmap: fix module Makefile

Reported by: mav

5 years agoMFC r339042:
tuexen [Tue, 4 Dec 2018 22:52:15 +0000 (22:52 +0000)]
MFC r339042:

Mitigate providing a timing signal if the COOKIE or AUTH
validation fails.
Thanks to jmg@ for reporting the issue, which was discussed in
https://admbugs.freebsd.org/show_bug.cgi?id=878

5 years agoMFC r341335:
tuexen [Tue, 4 Dec 2018 22:25:24 +0000 (22:25 +0000)]
MFC r341335:

Limit option_len for the TCP_CCALGOOPT.

Limiting the length to 2048 bytes seems to be acceptable, since
the values used right now are using 8 bytes.
This issue was found by using syzkaller.

Reviewed by: glebius, bz, rrs
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D18366

5 years agoDocument SA-18:14.
gjb [Tue, 4 Dec 2018 19:55:39 +0000 (19:55 +0000)]
Document SA-18:14.

Sponsored by: The FreeBSD Foundation

5 years agoMFC r341442, r341443:
markj [Tue, 4 Dec 2018 19:07:10 +0000 (19:07 +0000)]
MFC r341442, r341443:
Plug memory disclosures via ptrace(2).

5 years agoMFC r341484
gordon [Tue, 4 Dec 2018 18:32:50 +0000 (18:32 +0000)]
MFC r341484

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

5 years agoMFC r341430
vmaffione [Tue, 4 Dec 2018 17:53:56 +0000 (17:53 +0000)]
MFC r341430

netmap(4): improve man page

Reviewed by:    bcr
Differential Revision:  https://reviews.freebsd.org/D18057

5 years agoMFC r341145
vmaffione [Tue, 4 Dec 2018 17:49:44 +0000 (17:49 +0000)]
MFC r341145

cxgbe: revert r309725

After the fix contained in r341144, cxgbe does not need anymore
to set the IFCAP_NETMAP flag manually.

Reviewed by:    np
Approved by:    gnn (mentor)
Differential Revision:  https://reviews.freebsd.org/D17987

5 years agoMFC r341144
vmaffione [Tue, 4 Dec 2018 17:47:43 +0000 (17:47 +0000)]
MFC r341144

netmap: set IFCAP_NETMAP in if_capabilities

Revision r307394 removed (by mistake) the code that sets IFCAP_NETMAP
in if_capabilities on netmap_attach. This patch reverts this change.

Reviewed by:    np
Approved by:    gnn (mentor)
Differential Revision:  https://reviews.freebsd.org/D17987

5 years agoMFC r340475
vmaffione [Tue, 4 Dec 2018 17:46:06 +0000 (17:46 +0000)]
MFC r340475

ifnet(9): Add description of IFCAP_NETMAP

Describe IFCAP_NETMAP adding a cross reference to netmap(4).

Reviewed by:    bcr, 0mp
Approved by:    gnn (mentor)
Differential Revision:  https://reviews.freebsd.org/D17988

5 years agoMFC r340436
vmaffione [Tue, 4 Dec 2018 17:44:12 +0000 (17:44 +0000)]
MFC r340436

vtnet: fix netmap support

netmap(4) support for vtnet(4) was incomplete and had multiple bugs.
This commit fixes those bugs to bring netmap on vtnet in a functional state.

Changelist:
  - handle errors returned by virtqueue_enqueue() properly (they were
    previously ignored)
  - make sure netmap XOR rest of the kernel access each virtqueue.
  - compute the number of netmap slots for TX and RX separately, according to
    whether indirect descriptors are used or not for a given virtqueue.
  - make sure sglist are freed according to their type (mbufs or netmap
    buffers)
  - add support for mulitiqueue and netmap host (aka sw) rings.
  - intercept VQ interrupts directly instead of intercepting them in txq_eof
    and rxq_eof. This simplifies the code and makes it easier to make sure
    taskqueues are not running for a VQ while it is in netmap mode.
  - implement vntet_netmap_config() to cope with changes in the number of queues.

Reviewed by:    bryanv
Approved by:    gnn (mentor)
Sponsored by:   Sunny Valley Networks
Differential Revision:  https://reviews.freebsd.org/D17916

5 years agoMFC r339639
vmaffione [Tue, 4 Dec 2018 17:40:56 +0000 (17:40 +0000)]
MFC r339639

netmap: align codebase to the current upstream (sha 8374e1a7e6941)

Changelist:
    - Move large parts of VALE code to a new file and header netmap_bdg.[ch].
      This is useful to reuse the code within upcoming projects.
    - Improvements and bug fixes to pipes and monitors.
    - Introduce nm_os_onattach(), nm_os_onenter() and nm_os_onexit() to
      handle differences between FreeBSD and Linux.
    - Introduce some new helper functions to handle more host rings and fake
      rings (netmap_all_rings(), netmap_real_rings(), ...)
    - Added new sysctl to enable/disable hw checksum in emulated netmap mode.
    - nm_inject: add support for NS_MOREFRAG

Approved by:    gnn (mentor)
Differential Revision:  https://reviews.freebsd.org/D17364

5 years agoMFC r341094:
kib [Tue, 4 Dec 2018 16:53:28 +0000 (16:53 +0000)]
MFC r341094:
Improve sigonstack().

5 years agoMFC r327860: ANSIfy function definitions in sys/vm/
emaste [Tue, 4 Dec 2018 15:04:48 +0000 (15:04 +0000)]
MFC r327860: ANSIfy function definitions in sys/vm/

5 years agoMFC r341073:
ae [Tue, 4 Dec 2018 09:18:28 +0000 (09:18 +0000)]
MFC r341073:
  Do not limit the mbuf queue length for keepalive packets.

  It was unlimited before overhaul, and one user reported that this limit
  can be reached easily.

  PR: 233562

5 years agoMFC r340135: Make ng_pptpgre(8) netgraph node be able to restore order
eugen [Tue, 4 Dec 2018 07:48:43 +0000 (07:48 +0000)]
MFC r340135: Make ng_pptpgre(8) netgraph node be able to restore order
for packets reordered in transit instead of dropping them altogether.
It uses sequence numbers of PPtPGRE packets.

A set of new sysctl(8) added to control this ability or disable it:

net.graph.pptpgre.reorder_max (1) defines maximum length of node's
private reorder queue used to keep data waiting for late packets.
Zero value disables reordering. Default value 1 allows the node to restore
the order for two packets swapped in transit. Greater values allow the node
to deliver packets being late after more packets in sequence
at cost of increased kernel memory usage.

net.graph.pptpgre.reorder_timeout (1) defines time value in miliseconds
used to wait for late packets. It may be useful to increase this
if reordering spot is distant.

5 years agoMFC r340110: ipfw(8): clarify layer2 processing abilities
eugen [Tue, 4 Dec 2018 07:34:47 +0000 (07:34 +0000)]
MFC r340110: ipfw(8): clarify layer2 processing abilities

Make it clear that ipfw action set for layer2 frames is a bit limited.

PR: 59835
Reviewed by: yuripv
Differential Revision: https://reviews.freebsd.org/D17719

5 years agoMFC r340325
vmaffione [Tue, 4 Dec 2018 07:30:02 +0000 (07:30 +0000)]
MFC r340325

netmap: pkt-gen: several updates from upstream

Various improvements to the netmap pkt-gen program:

 - indentation fixes
 - support for IPV6
 - fixes to checksum computation
 - support for NS_MOREFRAG
 - rate limiting in ping mode

Reviewed by:    bcr, 0mp
Approved by:    gnn (mentor)
Differential Revision:  https://reviews.freebsd.org/D17698

5 years agoDocument SA-18:13, EN-18:13, EN-18:14, EN-18:15.
gjb [Mon, 3 Dec 2018 19:02:14 +0000 (19:02 +0000)]
Document SA-18:13, EN-18:13, EN-18:14, EN-18:15.

Sponsored by: The FreeBSD Foundation

5 years agoMFC r340279
vmaffione [Mon, 3 Dec 2018 17:51:22 +0000 (17:51 +0000)]
MFC r340279

netmap: add load balancer program

Add the lb program, which is able to load-balance input traffic
received from a netmap port over M groups, with N netmap pipes in
each group. Each received packet is forwarded to one of the pipes
chosen from each group (using an L3/L4 connection-consistent hash function).
This also adds a man page for lb and some cross-references in related
man pages.

Reviewed by:    bcr, 0mp
Approved by:    gnn (mentor)
Differential Revision:  https://reviews.freebsd.org/D17735

5 years agoMFC r339685
vmaffione [Mon, 3 Dec 2018 17:46:53 +0000 (17:46 +0000)]
MFC r339685

netmap: add man page for the vale-ctl program

Added man page for vale-ctl program.
Small fixes to vale-ctl, including the support for -m option
(to specify the netmap memory allocator id).

Reviewed by:    0mp
Approved by:    gnn (mentor)
Differential Revision:  https://reviews.freebsd.org/D17683

5 years agoMFC r339659
vmaffione [Mon, 3 Dec 2018 17:40:54 +0000 (17:40 +0000)]
MFC r339659

netmap: add man page for the bridge program

Added bridge(8).
Also, minor fixes to the netmap "bridge" application:
 - indentation fixes and code cleanup
 - better usage description
 - better processing of netmap flags

Reviewed by:    0mp
Approved by:    gnn (mentor)
Differential Revision:  https://reviews.freebsd.org/D17664

5 years agoMFC r340095: Remove apparently unused 0-byte files that cause grief on Windows
emaste [Mon, 3 Dec 2018 02:33:53 +0000 (02:33 +0000)]
MFC r340095: Remove apparently unused 0-byte files that cause grief on Windows

r235274 added a sort regression test (it operates by comparing output
against GNU sort).  The commit included a number of 0-byte files, one
of which ends in a trailing . which reportedly breaks svn/git checkouts
on Windows.

It appears these were added accidentally, so just remove them.

PR: 232479

5 years agoMFC r341247:
markj [Sun, 2 Dec 2018 18:08:27 +0000 (18:08 +0000)]
MFC r341247:
Update the free page count when blacklisting pages.

PR: 231296

5 years agoMFC r340922:
kib [Sun, 2 Dec 2018 12:51:49 +0000 (12:51 +0000)]
MFC r340922:
Avoid unneeded check in vmspace_alloc().

5 years agoMFC r338317:
mmel [Sun, 2 Dec 2018 07:45:22 +0000 (07:45 +0000)]
MFC r338317:

  Fix wrong offset calculation for R_ARM_TLS_TPOFF32 relocations.  TLS_TCB_SIZE
  is already accounted in defobj-> tlsoffset so all these symbols were
  incorrectly relocated by +8.

5 years agoMFC r340867:
cy [Sat, 1 Dec 2018 18:23:41 +0000 (18:23 +0000)]
MFC r340867:

FreeBSD 7 has been history for many moons. Remove some dead code.

5 years agoMFC r340868:
cy [Sat, 1 Dec 2018 18:17:51 +0000 (18:17 +0000)]
MFC r340868:

An OSF/1 ifdef makes absolutley no sense in a FreeBSD specific source
file.

5 years agoMFC r340909:
cy [Sat, 1 Dec 2018 18:09:17 +0000 (18:09 +0000)]
MFC r340909:

Combine two lines into one following unifdef for r255332.

5 years agoMFC r339548
vmaffione [Sat, 1 Dec 2018 12:08:16 +0000 (12:08 +0000)]
MFC r339548

man: fix vale(4) port naming

The current documentation describing the syntax of a VALE port is wrong.
This patch fixes it to make it consistent.

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

5 years agoMFC r339502
oshogbo [Fri, 30 Nov 2018 19:58:55 +0000 (19:58 +0000)]
MFC r339502
  Add link to the setproctitle_fast function.

5 years agoMFC r340765
arybchik [Fri, 30 Nov 2018 09:58:11 +0000 (09:58 +0000)]
MFC r340765

sfxge(4): cleanup: move into right place

Due to incorrect merge the piece of code was put in incorrect
place and diverge from libefx in other locations.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18024

5 years agoThis is a direct commit to the stable/11 branch. This would have been
cy [Fri, 30 Nov 2018 06:45:53 +0000 (06:45 +0000)]
This is a direct commit to the stable/11 branch. This would have been
MFC r340754 except that etc/rc.d has been moved in HEAD which would
have resulted in a tree conflict if merged.

Allow forced start of ipmon in special cases where testing is desired
(or other special cases) and when ipfilter is disabled in rc.conf but
started by other means.

5 years agoMFC r337812,r337814,r337820,r341068:
dab [Fri, 30 Nov 2018 02:06:30 +0000 (02:06 +0000)]
MFC r337812,r337814,r337820,r341068:

Fix several memory leaks (r337812 & r337814).

The libkqueue tests have several places that leak memory by using an
idiom like:

  puts(kevent_to_str(kevp));

Rework to save the pointer returned from kevent_to_str() and then
free() it after it has been used.

r337812 also fixed a bug in the netmap kevent code. The inclusion of
that fix was an oversight that I didn't notice until this
MFC. Reference the code review and PR here in the MFC for
completeness.

r337820 & r341068 were white-space only changes as a follow-up to
r337812 & r337814:

After r337820, which "corrected" some spaces-instead-of-tab whitespace
issues in the libkqueue tests, jmg@ pointed out that these files were
originally space-based, not tab-spaced, and so the correction should
have been to get rid of the tabs that had been introduced in previous
changes, not the spaces. This change does that. This is a whitespace
only change; no functional change is intended.

PR:  206053
Differential Revision:    https://reviews.freebsd.org/D16531
Sponsored by: Dell EMC Isilon

5 years agoMFC r340483 (by jtl):
markj [Thu, 29 Nov 2018 20:38:23 +0000 (20:38 +0000)]
MFC r340483 (by jtl):
Add some additional length checks to the IPv4 fragmentation code.

5 years agoMFC r340968:
markj [Thu, 29 Nov 2018 15:56:46 +0000 (15:56 +0000)]
MFC r340968:
Plug routing sysctl leaks.

5 years agoMFC r340976:
yuripv [Thu, 29 Nov 2018 15:07:59 +0000 (15:07 +0000)]
MFC r340976:
vi: fix UTF-8 detection.

PR: 202290
Submitted by: lampa@fit.vutbr.cz
Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D17950

5 years agoMFC r340978-340979: ipfw.8: new section to EXAMPLES: SELECTIVE MIRRORING
eugen [Thu, 29 Nov 2018 01:28:13 +0000 (01:28 +0000)]
MFC r340978-340979: ipfw.8: new section to EXAMPLES: SELECTIVE MIRRORING

5 years agoMFC r340442
sef [Thu, 29 Nov 2018 01:05:21 +0000 (01:05 +0000)]
MFC r340442

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
Sponsored by: iXsystems Inc

5 years agoMFC r340983:
gjb [Thu, 29 Nov 2018 00:28:08 +0000 (00:28 +0000)]
MFC r340983:
 Fix NTP query on GCE due to unresolved hostname.

PR: 232456
Submitted by: Lucas Kanashiro
Sponsored by: The FreeBSD Foundation

5 years agoMFC r340995
vangyzen [Wed, 28 Nov 2018 21:20:51 +0000 (21:20 +0000)]
MFC r340995

Prevent kernel stack disclosure in signal delivery

On arm64 and riscv platforms, sendsig() failed to zero the signal
frame before copying it out to userspace.  Zero it.

On arm, I believe all the contents of the frame were initialized,
so there was no disclosure.  However, explicitly zero the whole frame
because that fact could inadvertently change in the future,
it's more clear to the reader, and I could be wrong in the first place.

Security: similar to FreeBSD-EN-18:12.mem and CVE-2018-17155
Sponsored by: Dell EMC Isilon

5 years agoMFC r340994
vangyzen [Wed, 28 Nov 2018 21:19:58 +0000 (21:19 +0000)]
MFC r340994

Prevent kernel stack disclosure in getcontext/swapcontext

Expand r338982 to cover freebsd32 interfaces on amd64, mips, and powerpc.

Security: FreeBSD-EN-18:12.mem
Security: CVE-2018-17155
Sponsored by: Dell EMC Isilon

5 years agoMFC r340730, r340731:
markj [Wed, 28 Nov 2018 17:00:18 +0000 (17:00 +0000)]
MFC r340730, r340731:
Add taskqueue_quiesce(9) and use it to implement taskq_wait().

PR: 227784

5 years agoMFC r340409
vangyzen [Tue, 27 Nov 2018 22:33:58 +0000 (22:33 +0000)]
MFC r340409

Make no assertions about lock state when the scheduler is stopped.

Change the assert paths in rm, rw, and sx locks to match the lock
and unlock paths.  I did this for mutexes in r306346.

Reported by: Travis Lane <tlane@isilon.com>
Sponsored by: Dell EMC Isilon

5 years agoMFC r340257
vangyzen [Tue, 27 Nov 2018 19:40:18 +0000 (19:40 +0000)]
MFC r340257

in6_ifattach_linklocal: handle immediate removal of the new LLA

If another thread immediately removes the link-local address
added by in6_update_ifa(), in6ifa_ifpforlinklocal() can return NULL,
so the following assertion (or dereference) is wrong.
Remove the assertion, and handle NULL somewhat better than panicking.
This matches all of the other callers of in6_update_ifa().

PR: 219250
Reviewed by: bz, dab (both an earlier version)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D17898

5 years agoMFC r340898:
markj [Tue, 27 Nov 2018 17:10:00 +0000 (17:10 +0000)]
MFC r340898:
Ensure that knotes do not get registered when KQ_CLOSING is set.

PR: 228858

5 years agoMFC r340897:
markj [Tue, 27 Nov 2018 16:59:12 +0000 (16:59 +0000)]
MFC r340897:
Lock the knlist before releasing the in-flux state in knote_fork().

PR: 228858

5 years agoMFC r340899:
markj [Tue, 27 Nov 2018 16:55:24 +0000 (16:55 +0000)]
MFC r340899:
Plug some kernel memory disclosures via kevent(2).

5 years agoMFC r340856:
markj [Tue, 27 Nov 2018 16:51:18 +0000 (16:51 +0000)]
MFC r340856:
Ensure that directory entry padding bytes are zeroed.

5 years agoMFC r340689:
ae [Tue, 27 Nov 2018 14:03:40 +0000 (14:03 +0000)]
MFC r340689:
  Make multiline APPLY_MASK() macro to be function-like.

  Reported by: cem

5 years agoMFC r340675:
kib [Tue, 27 Nov 2018 13:14:13 +0000 (13:14 +0000)]
MFC r340675:
rtld: when immediate bind mode is requested, process irelocs in PLT
immediately after other PLT relocs.

5 years agoMFC r338628: xen: limit the usage of PIRQs to a legacy PVH Dom0
royger [Mon, 26 Nov 2018 16:54:16 +0000 (16:54 +0000)]
MFC r338628: xen: limit the usage of PIRQs to a legacy PVH Dom0

Sponsored by: Citrix Systems R&D

5 years agoMFC r339818: rcorder(8):
eugen [Mon, 26 Nov 2018 13:30:00 +0000 (13:30 +0000)]
MFC r339818: 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.

PR: 227866
Differential Revision: https://reviews.freebsd.org/D15247

5 years agoMFC r339817: makewhatis: do not try to operate on read-only mounted
eugen [Mon, 26 Nov 2018 13:03:34 +0000 (13:03 +0000)]
MFC r339817: makewhatis: do not try to operate on read-only mounted
directories just to fail later.

5 years agoMFC r339808: Prevent ip_input() from panicing due to unprotected access
eugen [Mon, 26 Nov 2018 12:41:49 +0000 (12:41 +0000)]
MFC r339808: Prevent ip_input() from panicing due to unprotected access
to INADDR_HASH.

PR: 220078
Differential Revision: https://reviews.freebsd.org/D12457
Tested-by: Cassiano Peixoto and others

5 years agoMFC r339810: ipfw: implement ngtee/netgraph actions for layer-2 frames.
eugen [Mon, 26 Nov 2018 11:32:22 +0000 (11:32 +0000)]
MFC r339810: ipfw: implement ngtee/netgraph actions for layer-2 frames.

  Kernel part of ipfw does not support and ignores rules other than
  "pass", "deny" and dummynet-related for layer-2 (ethernet frames).
  Others are processed as "pass".

  Make it support ngtee/netgraph rules just like they are supported
  for IP packets. For example, this allows us to mirror some frames
  selectively to another interface for delivery to remote network analyzer
  over RSPAN vlan. Assuming ng_ipfw(4) netgraph node has a hook named "900"
  attached to "lower" hook of vlan900's ng_ether(4) node, that would be
  as simple as:

  ipfw add ngtee 900 ip from any to 8.8.8.8 layer2 out xmit igb0

PR: 213452
Tested-by: Fyodor Ustinov <ufm@ufm.su>

5 years agoMFC r339816: mount_msdosfs
eugen [Mon, 26 Nov 2018 11:22:04 +0000 (11:22 +0000)]
MFC r339816: mount_msdosfs

  mount_msdosfs: do not fail mounts requiring locale name conversion table
  that is already present in a kernel statically.

  For example, the command "mount_msdosfs -L ru_RU.KOI8-R" fails with error
  "mount_msdosfs: msdosfs_iconv: File exists" for a kernel having
  options LIBICONV and MSDOSFS_ICONV. After this change, it mounts
  successfully.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D16951

5 years agoMFC r339806: Prevent stf(4) from panicing due to unprotected access
eugen [Mon, 26 Nov 2018 11:17:12 +0000 (11:17 +0000)]
MFC r339806: Prevent stf(4) from panicing due to unprotected access
to INADDR_HASH.

PR: 220078
Differential Revision: https://reviews.freebsd.org/D12457
Tested-by: Cassiano Peixoto and others

5 years agoMFC r340622:
hselasky [Mon, 26 Nov 2018 11:14:06 +0000 (11:14 +0000)]
MFC r340622:
Minor code factoring. No functional change.

Sponsored by: Mellanox Technologies

5 years agoMFC r340621:
hselasky [Mon, 26 Nov 2018 11:11:53 +0000 (11:11 +0000)]
MFC r340621:
Be more verbose when a sysctl fails to unregister.
Print name of sysctl in question.

Sponsored by: Mellanox Technologies

5 years agoMFC r340480:
hselasky [Mon, 26 Nov 2018 11:09:51 +0000 (11:09 +0000)]
MFC r340480:
Define asm macro in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies

5 years agoMFC r339811: route(8): correctly return exit status when "-q" flag
eugen [Mon, 26 Nov 2018 11:08:38 +0000 (11:08 +0000)]
MFC r339811: route(8): correctly return exit status when "-q" flag
is used.

  Previously, route returned 1 in case of error properly signalling
  failure but "route -q" returned 0 in the same case. Fix it.

PR: 186333

5 years agoMFC r340479:
hselasky [Mon, 26 Nov 2018 11:07:43 +0000 (11:07 +0000)]
MFC r340479:
Implement ktime_get_ts64() function macro in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies

5 years agoMFC r340842:
kib [Mon, 26 Nov 2018 10:53:17 +0000 (10:53 +0000)]
MFC r340842:
Silence gcc warnings.

5 years agoMFC r339807: Prevent multicast code from panicing due to unprotected access
eugen [Mon, 26 Nov 2018 10:50:50 +0000 (10:50 +0000)]
MFC r339807: Prevent multicast code from panicing due to unprotected access
to INADDR_HASH.

PR: 220078
Differential Revision: https://reviews.freebsd.org/D12457
Tested-by: Cassiano Peixoto and others

5 years agoMFC r340783:
markj [Sun, 25 Nov 2018 18:00:50 +0000 (18:00 +0000)]
MFC r340783:
Plug some networking sysctl leaks.

5 years agoMFC r340772:
markj [Sun, 25 Nov 2018 17:44:30 +0000 (17:44 +0000)]
MFC r340772:
Clear unused bytes in ia32_osendsig().

5 years agoMFC r340771: proto: change device permissions to 0600
emaste [Sun, 25 Nov 2018 00:34:00 +0000 (00:34 +0000)]
MFC r340771: proto: change device permissions to 0600

C Turt reports that the driver is not thread safe and may have
exploitable races.

Note that the proto device is intended for prototyping and development,
and is not for use on production systems.  From the man page:

SECURITY CONSIDERATIONS
     Because programs have direct access to the hardware, the proto
     driver is inherently insecure.  It is not advisable to use this
     driver on a production machine.

The proto device is not included in any of FreeBSD's kernel config files
(although the module is built).

The issues in the proto device still need to be fixed, and the device is
inherently (and intentionally) insecure, but it might as well be limited
to root only.

admbugs: 782
Reported by: C Turt <ecturt@gmail.com>
Sponsored by: The FreeBSD Foundation

5 years agoMFC r340734:
markj [Sat, 24 Nov 2018 17:11:47 +0000 (17:11 +0000)]
MFC r340734:
Avoid unsynchronized updates to kn_status.

5 years agoMFC r340663 (rmacklem):
emaste [Fri, 23 Nov 2018 20:41:54 +0000 (20:41 +0000)]
MFC r340663 (rmacklem):

Improve sanity checking for the dircount hint argument to
NFSv3's ReaddirPlus and NFSv4's Readdir operations. The code
checked for a zero argument, but did not check for a very large value.
This patch clips dircount at the server's maximum data size.

5 years agoMFC r340662 (rmacklem):
emaste [Fri, 23 Nov 2018 20:39:37 +0000 (20:39 +0000)]
MFC r340662 (rmacklem):

nfsm_advance() would panic() when the offs argument was negative.
The code assumed that this would indicate a corrupted mbuf chain, but
it could simply be caused by bogus RPC message data.
This patch replaces the panic() with a printf() plus error return.

5 years agoMFC r340661 (rmacklem):
emaste [Fri, 23 Nov 2018 20:38:50 +0000 (20:38 +0000)]
MFC r340661 (rmacklem):

r304026 added code that started statistics gathering for an operation
before the operation number (the variable called "op") was sanity checked.
This patch moves the code down to below the range sanity check for "op".

5 years agoMFC r340699:
markj [Fri, 23 Nov 2018 00:59:42 +0000 (00:59 +0000)]
MFC r340699:
Clear pad bytes in the struct exported by kern.ntp_pll.gettime.

5 years agoMFC r340264:
kp [Thu, 22 Nov 2018 19:59:04 +0000 (19:59 +0000)]
MFC r340264:

pfctl: Populate ifname in ifa_lookup()

pfctl_adjust_skip_ifaces() relies on this name.

5 years agoMFC r340265:
kp [Thu, 22 Nov 2018 19:56:51 +0000 (19:56 +0000)]
MFC r340265:

pf: Prevent tables referenced by rules in anchors from getting disabled.

PR: 183198
Obtained from: OpenBSD

5 years agoMFC: r339007, r340543, r340654
marius [Thu, 22 Nov 2018 13:14:15 +0000 (13:14 +0000)]
MFC: r339007, r340543, r340654

- Add ACPI identifier for AMD eMMC 5.0 controller [1]
- Add a quirk handling for AMDI0040 controllers allowing them to do HS400. [2]

Submitted by: Rajesh Kumar [1], Shreyank Amartya (original version) [2]