403Webshell
Server IP : 210.245.233.93  /  Your IP : 216.73.216.226
Web Server : Apache/2.2.15 (CentOS)
System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/self/root/proc/self/root/usr/libexec/microcode_ctl/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/proc/self/root/usr/libexec/microcode_ctl/reload_microcode
#! /bin/bash -efu

# Trigger microcode reload with additional check for BDW-EP that can have
# microcode reloaded only in case kernel has specific patches.
#
# SPDX-License-Identifier: CC0-1.0

get_model_string()
{
	/usr/bin/printf "%s %02x-%02x-%02x" \
		$(/bin/sed -rn '1,/^$/{
			s/^vendor_id[[:space:]]*: (.*)$/\1/p;
			s/^cpu family[[:space:]]*: (.*)$/\1/p;
			s/^model[[:space:]]*: (.*)$/\1/p;
			s/^stepping[[:space:]]*: (.*)$/\1/p;
		}' /proc/cpuinfo)
}

CFG_BDW=intel-06-4f-01
CFG_SNB=intel-06-2d-07
CFG_SKL_SP=intel-06-55-04
CFG_SKL_UY=intel-06-4e-03
CFG_SKL_HS=intel-06-5e-03
CHECK_CAVEATS=/usr/libexec/microcode_ctl/check_caveats
MC_FILE=/lib/firmware/microcode.dat

model="$(get_model_string)"

# Broadwell-EP/EX check
if [ "x${model}" = "xGenuineIntel 06-4f-01" ]; then
	cc_out=$("$CHECK_CAVEATS" -m -c "$CFG_BDW") || exit 1

	# Check that the configuration hasn't been skipped
	ok_cfgs=$(printf "%s" "$cc_out" | sed -n 's/^ok_cfgs //p')

	[ "x$ok_cfgs" = "x$CFG_BDW" ] || exit 1

	MC_FILE=/lib/firmware/microcode-06-4f-01.dat
fi

# Sandy Bridge-E/EN/EP check
if [ "x${model}" = "xGenuineIntel 06-2d-07" ]; then
	cc_out=$("$CHECK_CAVEATS" -m -c "$CFG_SNB" || :)

	# Check that the configuration hasn't been skipped
	ok_cfgs=$(printf "%s" "$cc_out" | sed -n 's/^ok_cfgs //p')

	# Contrary to BDW caveat, we have a fallback in microcode.dat
	[ "x$ok_cfgs" != "x$CFG_SNB" ] || {
		MC_FILE=/lib/firmware/microcode-06-2d-07.dat
	}
fi

# Skylake-SP/W/X check
if [ "x${model}" = "xGenuineIntel 06-55-04" ]; then
	cc_out=$("$CHECK_CAVEATS" -m -c "$CFG_SKL_SP" || :)

	# Check that the configuration hasn't been skipped
	ok_cfgs=$(printf "%s" "$cc_out" | sed -n 's/^ok_cfgs //p')

	# Contrary to BDW caveat, we have a fallback in microcode.dat
	[ "x$ok_cfgs" != "x$CFG_SKL_SP" ] || {
		MC_FILE=/lib/firmware/microcode-06-55-04.dat
	}
fi

# Skylake-U/Y check
if [ "x${model}" = "xGenuineIntel 06-4e-03" ]; then
	cc_out=$("$CHECK_CAVEATS" -m -c "$CFG_SKL_UY" || :)

	# Check that the configuration hasn't been skipped
	ok_cfgs=$(printf "%s" "$cc_out" | sed -n 's/^ok_cfgs //p')

	# Contrary to BDW caveat, we have a fallback in microcode.dat
	[ "x$ok_cfgs" != "x$CFG_SKL_UY" ] || {
		MC_FILE=/lib/firmware/microcode-06-4e-03.dat
	}
fi

# Skylake-H/S/Xeon E3 v5 check
if [ "x${model}" = "xGenuineIntel 06-5e-03" ]; then
	cc_out=$("$CHECK_CAVEATS" -m -c "$CFG_SKL_HS" || :)

	# Check that the configuration hasn't been skipped
	ok_cfgs=$(printf "%s" "$cc_out" | sed -n 's/^ok_cfgs //p')

	# Contrary to BDW caveat, we have a fallback in microcode.dat
	[ "x$ok_cfgs" != "x$CFG_SKL_HS" ] || {
		MC_FILE=/lib/firmware/microcode-06-5e-03.dat
	}
fi

/sbin/microcode_ctl -Qu -f "$MC_FILE"

Youez - 2016 - github.com/yon3zu
LinuXploit