mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2025-05-02 06:26:20 -04:00
Don't disable slub/slab merging via kernel command line, but by default
I have a sneaking suspicion that the length of some device command lines is causing boot issues. eg. with the recent additions, klte boots fine, but recovery doesn't, maybe bootloader is adding more flags, exceeding a limit? Signed-off-by: Tad <tad@spotco.us>
This commit is contained in:
parent
3bb1199c34
commit
083e2048f8
2 changed files with 8 additions and 3 deletions
|
@ -493,8 +493,8 @@ export -f hardenUserdata;
|
|||
hardenBootArgs() {
|
||||
cd "$DOS_BUILD_BASE$1";
|
||||
#Unavailable: kpti=on pti=on (4.15) page_alloc.shuffle=1 (5.2) init_on_alloc=1 (5.3) init_on_free=1 (5.3) lockdown=confidentiality (5.4)
|
||||
# 3.18 4.4
|
||||
sed -i 's/BOARD_KERNEL_CMDLINE := /BOARD_KERNEL_CMDLINE := slub_debug=FZP slub_nomerge slab_nomerge page_poison=1 /' BoardConfig*.mk */BoardConfig*.mk &>/dev/null || true;
|
||||
# 4.4
|
||||
sed -i 's/BOARD_KERNEL_CMDLINE := /BOARD_KERNEL_CMDLINE := slub_debug=FZP page_poison=1 /' BoardConfig*.mk */BoardConfig*.mk &>/dev/null || true;
|
||||
echo "Hardened kernel command line arguments for $1";
|
||||
cd "$DOS_BUILD_BASE";
|
||||
}
|
||||
|
@ -812,6 +812,11 @@ hardenDefconfig() {
|
|||
#MSM_DLOAD_MODE can't be disabled as it breaks compile
|
||||
sed -i 's/set_dload_mode(in_panic)/set_dload_mode(0)/' arch/arm/mach-msm/restart.c &>/dev/null || true;
|
||||
|
||||
#Disable slub/slab merging
|
||||
sed -i 's/static int slub_nomerge;/static int slub_nomerge = 1;/' mm/slub.c &>/dev/null || true; #2.6.22-3.17
|
||||
sed -i 's/static int slab_nomerge;/static int slab_nomerge = 1;/' mm/slab_common.c &>/dev/null || true; #3.18-4.12
|
||||
sed -i 's/static bool slab_nomerge = !IS_ENABLED(CONFIG_SLAB_MERGE_DEFAULT);/static bool slab_nomerge = true;/' mm/slab_common.c &>/dev/null || true; #4.13+
|
||||
|
||||
editKernelLocalversion "-dos";
|
||||
|
||||
echo "Hardened defconfig for $1";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue