mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
Full release notes are available at https://www.openssh.com/txt/release-10.0 Selected highlights from the release notes: Potentially-incompatible changes - This release removes support for the weak DSA signature algorithm. [This change was previously merged to FreeBSD main.] - This release has the version number 10.0 and announces itself as "SSH-2.0-OpenSSH_10.0". Software that naively matches versions using patterns like "OpenSSH_1*" may be confused by this. - sshd(8): this release removes the code responsible for the user authentication phase of the protocol from the per-connection sshd-session binary to a new sshd-auth binary. Security - sshd(8): fix the DisableForwarding directive, which was failing to disable X11 forwarding and agent forwarding as documented. [This change was previously merged to FreeBSD main.] New features - ssh(1): the hybrid post-quantum algorithm mlkem768x25519-sha256 is now used by default for key agreement. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51630
82 lines
2.1 KiB
C
82 lines
2.1 KiB
C
/* $OpenBSD: sandbox-rlimit.c,v 1.5 2020/10/18 11:32:01 djm Exp $ */
|
|
/*
|
|
* Copyright (c) 2011 Damien Miller <[email protected]>
|
|
*
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
* copyright notice and this permission notice appear in all copies.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
*/
|
|
|
|
#include "includes.h"
|
|
|
|
#ifdef SANDBOX_RLIMIT
|
|
|
|
#include <sys/types.h>
|
|
#include <sys/time.h>
|
|
#include <sys/resource.h>
|
|
|
|
#include <errno.h>
|
|
#include <stdarg.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
|
|
#include "log.h"
|
|
#include "ssh-sandbox.h"
|
|
#include "xmalloc.h"
|
|
|
|
/* Minimal sandbox that sets zero nfiles, nprocs and filesize rlimits */
|
|
|
|
struct ssh_sandbox {
|
|
int junk;
|
|
};
|
|
|
|
struct ssh_sandbox *
|
|
ssh_sandbox_init(struct monitor *monitor)
|
|
{
|
|
struct ssh_sandbox *box;
|
|
|
|
/*
|
|
* Strictly, we don't need to maintain any state here but we need
|
|
* to return non-NULL to satisfy the API.
|
|
*/
|
|
debug3_f("preparing rlimit sandbox");
|
|
box = xcalloc(1, sizeof(*box));
|
|
return box;
|
|
}
|
|
|
|
void
|
|
ssh_sandbox_child(struct ssh_sandbox *box)
|
|
{
|
|
struct rlimit rl_zero;
|
|
|
|
rl_zero.rlim_cur = rl_zero.rlim_max = 0;
|
|
|
|
#ifndef SANDBOX_SKIP_RLIMIT_FSIZE
|
|
if (setrlimit(RLIMIT_FSIZE, &rl_zero) == -1)
|
|
fatal_f("setrlimit(RLIMIT_FSIZE, { 0, 0 }): %s",
|
|
strerror(errno));
|
|
#endif
|
|
#ifndef SANDBOX_SKIP_RLIMIT_NOFILE
|
|
if (setrlimit(RLIMIT_NOFILE, &rl_zero) == -1)
|
|
fatal_f("setrlimit(RLIMIT_NOFILE, { 0, 0 }): %s",
|
|
strerror(errno));
|
|
#endif
|
|
#ifdef HAVE_RLIMIT_NPROC
|
|
if (setrlimit(RLIMIT_NPROC, &rl_zero) == -1)
|
|
fatal_f("setrlimit(RLIMIT_NPROC, { 0, 0 }): %s",
|
|
strerror(errno));
|
|
#endif
|
|
}
|
|
|
|
#endif /* SANDBOX_RLIMIT */
|