Commit Graph

32 Commits

Author SHA1 Message Date
Joshua Watt ff5bedcaf0 openssh: Atomically generate host keys
Generating the host keys atomically prevents power interruptions during the
first boot from leaving the key files incomplete, which often prevents users
from being able to ssh into the device.

[YOCTO #11671]

(From OE-Core rev: d532735e608e32ef1f5a7307c344e528e8fa2f01)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 43fc3d8e180c168dbe5dd5faa577e69a279bd1bd)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-08 10:31:20 -08:00
Joshua Watt ebb625a140 openssh: Fix key generation with systemd
106b59d9 broke SSH host key generation when systemd and a read-only root file
system are in use because there isn't a way for systemd to get the optional
weak assigment of SYSCONFDIR from /etc/default/sshd and still provide a default
value if it is not specified. Instead, move the logic for determining if keys
need to be created to a helper script that both the SysV init script and the
systemd unit file can reference.

This does mean that the systemd unit file can't check for file existence to
know if it should start the service, but it wasn't able to do that correctly
anyway anymore. This should be a problem since the serivce is only run once per
power cycle by systemd, and should exit quickly if the keys already exist

(From OE-Core rev: 73f1397d86f33abace089cc9a28e859b47bb7b6c)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>

(cherry picked from commit 7e49c5879862253ae1b6a26535d07a2740a95798)
Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-05 22:39:48 +00:00
André Draszik 28b8850356 openssh: allow to override OpenSSL HostKeys when read-only-rootfs
With these changes it is possible to have a .bbappend that
- sets SYSCONFDIR to some persistent storage
- modifies SYSCONFDIR/sshd_config to use ssh host keys from
  the (writable) sysconfdir

(From OE-Core rev: 79c7c8342859306750f0af17210a183fdc543caf)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Reviewed-by: Stephane Ayotte <sayotte@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>

(cherry picked from commit 106b59d9f96f70d133fa1421091ad280d27a5b6a)
Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-05 22:39:47 +00:00
Dengke Du d742290d84 openssh: upgrade to 7.4p1
1. Drop CVE patch: fix-CVE-2016-8858.patch, because the version 7.4p1 have
   been fixed it.

2. Rebase the remaining patchs on the version 7.4p1.

(From OE-Core rev: b648b382046bd94f0cf5fe0aa4b77ab250f126cd)

Signed-off-by: Dengke Du <dengke.du@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-26 10:44:28 +00:00
Kai Kang dae2cfc2c4 openssh: fix CVE-2016-8858
Backport patch to fix CVE-2016-8858 of openssh.

Ref:
https://bugzilla.redhat.com/show_bug.cgi?id=1384860

(From OE-Core rev: 134a05616839d002970b2e7124ea38348d10209b)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 11:10:12 +00:00
Yuanjie Huang b2a6f9a97d openssh: fix potential signed overflow to enable compilation with -ftrapv
Pointer arithmatic results in implementation defined signed integer
type, so that 's - src' in strlcpy and others may trigger signed overflow.
In case of compilation by gcc or clang with -ftrapv option, the overflow
would lead to program abort.

