Commit Graph

286125 Commits

Author SHA1 Message Date
rillig
1a656e3597 tests/indent: add templates for options tests
Given that indent "has even more switches than ls(1)", there are far too
few tests.  To make it easier to add meaningful tests for each of the
options, add the templates for the tests right now, ready to be filled
in.
2021-03-06 17:56:33 +00:00
rillig
51d591549d tests/indent: extend test for '//' comments with more examples 2021-03-06 15:02:38 +00:00
rin
f111f7ed2a Fix trivial typo. No need to bump date. 2021-03-06 14:44:02 +00:00
martin
45141001ea Minimal (but hackish) change to make a DEBUG kernel compilable. 2021-03-06 13:32:56 +00:00
skrll
c901baed96 Improve fdt_isprint so that it returns false if there are consecutive
zeroes.
2021-03-06 13:21:26 +00:00
rin
b3185c1480 For ibm4xx and booke, restore saved PSL_EE bit as done for oea,
instead of forcibly enabling interrupts.
2021-03-06 08:34:58 +00:00
rin
521ca5bfd2 Convert to KASSERTMSG(9) to display wrong IPL. 2021-03-06 08:32:17 +00:00
rin
e07e56d969 Reorder things in cpu_startup() for clarity.
No functional changes intended.
2021-03-06 08:29:19 +00:00
rin
fe285e409f For booke and ibm4xx, switch to software-based single-stepping for PT_STEP
ptrace(2) command from broken hardware-based implementation.

As described in proposal on port-powerpc@,

http://mail-index.netbsd.org/port-powerpc/2021/02/26/msg003597.html

hardware debug facilities of booke and 4xx use critical interrupts, that
are difficult to handle for this purpose; they are not automatically masked
when entering kernel mode via system call trap or hardware interrupt.
See my proposal above for more details.

Now, hardware debug facilities are exclusively usable by kernel itself.
They are much more functional than PSL_SE MSR bit of oea, and should be
useful to, e.g., support byte-granular watchpoint for DDB in the future.
2021-03-06 08:08:19 +00:00
rin
0d87477cff Change pic_name from "openpic" to "u3_ht" so that it can be
distinguishable with generic OpenPIC driver.
2021-03-06 07:29:05 +00:00
rin
9cace71ae4 Include PIC name to interrupt source, instead of just "irq", so that
it appears in "interrupt id" field of intrctl(8).

Should be useful when multiple PICs are simultaneously available as in
405EX (where uic[12] are cascaded to uic0).
2021-03-06 07:24:24 +00:00
tsutsui
51975443b7 Fix a possible race condition in spc_msgin() in NO_MANUAL_XFER case.
To avoid the race, check SSTS and INTS after XFR command as
spc_pio_datain() does.

Reported from isaki@, observed on nono emulator.
2021-03-06 05:37:18 +00:00
gdt
f760bcae1f XEN3_DOM0: Approach GENERIC
When processed to remove comments, blank lines, normalize whitespace,
and sort/uniq (one line was previously duplicated), this file is
identical to the previous version.  It has been reorganized to reduce
diffs to GENERIC, and many missing lines from GENERIC have been added
but commented out.
2021-03-05 20:30:56 +00:00
gdt
591ee810aa GENERIC: comment typo fix (spacing) 2021-03-05 20:18:39 +00:00
thorpej
5015c904c9 Separate probing for the console device and initializing it, so that
ofwoea_initppc() can have more control over which of those steps are
performed during initialization.  Probing happens before setting up
the exception vectors, initializing happens after.
2021-03-05 18:10:06 +00:00
christos
d0f77c4d4c bump libssh 2021-03-05 18:08:21 +00:00
christos
2bf912e9c7 new OpenSSH 2021-03-05 18:04:18 +00:00
christos
49d88ddd38 remove __UNCONST, initialize 2021-03-05 17:53:51 +00:00
christos
17418e98f2 merge local changes between openssh 8.4 and 8.5 2021-03-05 17:47:15 +00:00
christos
cffc2a7aa4 OpenSSH 8.5/8.5p1 (2021-03-03)
OpenSSH 8.5 was released on 2021-03-03. It is available from the
mirrors listed at https://www.openssh.com/.
OpenSSH is a 100% complete SSH protocol 2.0 implementation and
includes sftp client and server support.

Once again, we would like to thank the OpenSSH community for their
continued support of the project, especially those who contributed
code or patches, reported bugs, tested snapshots or donated to the
project. More information on donations may be found at:
https://www.openssh.com/donations.html

