Просмотр исходного кода

Build: Lock down the /mod and /boot directories

Make these directories accessible to root only. Unprivileged users have
no need to look at the kernel binary or kernel modules.
Andreas Kling 5 лет назад
Родитель
Сommit
4398eec03c
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      Kernel/build-root-filesystem.sh

+ 4 - 0
Kernel/build-root-filesystem.sh

@@ -166,10 +166,14 @@ ln -s ProfileViewer mnt/bin/pv
 echo "done"
 echo "done"
 
 
 mkdir -p mnt/boot/
 mkdir -p mnt/boot/
+chmod 700 mnt/boot/
 cp kernel mnt/boot/
 cp kernel mnt/boot/
+chmod 600 mnt/boot/kernel
 
 
 mkdir -p mnt/mod/
 mkdir -p mnt/mod/
+chmod 700 mnt/mod/
 cp TestModule.kernel.o mnt/mod/TestModule.o
 cp TestModule.kernel.o mnt/mod/TestModule.o
+chmod 600 mnt/mod/*.o
 
 
 # Run local sync script, if it exists
 # Run local sync script, if it exists
 if [ -f sync-local.sh ]; then
 if [ -f sync-local.sh ]; then