Not really unless it’s run as root.
Uploaded to developers and testers repository just now.
Daniel has told me that this release may fix some of the issues we’ve been facing. Will test.
Edit: Doesn’t seem to fix anything.
I have discovered a way to disable the man
seccomp filter. You can set the MAN_DISABLE_SECCOMP=1
environment variable.
https://git.savannah.nongnu.org/cgit/man-db.git/tree/lib/sandbox.c#n142
The hardened-malloc package can simply create /etc/X11/Xsession.d/50hardened-malloc
with contents:
#!/bin/sh
## Copyright (C) 2012 - 2020 ENCRYPTED SUPPORT LP <adrelanos@riseup.net>
## See the file COPYING for copying conditions.
export MAN_DISABLE_SECCOMP=1
I doubt there will be any practical security disadvantages with this. Man pages aren’t exactly untrusted input and a seccomp filter is not a complete sandbox by itself anyway (e.g. it’s not like it can provide proper filesystem restrictions).
Awesome!
https://github.com/Whonix/hardened_malloc/blob/master/debian/50hardened-malloc
Much better solution than config-package-dev wrappers. Btw…
Fixed in man
upstream. Fix will probably arrive and can be removed in Debian bullseye
and above.
Not yet tested…
All untested… Another major issue. Breaks sshd
.
Also fixed upstream in sshd
, but Debian buster
version still has this issue. Killing sshd
on servers is a very high impact issue. Also probably fixed in Debian bullseye
. This speaks against installation by default before Debian bullseye
. Got any workaround for that?
That works for
- users of X.
Doesn’t work for:
- users not using X such as login in a virtual console.
- apt (to test:
sudo apt install --reinstall nano
) - services executed through systemd.
…because /etc/X11/Xsession.d
cannot set environment variables everywhere.
I don’t think Debian / Linux has any way to really set an environment variable globally everywhere?
No, I don’t think OpenSSH allows disabling the seccomp filter at runtime. There only appears to be compile-time options.
There’s /etc/environment
but no drop-in files.
It’s not global either. Wouldn’t work for APT or systemd units.
Maybe systemd’s DefaultEnvironment=
would work?
https://www.freedesktop.org/software/systemd/man/systemd-system.conf.html
Maybe systemd’s
DefaultEnvironment=
would work?
Good find. Maybe we could use this for preloading hardened_malloc also?
Some unrelated but interesting settings for security are in that man page too:
CapabilityBoundingSet
NoNewPrivileges
SystemCallArchitectures
Maybe we could use this for preloading hardened_malloc also?
Not sure.
DefaultEnvironment=
is “not really global”. It’s “pretty good but not perfect”.
DefaultEnvironment=
sets environment variables it for all systemd units [1] [2], virtual consoles but not for graphical X sessions. I don’t know why yet. This may or may not be fault of systemd. The login manager or X might unset environment variables.
It can be viewed using:
systemctl show-environment
I don’t know yet a (full) list of exceptions where DefaultEnvironment=
is effectively, eventually ignored due to whatever cause.
However, DefaultEnvironment=
might be be good enough for MAN_DISABLE_SECCOMP=1
man
seccomp
workaround. Implementing now.
[1] To add more potential exceptions… Individual systemd units using Environment=
or EnvironmentFile=
may or may not change this. Untested.
[2] Good enough for our use case as long as no APT related systemd units do this.
`ld-system-preload-disable` fails if `/etc/ld.so.preload` does not exists. > bw…
https://forums.whonix.org/t/hardened-malloc-hardened-memory-allocator/7474/132
lintian
is getting confused.
lintian --suppress-tags testsuite-autopkgtest-missing --quiet --pedantic --info --display-info "/home/user/whonix_binary/genmkfile-packages-result/helper-scripts_8.5-1_amd64.changes"
W: helper-scripts: manpage-has-bad-whatis-entry usr/share/man/man1/str_replace.1.gz
This breaks the build process. Probably happening due to lintian
’s internal use of lexgrog
.
env -i MAN_DISABLE_SECCOMP=1 lexgrog /usr/share/man/man1/nano.1.gz
/usr/share/man/man1/nano.1.gz: “nano - Nano’s ANOther editor, an enhanced free Pico clone”
0
env -i MAN_DISABLE_SECCOMP= lexgrog /usr/share/man/man1/nano.1.gz
lexgrog: zcat: Bad system call (core dumped)
…
1
I guess this is happening because lintian
implicitly unsets MAN_DISABLE_SECCOMP
environment variable. (It only sets LC_ALL
.)
delete local $ENV{$_}
for grep { $_ ne 'PATH' && $_ ne 'TMPDIR' } keys %ENV;
local $ENV{LC_ALL} = 'C.UTF-8';
my @command = ('lexgrog', $file->unpacked_path);
Btw MAN_DISABLE_SECCOMP=0
does not really work to re-enable man seccomp for tesging purposes but MAN_DISABLE_SECCOMP=
does.
lintian
is getting confused.
This breaks the build process.
Should be fixed by this workaround.
https://forums.whonix.org/t/hardened-malloc-hardened-memory-allocator/7474/135
openssh-server
(sshd
) is broken indeed in Debian buster
in combination with hardened-malloc-kicksecure
. Tested just now.
seccomp-bpf filter violation in sshd
After enabling the preload of the libhardened_malloc.so, I'm not able to login a…
Also fixed upstream in
sshd
, but Debianbuster
version still has this issue. Killingsshd
on servers is a very high impact issue. Also probably fixed in Debianbullseye
. This speaks against installation by default before Debianbullseye
. Got any workaround for that?
A potential workaround would be a systemd unit file drop in prepending ld-system-preload-disable
in for ExecStart=
etc. in front of sshd
. Thoughts?
cryptsetup luksFormat slowdown of factor ~ 6 when using hardened memory...
Issue description cryptsetup luksFormat gets slower by approximately factor ~ 6 when using hardened memory allocator Hardened Malloc. Without...
OpenSSH feature request: test compatibility with hardened memory allocator Hardened Malloc
A potential workaround would be a systemd unit file drop in prepending
ld-system-preload-disable
in forExecStart=
etc. in front ofsshd
. Thoughts?
It may work but sshd
sets up its own sandbox that ld-system-preload-disable
may conflict with.
VirtualBox bug report: VirtualBox crashes with hardened memory allocator Hardened Malloc on the host