Future deprecation notice
=========================

It is now possible[1] to perform chosen-prefix attacks against the
SHA-1 algorithm for less than USD$50K.

In the SSH protocol, the "ssh-rsa" signature scheme uses the SHA-1
hash algorithm in conjunction with the RSA public key algorithm.
OpenSSH will disable this signature scheme by default in the near
future.

Note that the deactivation of "ssh-rsa" signatures does not necessarily
require cessation of use for RSA keys. In the SSH protocol, keys may be
capable of signing using multiple algorithms. In particular, "ssh-rsa"
keys are capable of signing using "rsa-sha2-256" (RSA/SHA256),
"rsa-sha2-512" (RSA/SHA512) and "ssh-rsa" (RSA/SHA1). Only the last of
these is being turned off by default.

This algorithm is unfortunately still used widely despite the
existence of better alternatives, being the only remaining public key
signature algorithm specified by the original SSH RFCs that is still
enabled by default.

The better alternatives include:

 * The RFC8332 RSA SHA-2 signature algorithms rsa-sha2-256/512. These
   algorithms have the advantage of using the same key type as
   "ssh-rsa" but use the safe SHA-2 hash algorithms. These have been
   supported since OpenSSH 7.2 and are already used by default if the
   client and server support them.

 * The RFC8709 ssh-ed25519 signature algorithm. It has been supported
   in OpenSSH since release 6.5.

 * The RFC5656 ECDSA algorithms: ecdsa-sha2-nistp256/384/521. These
   have been supported by OpenSSH since release 5.7.

To check whether a server is using the weak ssh-rsa public key
algorithm, for host authentication, try to connect to it after
removing the ssh-rsa algorithm from ssh(1)'s allowed list:

    ssh -oHostKeyAlgorithms=-ssh-rsa user@host

If the host key verification fails and no other supported host key
types are available, the server software on that host should be
upgraded.

This release enables the UpdateHostKeys option by default to assist
the client by automatically migrating to better algorithms.

[1] "SHA-1 is a Shambles: First Chosen-Prefix Collision on SHA-1 and
    Application to the PGP Web of Trust" Leurent, G and Peyrin, T
    (2020) https://eprint.iacr.org/2020/014.pdf

Security
========

 * ssh-agent(1): fixed a double-free memory corruption that was
   introduced in OpenSSH 8.2 . We treat all such memory faults as
   potentially exploitable. This bug could be reached by an attacker
   with access to the agent socket.

   On modern operating systems where the OS can provide information
   about the user identity connected to a socket, OpenSSH ssh-agent
   and sshd limit agent socket access only to the originating user
   and root. Additional mitigation may be afforded by the system's
   malloc(3)/free(3) implementation, if it detects double-free
   conditions.

   The most likely scenario for exploitation is a user forwarding an
   agent either to an account shared with a malicious user or to a
   host with an attacker holding root access.

 * Portable sshd(8): Prevent excessively long username going to PAM.
   This is a mitigation for a buffer overflow in Solaris' PAM username
   handling (CVE-2020-14871), and is only enabled for Sun-derived PAM
   implementations.  This is not a problem in sshd itself, it only
   prevents sshd from being used as a vector to attack Solaris' PAM.
   It does not prevent the bug in PAM from being exploited via some
   other PAM application. GHPR212


Potentially-incompatible changes
================================

This release includes a number of changes that may affect existing
configurations:

 * ssh(1), sshd(8): this release changes the first-preference signature
   algorithm from ECDSA to ED25519.

 * ssh(1), sshd(8): set the TOS/DSCP specified in the configuration
   for interactive use prior to TCP connect. The connection phase of
   the SSH session is time-sensitive and often explicitly interactive.
   The ultimate interactive/bulk TOS/DSCP will be set after
   authentication completes.

 * ssh(1), sshd(8): remove the pre-standardization cipher
   rijndael-cbc@lysator.liu.se. It is an alias for aes256-cbc before
   it was standardized in RFC4253 (2006), has been deprecated and
   disabled by default since OpenSSH 7.2 (2016) and was only briefly
   documented in ssh.1 in 2001.

 * ssh(1), sshd(8): update/replace the experimental post-quantum
   hybrid key exchange method based on Streamlined NTRU Prime coupled
   with X25519.

   The previous sntrup4591761x25519-sha512@tinyssh.org method is
   replaced with sntrup761x25519-sha512@openssh.com. Per its
   designers, the sntrup4591761 algorithm was superseded almost two
   years ago by sntrup761.

   (note this both the updated method and the one that it replaced are
   disabled by default)

 * ssh(1): disable CheckHostIP by default. It provides insignificant
   benefits while making key rotation significantly more difficult,
   especially for hosts behind IP-based load-balancers.

Changes since OpenSSH 8.4
=========================

New features
------------

 * ssh(1): this release enables UpdateHostkeys by default subject to
   some conservative preconditions:
    - The key was matched in the UserKnownHostsFile (and not in the
      GlobalKnownHostsFile).
    - The same key does not exist under another name.
    - A certificate host key is not in use.
    - known_hosts contains no matching wildcard hostname pattern.
    - VerifyHostKeyDNS is not enabled.
    - The default UserKnownHostsFile is in use.

   We expect some of these conditions will be modified or relaxed in
   future.

 * ssh(1), sshd(8): add a new LogVerbose configuration directive for
   that allows forcing maximum debug logging by file/function/line
   pattern-lists.

 * ssh(1): when prompting the user to accept a new hostkey, display
   any other host names/addresses already associated with the key.

 * ssh(1): allow UserKnownHostsFile=none to indicate that no
   known_hosts file should be used to identify host keys.

 * ssh(1): add a ssh_config KnownHostsCommand option that allows the
   client to obtain known_hosts data from a command in addition to
   the usual files.

 * ssh(1): add a ssh_config PermitRemoteOpen option that allows the
   client to restrict the destination when RemoteForward is used
   with SOCKS.

 * ssh(1): for FIDO keys, if a signature operation fails with a
   "incorrect PIN" reason and no PIN was initially requested from the
   user, then request a PIN and retry the operation. This supports
   some biometric devices that fall back to requiring PIN when reading
   of the biometric failed, and devices that require PINs for all
   hosted credentials.

 * sshd(8): implement client address-based rate-limiting via new
   sshd_config(5) PerSourceMaxStartups and PerSourceNetBlockSize
   directives that provide more fine-grained control on a per-origin
   address basis than the global MaxStartups limit.

Bugfixes
--------

 * ssh(1): Prefix keyboard interactive prompts with "(user@host)" to
   make it easier to determine which connection they are associated
   with in cases like scp -3, ProxyJump, etc. bz#3224

 * sshd(8): fix sshd_config SetEnv directives located inside Match
   blocks. GHPR201

 * ssh(1): when requesting a FIDO token touch on stderr, inform the
   user once the touch has been recorded.

 * ssh(1): prevent integer overflow when ridiculously large
   ConnectTimeout values are specified, capping the effective value
   (for most platforms) at 24 days. bz#3229

 * ssh(1): consider the ECDSA key subtype when ordering host key
   algorithms in the client.

 * ssh(1), sshd(8): rename the PubkeyAcceptedKeyTypes keyword to
   PubkeyAcceptedAlgorithms. The previous name incorrectly suggested
   that it control allowed key algorithms, when this option actually
   specifies the signature algorithms that are accepted. The previous
   name remains available as an alias. bz#3253

 * ssh(1), sshd(8): similarly, rename HostbasedKeyTypes (ssh) and
   HostbasedAcceptedKeyTypes (sshd) to HostbasedAcceptedAlgorithms.

 * sftp-server(8): add missing lsetstat@openssh.com documentation
   and advertisement in the server's SSH2_FXP_VERSION hello packet.

 * ssh(1), sshd(8): more strictly enforce KEX state-machine by
   banning packet types once they are received. Fixes memleak caused
   by duplicate SSH2_MSG_KEX_DH_GEX_REQUEST (oss-fuzz #30078).

 * sftp(1): allow the full range of UIDs/GIDs for chown/chgrp on 32bit
   platforms instead of being limited by LONG_MAX. bz#3206

 * Minor man page fixes (capitalization, commas, etc.) bz#3223

 * sftp(1): when doing an sftp recursive upload or download of a
   read-only directory, ensure that the directory is created with
   write and execute permissions in the interim so that the transfer
   can actually complete, then set the directory permission as the
   final step. bz#3222

 * ssh-keygen(1): document the -Z, check the validity of its argument
   earlier and provide a better error message if it's not correct.
   bz#2879

 * ssh(1): ignore comments at the end of config lines in ssh_config,
   similar to what we already do for sshd_config. bz#2320

 * sshd_config(5): mention that DisableForwarding is valid in a
   sshd_config Match block. bz3239

 * sftp(1): fix incorrect sorting of "ls -ltr" under some
   circumstances. bz3248.

 * ssh(1), sshd(8): fix potential integer truncation of (unlikely)
   timeout values. bz#3250

 * ssh(1): make hostbased authentication send the signature algorithm
   in its SSH2_MSG_USERAUTH_REQUEST packets instead of the key type.
   This make HostbasedAcceptedAlgorithms do what it is supposed to -
   filter on signature algorithm and not key type.

Portability
-----------

 * sshd(8): add a number of platform-specific syscalls to the Linux
   seccomp-bpf sandbox. bz#3232 bz#3260

 * sshd(8): remove debug message from sigchld handler that could cause
   deadlock on some platforms. bz#3259

 * Sync contrib/ssh-copy-id with upstream.

 * unittests: add a hostname function for systems that don't have it.
   Some systems don't have a hostname command (it's not required by
   POSIX). The do have uname -n (which is), but not all of those have
   it report the FQDN.

