new blfs: net-misc/openssh-10.2_p1
This commit is contained in:
@@ -0,0 +1 @@
|
||||
g sshd 22
|
||||
@@ -0,0 +1 @@
|
||||
u sshd 22:sshd User\ for\ ssh /var/empty /sbin/nologin
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
From 45b491ce13fcf7dbc0b3bd6df986c9cf59190721 Mon Sep 17 00:00:00 2001
|
||||
From: Jordan R Abrahams-Whitehead <ajordanr@google.com>
|
||||
Date: Tue, 12 Dec 2023 22:54:02 +0000
|
||||
Subject: [PATCH] Allow MAP_NORESERVE in sandbox seccomp filter maps
|
||||
|
||||
While debugging Scudo on ChromeOS, we found that the no reserve mode
|
||||
immediately crashed `sshd`. We tracked it down to the
|
||||
sandbox-seccomp-filter.
|
||||
|
||||
Being able to mmap with MAP_NORESERVE is useful (if not necessary) for
|
||||
some overcommitting allocators.
|
||||
|
||||
During mmap calls, the flag MAP_NORESERVE is used by some allocators
|
||||
such as LLVM's Scudo for layout optimisation. This causes the sandbox
|
||||
seccomp filter for the client subprocess to die with some Scudo
|
||||
configurations.
|
||||
|
||||
Upstream patch submission:
|
||||
https://lists.mindrot.org/pipermail/openssh-unix-dev/2023-December/041095.html
|
||||
---
|
||||
sandbox-seccomp-filter.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/sandbox-seccomp-filter.c b/sandbox-seccomp-filter.c
|
||||
index 23b40b643..a49c5ca99 100644
|
||||
--- a/sandbox-seccomp-filter.c
|
||||
+++ b/sandbox-seccomp-filter.c
|
||||
@@ -190,9 +190,11 @@
|
||||
|
||||
#if defined(__NR_mmap) || defined(__NR_mmap2)
|
||||
# ifdef MAP_FIXED_NOREPLACE
|
||||
-# define SC_MMAP_FLAGS MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED|MAP_FIXED_NOREPLACE
|
||||
+# define SC_MMAP_FLAGS MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED \
|
||||
+ |MAP_NORESERVE|MAP_FIXED_NOREPLACE
|
||||
# else
|
||||
-# define SC_MMAP_FLAGS MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED
|
||||
+# define SC_MMAP_FLAGS MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED \
|
||||
+ |MAP_NORESERVE
|
||||
# endif /* MAP_FIXED_NOREPLACE */
|
||||
/* Use this for both __NR_mmap and __NR_mmap2 variants */
|
||||
# define SC_MMAP(_nr) \
|
||||
--
|
||||
2.43.0.472.g3155946c3a-goog
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
diff -Naur a/ssh_config b/ssh_config
|
||||
--- a/ssh_config 2024-03-11 05:20:49.000000000 +0000
|
||||
+++ b/ssh_config 2024-06-10 16:30:15.863023773 +0100
|
||||
@@ -13,6 +13,9 @@
|
||||
# Thus, host-specific definitions should be at the beginning of the
|
||||
# configuration file, and defaults at the end.
|
||||
|
||||
+# Make sure that all Host and Match options are below this Include!
|
||||
+Include "/etc/ssh/ssh_config.d/*.conf"
|
||||
+
|
||||
# Site-wide defaults for some commonly used options. For a comprehensive
|
||||
# list of available options, their meanings and defaults, please see the
|
||||
# ssh_config(5) man page.
|
||||
diff -Naur a/sshd_config b/sshd_config
|
||||
--- a/sshd_config 2024-06-10 16:19:01.530491925 +0100
|
||||
+++ b/sshd_config 2024-06-10 16:32:49.766386759 +0100
|
||||
@@ -105,8 +105,8 @@
|
||||
# no default banner path
|
||||
#Banner none
|
||||
|
||||
-# override default of no subsystems
|
||||
-Subsystem sftp /usr/libexec/sftp-server
|
||||
+# Make sure that all Match options are below this Include!
|
||||
+Include "/etc/ssh/sshd_config.d/*.conf"
|
||||
|
||||
# Example of overriding settings on a per-user basis
|
||||
#Match User anoncvs
|
||||
@@ -0,0 +1,4 @@
|
||||
auth include system-remote-login
|
||||
account include system-remote-login
|
||||
password include system-remote-login
|
||||
session include system-remote-login
|
||||
@@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=OpenSSH server daemon
|
||||
After=network.target auditd.service
|
||||
|
||||
[Service]
|
||||
Type=notify-reload
|
||||
ExecStartPre=/usr/bin/ssh-keygen -A
|
||||
ExecStart=/usr/sbin/sshd -D -e
|
||||
KillMode=process
|
||||
OOMPolicy=continue
|
||||
Restart=on-failure
|
||||
RestartSec=42s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=OpenSSH Server Socket
|
||||
Conflicts=sshd.service
|
||||
|
||||
[Socket]
|
||||
ListenStream=22
|
||||
Accept=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=sockets.target
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=OpenSSH per-connection server daemon
|
||||
After=auditd.service
|
||||
|
||||
[Service]
|
||||
ExecStart=-/usr/sbin/sshd -i -e
|
||||
StandardInput=socket
|
||||
StandardError=journal
|
||||
Reference in New Issue
Block a user