Debian Bug report logs - #991936
openssh-server: seccomp filter defaults to SIGSYS, could break any libc or kernel upgrade

version graph

Package: openssh-server; Maintainer for openssh-server is Debian OpenSSH Maintainers <debian-ssh@lists.debian.org>; Source for openssh-server is src:openssh (PTS, buildd, popcon).

Reported by: Julian Andres Klode <jak@debian.org>

Date: Fri, 6 Aug 2021 09:33:01 UTC

Severity: important

Tags: upstream

Found in version openssh/1:8.4p1-5

Forwarded to https://bugzilla.mindrot.org/show_bug.cgi?id=3478

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, jak@debian.org, Debian OpenSSH Maintainers <debian-ssh@lists.debian.org>:
Bug#991936; Package openssh-server. (Fri, 06 Aug 2021 09:33:03 GMT) (full text, mbox, link).


Acknowledgement sent to Julian Andres Klode <jak@debian.org>:
New Bug report received and forwarded. Copy sent to jak@debian.org, Debian OpenSSH Maintainers <debian-ssh@lists.debian.org>. (Fri, 06 Aug 2021 09:33:03 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Julian Andres Klode <jak@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: openssh-server: seccomp filter defaults to SIGSYS, could break any libc or kernel upgrade
Date: Fri, 6 Aug 2021 11:29:15 +0200
Package: openssh-server
Version: 1:8.4p1-5ubuntu2
Severity: serious
X-Debbugs-Cc: jak@debian.org

seccomp filters are currently setup to kill the process

    #define SECCOMP_FILTER_FAIL SECCOMP_RET_KILL

    /* Default deny */
        BPF_STMT(BPF_RET+BPF_K, SECCOMP_FILTER_FAIL),

this means every new libc or kernel release can cause openssh
to break, requiring breaks from them on openssh, which does not
scale, and is currently breaking SSH during upgrades.

This also means openssh might fail to work inside containers
because the host kernel is newer.

The default policy needs to be changed to return ENOSYS instead,
such that libc can fallback to other syscalls for its wrappers.
With the caveat that umask is a bit broken, if you don't want to
allow it, block it explicitly with RET_KILL:

https://bugzilla.mozilla.org/show_bug.cgi?id=1724098

This should be fixed for bullseye+1, and fixed in a point release
IMO, it might be a tad too late right now for the release itself.

-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer                              i speak de, en



Added tag(s) bullseye-ignore. Request was from Paul Gevers <elbrus@debian.org> to control@bugs.debian.org. (Fri, 06 Aug 2021 12:48:05 GMT) (full text, mbox, link).


Removed tag(s) bullseye-ignore. Request was from Paul Gevers <elbrus@debian.org> to control@bugs.debian.org. (Sat, 14 Aug 2021 17:57:03 GMT) (full text, mbox, link).


No longer marked as found in versions 1:8.4p1-5ubuntu2. Request was from Axel Beckert <abe@debian.org> to control@bugs.debian.org. (Thu, 19 Aug 2021 17:48:03 GMT) (full text, mbox, link).


Marked as found in versions openssh/1:8.4p1-5. Request was from Axel Beckert <abe@debian.org> to control@bugs.debian.org. (Thu, 19 Aug 2021 17:48:03 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Debian OpenSSH Maintainers <debian-ssh@lists.debian.org>:
Bug#991936; Package openssh-server. (Sat, 01 Oct 2022 19:03:02 GMT) (full text, mbox, link).


Acknowledgement sent to Colin Watson <cjwatson@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian OpenSSH Maintainers <debian-ssh@lists.debian.org>. (Sat, 01 Oct 2022 19:03:02 GMT) (full text, mbox, link).


Message #18 received at 991936@bugs.debian.org (full text, mbox, reply):

From: Colin Watson <cjwatson@debian.org>
To: Julian Andres Klode <jak@debian.org>, 991936@bugs.debian.org
Subject: Re: Bug#991936: openssh-server: seccomp filter defaults to SIGSYS, could break any libc or kernel upgrade
Date: Sat, 1 Oct 2022 20:01:11 +0100
Control: severity -1 important
Control: tag -1 upstream
Control: forwarded -1 https://bugzilla.mindrot.org/show_bug.cgi?id=3478

On Fri, Aug 06, 2021 at 11:29:15AM +0200, Julian Andres Klode wrote:
> seccomp filters are currently setup to kill the process
> 
>     #define SECCOMP_FILTER_FAIL SECCOMP_RET_KILL
> 
>     /* Default deny */
>         BPF_STMT(BPF_RET+BPF_K, SECCOMP_FILTER_FAIL),
> 
> this means every new libc or kernel release can cause openssh
> to break, requiring breaks from them on openssh, which does not
> scale, and is currently breaking SSH during upgrades.
> 
> This also means openssh might fail to work inside containers
> because the host kernel is newer.
> 
> The default policy needs to be changed to return ENOSYS instead,
> such that libc can fallback to other syscalls for its wrappers.
> With the caveat that umask is a bit broken, if you don't want to
> allow it, block it explicitly with RET_KILL:
> 
> https://bugzilla.mozilla.org/show_bug.cgi?id=1724098
> 
> This should be fixed for bullseye+1, and fixed in a point release
> IMO, it might be a tad too late right now for the release itself.

I agree this is at least a problem waiting to happen and a noticeable
inconvenience for stable release maintenance, so I've (belatedly)
forwarded it upstream with a suggested patch.  The sandbox is
security-critical enough that I don't want to patch fundamental things
about its behaviour without upstream's consent, so we'll see what they
make of my suggestion.

I don't think this needs to be release-critical.  It's a significant
problem and I'd definitely like it to be fixed, but mostly this change
would protect us against specific manifestations of syscall filtering
problems that would be grave bugs, rather than being intrinsically RC.
As such I'm downgrading it a step for now.

Thanks,

-- 
Colin Watson (he/him)                              [cjwatson@debian.org]



Severity set to 'important' from 'serious' Request was from Colin Watson <cjwatson@debian.org> to 991936-submit@bugs.debian.org. (Sat, 01 Oct 2022 19:03:02 GMT) (full text, mbox, link).


Added tag(s) upstream. Request was from Colin Watson <cjwatson@debian.org> to 991936-submit@bugs.debian.org. (Sat, 01 Oct 2022 19:03:03 GMT) (full text, mbox, link).


Set Bug forwarded-to-address to 'https://bugzilla.mindrot.org/show_bug.cgi?id=3478'. Request was from Colin Watson <cjwatson@debian.org> to 991936-submit@bugs.debian.org. (Sat, 01 Oct 2022 19:03:03 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Mar 25 19:00:40 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.