Checksums:
==========

 - SHA1 (openssh-8.5.tar.gz) = 04cae43c389fb411227c01219e4eb46e3113f34e
 - SHA256 (openssh-8.5.tar.gz) = 5qB2CgzNG4io4DmChTjHgCWqRWvEOvCKJskLdJCz+SU=

 - SHA1 (openssh-8.5p1.tar.gz) = 72eadcbe313b07b1dd3b693e41d3cd56d354e24e
 - SHA256 (openssh-8.5p1.tar.gz) = 9S8/QdQpqpkY44zyAK8iXM3Y5m8FLaVyhwyJc3ZG7CU=

Please note that the SHA256 signatures are base64 encoded and not
hexadecimal (which is the default for most checksum tools). The PGP
key used to sign the releases is available from the mirror sites:
https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/RELEASE_KEY.asc

Please note that the OpenPGP key used to sign releases has been
rotated for this release. The new key has been signed by the previous
key to provide continuity.

Reporting Bugs:
===============

- Please read https://www.openssh.com/report.html
  Security bugs should be reported directly to openssh@openssh.com
2021-03-05 17:45:25 +00:00
rillig
b5348831df lint: warn about enum/enum or enum/int type mismatch in switch
This is something that neither GCC 10 nor Clang 8 do, even though it
seems useful.  Lint didn't do it up to now, but that was probably an
oversight since it is easy to miss the implicit '==' operator in the
switch statement.
2021-03-05 17:10:05 +00:00
rillig
4e936ad287 tests/lint: mark tests for messages 130 and 241 as related 2021-03-05 16:35:52 +00:00
rillig
4c8d48e6d4 tests/lint: add test for incompatible enums in switch
Neither lint nor GCC 10 nor Clang 8 have a warning for an enum type
mismatch in a switch statement.

GCC 10 issues a warning but completely misses the point of the
mismatched enum types.  It only warns because in this test, EVENING has
the numeric value 3, which is out of bounds for enum color, where the
valid range is from 0 to 2.  It says:

> msg_130.c:45:2: warning:
>     case value ‘3’ not in enumerated type ‘enum color’ [-Wswitch]

Clang 8 behaves almost the same, it just doesn't mention the value of
the constant, saying merely 'case value not in enumerated type'.
2021-03-05 16:31:49 +00:00
yamaguchi
bc53f6e7aa Fix missing IFM_FDX 2021-03-05 13:21:07 +00:00
rin
cfe2093dad Convert to intr_establish_xname(). 2021-03-05 07:15:53 +00:00
rin
0e408d4633 Show PVR as 8-digit hex. 2021-03-05 07:11:24 +00:00
rin
2ccbbad864 Add 403 family processors other than 403GCX. 2021-03-05 07:10:27 +00:00
rin
3252eee2b5 Identify oneself as ``Explora 450'' instead of 451.
There are models numbered 450 to 454. The differences b/w them are
shapes of ethernet and audio connectors. Base model number 450 is
displayed for (probably) all models by firmware.
2021-03-05 07:06:15 +00:00
rin
9e4c9ab265 Add tmpfs. 2021-03-05 06:57:02 +00:00
rin
ea7bebf1dc Fix color map.
Almost all colors except *green* were wrong for the apparent reason ;).
2021-03-05 06:50:57 +00:00
rin
2453dc764f Configure fb(4) appropriately also when it is not console.
Now, wsdisplay(4) can be used with serial console.
2021-03-05 06:48:20 +00:00
rin
6b8a49cada Bump INTSTK to 16KB, i.e., one VM page, in the same manner as other boards. 2021-03-05 06:45:12 +00:00
rin
8db1b17786 Map framebuffer to virtual space when fb(4) is present,
even if it is not console.
2021-03-05 06:40:15 +00:00
rin
0cec5ffe6c Call bus_space_mallocok() appropriately. 2021-03-05 06:30:45 +00:00
rin
ffbe1066a9 For very MD codes for Explora, reorder things, and use more common codes for
ibm4xx and ibm40x for clarity as well as better comparison with other boards.