Upstream-status: Submitted [https://bugzilla.mindrot.org/show_bug.cgi?id=2608]

(From OE-Core rev: 2ce02941300aa3e826df0c59fd8d4ce19950028e)

Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-20 15:11:08 +01:00
Jussi Kukkonen 5a3947cce1 openssh: Upgrade 7.2p2 -> 7.3p1
Remove CVE-2015-8325.patch as it's included upstream. Rebase another
patch.

(From OE-Core rev: 4b695379dcf378e8d77deaf7e558e8cbd314683c)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-23 17:44:42 +01:00
Ross Burton 43a3933624 meta: add more missing patch tags
(From OE-Core rev: 5e5a6145d844c2f6daa3258429a870c42475adff)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:22 +01:00
mingli.yu@windriver.com 2f6bbc7006 openssh: conditional compile DES code.
After openssl disabled DES, openssh fails to build
for some DES codes are not wrapped in conditional
compile statement "#ifndef OPENSSL_NO_DES" and "#endif".

(From OE-Core rev: cd9c62461e837967dd29a532d32990c23350acf8)

Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:29 +01:00
Matthew Campbell 772ba8d865 openssh: fix init script restart with read-only-rootfs
restart in the init script uses the check_config() function which doesn't have
the $SSHD_OPTS passed through. This causes it to check the wrong config (and
fail when read-only-rootfs is enabled.

(From OE-Core rev: cb6f78072deb8b8c22baf5c31c3bd19d7e0af236)

Signed-off-by: Matthew Campbell <mcampbell@izotope.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-23 14:26:14 +01:00
Jussi Kukkonen 90cb500a7f openssh: Backport fix for CVE-2015-8325
PAM environment vars must be ignored when UseLogin=yes

(From OE-Core rev: 0a06be81cb650def54a4c2059bd728c75954306f)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19 09:05:19 +01:00
Jussi Kukkonen 4d72f50631 openssh: Upgrade 7.1p2 -> 7.2p2
Remove patches that are in the release.

(From OE-Core rev: 5e24780ac0fea9012f28f6e3f1040c431d3a742e)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19 09:05:19 +01:00
Armin Kuster 3c6ead9129 openssh: Security Fix CVE-2016-3115
opehssh <= 7.2

(From OE-Core rev: 7d6abd0b7b89f28343741c2188da22c6d1c6c8ea)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-29 07:41:43 +01:00
Jussi Kukkonen e65a29e311 openssh: Properly skip ptrace test if tools are missing
Without the exit there will be a SKIP and a FAIL for the same test.
Also fix typo in a message.

(From OE-Core rev: d44a2ec730fe52d2266c5e4d184cd4c881e172d1)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11 12:27:47 +00:00
Armin Kuster a2f23fa628 openssh: CVE-2016-1907
This issue requires three commits:
https://anongit.mindrot.org/openssh.git/commit/?id=ed4ce82dbfa8a3a3c8ea6fa0db113c71e234416c
https://anongit.mindrot.org/openssh.git/commit/?id=f98a09cacff7baad8748c9aa217afd155a4d493f
https://anongit.mindrot.org/openssh.git/commit/?id=2fecfd486bdba9f51b3a789277bb0733ca36e1c0

(From OE-Core rev: a42229df424552955c0ac62da1063461f97f5938)

Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-18 11:47:08 +00:00
Roy Li 19a626d6b3 openssh: redesign ssh-agent.sh regression test case
ssh-agent regression test case should be run by non-root user,
but non-root user will has issue to run other testcase, so
rewrite it on run-ptest

(From OE-Core rev: 5ca6bb9b73bf09c1847ec3e5a7477829bd3d77b5)

Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:32:13 +00:00
Alexander Kanavin 299806d0dc openssh: fix sshd key generation when systemd is in use and rootfs is readonly
[YOCTO #8365]

(From OE-Core rev: d5ea131fe94939daabee1afe8219683de259b7a3)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:37 +01:00
Jussi Kukkonen ee80b725aa openssh: build regression test binaries
ptests were failing and many more were being silently skipped because
required binaries were not being built.

Build the binaries in regress/ and set SUDO environment variable in
run-ptests: after this all tests in regress/ are now run. Continue to
skip building binaries in regress/unittests/: unittest runtime is
excessive.

On a NUC running intel-corei7-64 core-image-sato, new results are:
PASS: 55, SKIP: 3, FAIL: 0

[YOCTO #8153]

(From OE-Core rev: 1f7aaf76f4aa7875f05f4b838a5ec4594a4c35dc)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24 23:46:54 +01:00
Wenlin Kang 90972c9518 openssh: fix login fails for ssh -o Batchmode=yes with empty passwords
The patch fixes the login fails for ssh -o Batchmode=yes when passwords is
empty and without authorized_keys file even if set "PermitEmptyPasswords yes"
in sshd_config file.

Here, to fix this issue, we remove the file auth2-none.c-avoid-authenticate-
empty-passwords-to-m.patch, that fixed broken pipe while sshd with pam,
but it isn't needed any more now, because we make it has gone by change
ChallengeResponseAuthentication value in sshd_config file.

(From OE-Core rev: f879a7406d8fce37e8baf5fe724d7ed0042d57f8)

Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-03 11:43:50 +01:00
Khem Raj 5688e6c739 openssh: Upgrade 6.7 - > 6.8
Its a major releaseof openssh, should be fully
compatible with 6.7 additionally works with musl

Change-Id: I903d31247b8a318b9be1c21f764ffe56b5971ca9
(From OE-Core rev: 4ac2974f463f8e2970d9e44e3b273c672a3cab8c)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-21 07:20:24 +01:00
Dan McGregor e4dc8fe86c openssh: configuration updates
Rebase sshd_config and ssh_config with openssh upstream.
Check for the ed25519 key in the systemd keygen service.

(From OE-Core rev: 046dd5567d9de0596023846e7f0c6df7f01a9f5b)

Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-03 14:53:54 +00:00
Paul Eggleton 3fb5191d4d openssh: upgrade to 6.7p1
* Drop two CVE patches already handled upstream.
* Drop nostrip.patch which no longer applies and use the existing
  --disable-strip configure option instead.
* OpenSSH 6.7+ no longer supports tcp wrappers. We could apply the
  Debian patch to add support back in, but it seems best to follow
  upstream here unless we have a good reason to do otherwise.

(From OE-Core rev: 59e0833e24e4945569d36928dc0f231e822670ba)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-07 23:35:06 +00:00
Paul Eggleton 4d6772706c openssh: drop already applied patch
This patch was part of the 6.6p1 release.

(From OE-Core rev: 45206510ab48bfee6e183f698f963fea8f03e2a5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-11-20 14:09:02 +00:00
Paul Eggleton a9dc143c44 openssh: avoid screen sessions being killed on disconnect with systemd
Tell systemd just to kill the sshd process when the ssh connection drops
instead of the entire cgroup for sshd, so that any screen sessions (and
more to the point, processes within them) do not get killed.

(This is what the Fedora sshd service file does, and what we're already
doing in the dropbear service file).

(From OE-Core rev: 3c238dff41fbd3687457989c7b17d22b2cc844be)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-18 16:14:03 +02:00
Richard Tollerton c0585ca59a openssh: use pidfile in initscript
Stopping sshd must only kill the listening (top-level) daemon; it must
not stop any other sshd process, because those are forked ssh
connections which may include e.g. the connection that called
/etc/init.d/sshd stop.

This initscript uses "start-stop-daemon -x <exe>" for starting/stopping.
When that is provided by busybox, this behavior is broken:
`/etc/init.d/sshd stop` stops *all* sshd processes. This was caused by a
fix to busybox 1.20: 17eedcad9406c43beddab3906c8c693626c351fb
"ssd: compat: match -x EXECUTABLE by /proc/pid/exe too".

The fix is to use a pidfile. All initscripts in upstream openssh do this,
as does dropbear.

Acked-by: Gratian Crisan <gratian.crisan@ni.com>
Acked-by: Ken Sharp <ken.sharp@ni.com>
(From OE-Core rev: 993405285e547403d5c753adfa91c26c43be13f6)

Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
Signed-off-by: Ben Shelton <ben.shelton@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-19 00:09:01 +01:00
Chen Qi 301c3f9389 openssh: avoid checking empty passwords to mess up with PAM modules
Previously, even if PAM is enabled for ssh, the daemon still tries to
authenticate an empty password. This leads to authentication failure
which would mess up with PAM modules.

As a result, if 'UsePAM', 'PermitEmptyPasswords' and 'PasswordAuthentication'
are enabled, no user can login correctly. We would meet the following error
message at the client side.

	Write failed: Broken Pipe

This patch fixes the above problem by checking whether PAM is enabled before
authenticating an empty password. After all, if PAM is enabled, the task of
authenticating passwords should be handled to PAM modules.

[YOCTO #6466]

(From OE-Core rev: e017ae71dad4837b0d22f291b0b0e0949075f822)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-03 17:41:18 +01:00
Chen Qi f518096384 openssh: fix for CVE-2014-2653
The verify_host_key function in sshconnect.c in the client in OpenSSH 6.6 and
earlier allows remote servers to trigger the skipping of SSHFP DNS RR checking
by presenting an unacceptable HostCertificate.

(From OE-Core rev: 7b2fff61b3d1c0566429793ee348fa8978ef0cba)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-13 19:32:06 +01:00
Chen Qi fbf63c30c8 openssh: fix for CVE-2014-2532
sshd in OpenSSH before 6.6 does not properly support wildcards on
AcceptEnv lines in sshd_config, which allows remote attackers to
bypass intended environment restrictions by using a substring located
before a wildcard character.

(From OE-Core rev: a8d3b8979c27a8dc87971b66a1d9d9282f660596)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-13 19:32:06 +01:00
Saul Wold 5992d2971f openssh: add /var/log/lastlog to volatile list
The /var/log/messages reports /var/log/lastlog as missing, since openssh
needs this file, create it as a volatile.

[YOCTO #6172]

(From OE-Core rev: a29af8c20187a65fbdbbedd0b7158c07d3e713cf)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-08 13:00:35 +01:00
Maxin B. John f11e9e295d openssh: enable ptest support
Install openssh test-suite and run it as ptest.

(From OE-Core rev: 4d0ecccae671bffb40c870a6e33d20be869b89bc)

Signed-off-by: Maxin B. John <maxin.john@enea.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-25 17:19:19 +01:00
Saul Wold 5baa4d7e68 openssh: Update init file to add ED25519 Key generation
[YOCTO #5983]

(From OE-Core rev: c859f9a9f765654a292d57a2bfcea8b4f4c65087)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-19 14:19:07 +00:00
Paul Eggleton 1964da1b48 openssh: upgrade to 6.5p1
(From OE-Core rev: ea86d4ccc56f7933f988f0b24f09c5b6888d51ed)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-02 17:25:27 +00:00