403Webshell
Server IP : 104.21.38.3  /  Your IP : 162.158.170.168
Web Server : Apache
System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/src/linux-headers-5.15.0-142/tools/testing/selftests/powerpc/security/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/src/linux-headers-5.15.0-142/tools/testing/selftests/powerpc/security/mitigation-patching.sh
#!/usr/bin/env bash

set -euo pipefail

TIMEOUT=10

function do_one
{
    local mitigation="$1"
    local orig
    local start
    local now

    orig=$(cat "$mitigation")

    start=$EPOCHSECONDS
    now=$start

    while [[ $((now-start)) -lt "$TIMEOUT" ]]
    do
        echo 0 > "$mitigation"
        echo 1 > "$mitigation"

        now=$EPOCHSECONDS
    done

    echo "$orig" > "$mitigation"
}

rc=0
cd /sys/kernel/debug/powerpc || rc=1
if [[ "$rc" -ne 0 ]]; then
    echo "Error: couldn't cd to /sys/kernel/debug/powerpc" >&2
    exit 1
fi

tainted=$(cat /proc/sys/kernel/tainted)
if [[ "$tainted" -ne 0 ]]; then
    echo "Error: kernel already tainted!" >&2
    exit 1
fi

mitigations="barrier_nospec stf_barrier count_cache_flush rfi_flush entry_flush uaccess_flush"

for m in $mitigations
do
    do_one "$m" &
done

echo "Spawned threads enabling/disabling mitigations ..."

if stress-ng > /dev/null 2>&1; then
    stress="stress-ng"
elif stress > /dev/null 2>&1; then
    stress="stress"
else
    stress=""
fi

if [[ -n "$stress" ]]; then
    "$stress" -m "$(nproc)" -t "$TIMEOUT" &
    echo "Spawned VM stressors ..."
fi

echo "Waiting for timeout ..."
wait

tainted=$(cat /proc/sys/kernel/tainted)
if [[ "$tainted" -ne 0 ]]; then
    echo "Error: kernel became tainted!" >&2
    exit 1
fi

echo "OK"
exit 0

Youez - 2016 - github.com/yon3zu
LinuXploit