No functional changes intended.
2021-03-05 06:26:56 +00:00
rin
1d2f4258e8 Avoid doubly bus_space_map(9) when pckbc(4) is already attached as console. 2021-03-05 06:17:02 +00:00
rin
6b841f2c45 pckbcintr() must be running with IPL_TTY, not IPL_SERIAL. Otherwise,
tty(4) routines are unexpectedly interrupted, which results in
"locking against myself" errors for tty_lock.
2021-03-05 06:14:47 +00:00
rin
12c9d0e154 For Explora 451, call calc_delayconst() before pckbc_cnattach(), which
depends on delay() and DELAY().

Unfortunately, proplib(9) API is not available for MD codes, that are
called before consinit() (since pool(9) is not initialized yet).

Therefore, hard-code CPU frequency to calc_delayconst() in case
"processor-frequency" is not initialized.
2021-03-05 06:06:34 +00:00
rin
0a6c5be26c Fix hard freeze in pic_handle_intr() for PPC_IBM403.
Not clearly documented in reference manual, but DCR_EXISR register is
not updated immediately after some bits are cleared by mtdcr, no matter
whether sync (= eieio) and/or isync are issued.

Therefore, we have to manage our own status mask in the interrupt handler.
This is what we did in obsoleted powerpc/ibm4xx/intr.c.

With this change, my Explora 451 works just fine with serial console!
Fix for framebuffer console will be committed soon.
2021-03-05 05:35:50 +00:00
thorpej
dfe157ae0d Split set_timebase() into get_timebase_frequency() and init_decrementer().
Call get_timebase_frequency() much earlier.
2021-03-05 02:58:13 +00:00
thorpej
2cd91599fd Move ofppc-specific CPU spinup code to ofppc/machdep.c 2021-03-05 01:33:33 +00:00
thorpej
34e1127563 Don't include mvgbe in this kernel config; that driver has an explicit
warning for the MULTIPROCESSOR case.
2021-03-05 01:31:43 +00:00
palle
c8dcbb0278 sun4v: add vnet driver from openbsd - compiles but probably does not work yet - still WIP (now with NetBSD cvs tag and compiles for 32-bit SUN4U 2021-03-04 20:59:39 +00:00
skrll
8d5dbff40a Trailing whitespace 2021-03-04 20:30:39 +00:00
palle
6902eb251d sun4v: add vnet driver from openbsd - compiles but probably does not work yet - still WIP 2021-03-04 20:17:00 +00:00
palle
7d7625a754 sun4v: update TODO - removed leftover OpenFirmware interface comment and add comment on idle handling 2021-03-04 20:00:51 +00:00
gdt
0793b92a36 std.xen: Move towards std.amd64
(No functional change.)
2021-03-04 19:01:41 +00:00
gdt
2a7390ec95 XEN3_DOM0: Move closer to GENERIC (NFC)
This is another step in making XEN3_DOM0 closer to GENERIC.  It is
just reordering lines, adding commented out lines, and adding a few
comments.  (Test-booted with no dmesg change.)

This pass is showing cases where there are substantive and likely
undesired changes (e.g., UFS_ACL is not defined in XEN3_DOM0).  Often
I added them but commented them out to preserve the NFC property of
this commit.  My plan is to finish the easy NFC stuff first before
addressing functional changes.
2021-03-04 16:02:10 +00:00
gdt
a31ee26e36 GENERIC: Tiny comment adjustment (NFC)
While making XEN3_DOM0 more like GENERIC, I noticed a few differences
where GENERIC was off -- trivial things like missing spaces in
comments, inconsistent comment workding.  This fixes those, both
because they are valid fixes in their own right once noticed, and to
make the diff to XEN smaller.
2021-03-04 15:58:50 +00:00
nia
9bdcec1f86 ctwmrc: disable NoTitleFocus to prevent multiple windows having focus
some investigation help from Rhialto
2021-03-04 08:35:58 +00:00