mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-05-29 17:11:14 -04:00
minor mmap-rnd-bits improvements
This commit is contained in:
parent
d6d79e96c9
commit
89168ef40c
1 changed files with 18 additions and 2 deletions
|
@ -9,6 +9,23 @@
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
shopt -s failglob
|
shopt -s failglob
|
||||||
|
|
||||||
|
exit_with_error() {
|
||||||
|
echo "$0: SEE ALSO:" >&2
|
||||||
|
echo "" >&2
|
||||||
|
echo "https://forums.whonix.org/t/automate-mmap-randomisation-to-fix-ppc64el/16514" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if ! test -d /etc/sysctl.d ; then
|
||||||
|
echo "$0: ERROR: Folder /etc/sysctl.d does not exist!" >&2
|
||||||
|
exit_with_error
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! test -w /etc/sysctl.d/30_security-misc_aslr-mmap.conf ; then
|
||||||
|
echo "$0: ERROR: File /etc/sysctl.d/30_security-misc_aslr-mmap.conf not writeable! This script is supposed to be run as root." >&2
|
||||||
|
exit_with_error
|
||||||
|
fi
|
||||||
|
|
||||||
## Defaults in case Linux config detection fails. These are likely to work fine
|
## Defaults in case Linux config detection fails. These are likely to work fine
|
||||||
## on x86_64, probably not elsewhere.
|
## on x86_64, probably not elsewhere.
|
||||||
BITS_MAX_DEFAULT=32
|
BITS_MAX_DEFAULT=32
|
||||||
|
@ -48,5 +65,4 @@ if echo "${SYSCTL}" | tee /etc/sysctl.d/30_security-misc_aslr-mmap.conf > /dev/n
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$0: ERROR: Error writing ASLR map config file '/etc/sysctl.d/30_security-misc_aslr-mmap.conf'!" >&2
|
echo "$0: ERROR: Error writing ASLR map config file '/etc/sysctl.d/30_security-misc_aslr-mmap.conf'!" >&2
|
||||||
|
exit_with_error
|
||||||
exit 1
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue