Exploit databaseDownload repository ZIP
GH-a4473dcd9930d1ae4c0775adc06b1cfb
satheesh575555/linux-4.19.72_cve-2022-36946
Sources for CVE-2022-36946
2 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files98
satheesh575555/linux-4.19.72_cve-2022-36946Revision 34cc7d8183fd
- ↑..Parent directory
- Kconfig
- Kconfig.arm
- Kconfig.powerpc
- Kconfig.x86
- Makefile
- acpi-cpufreq.c
- amd_freq_sensitivity.c
- arm_big_little.c
- arm_big_little.h
- arm_big_little_dt.c
- armada-37xx-cpufreq.c
- bmips-cpufreq.c
- brcmstb-avs-cpufreq.c
- cppc_cpufreq.c
- cpufreq-dt-platdev.c
- cpufreq-dt.c
- cpufreq-dt.h
- cpufreq-nforce2.c
- cpufreq.c
- cpufreq_conservative.c
- cpufreq_governor.c
- cpufreq_governor.h
- cpufreq_governor_attr_set.c
- cpufreq_ondemand.c
- cpufreq_ondemand.h
- cpufreq_performance.c
- cpufreq_powersave.c
- cpufreq_stats.c
- cpufreq_userspace.c
- davinci-cpufreq.c
- e_powersaver.c
- elanfreq.c
- freq_table.c
- gx-suspmod.c
- highbank-cpufreq.c
- ia64-acpi-cpufreq.c
- imx6q-cpufreq.c
- intel_pstate.c
- kirkwood-cpufreq.c
- longhaul.c
- longhaul.h
- longrun.c
- loongson1-cpufreq.c
- loongson2_cpufreq.c
- maple-cpufreq.c
- mediatek-cpufreq.c
- mvebu-cpufreq.c
- omap-cpufreq.c
- p4-clockmod.c
- pasemi-cpufreq.c
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
drivers/cpufreq/ppc_cbe_cpufreq_pmi.c
C · 3,344 bytes/*
* pmi backend for the cbe_cpufreq driver
*
* (C) Copyright IBM Deutschland Entwicklung GmbH 2005-2007
*
* Author: Christian Krafft <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/timer.h>
#include <linux/init.h>
#include <linux/of_platform.h>
#include <asm/processor.h>
#include <asm/prom.h>
#include <asm/pmi.h>
#include <asm/cell-regs.h>
#ifdef DEBUG
#include <asm/time.h>
#endif
#include "ppc_cbe_cpufreq.h"
static u8 pmi_slow_mode_limit[MAX_CBE];
bool cbe_cpufreq_has_pmi = false;
EXPORT_SYMBOL_GPL(cbe_cpufreq_has_pmi);
/*
* hardware specific functions
*/
int cbe_cpufreq_set_pmode_pmi(int cpu, unsigned int pmode)
{
int ret;
pmi_message_t pmi_msg;
#ifdef DEBUG
long time;
#endif
pmi_msg.type = PMI_TYPE_FREQ_CHANGE;
pmi_msg.data1 = cbe_cpu_to_node(cpu);
pmi_msg.data2 = pmode;
#ifdef DEBUG
time = jiffies;
#endif
pmi_send_message(pmi_msg);
#ifdef DEBUG
time = jiffies - time;
time = jiffies_to_msecs(time);
pr_debug("had to wait %lu ms for a transition using " \
"PMI\n", time);
#endif
ret = pmi_msg.data2;
pr_debug("PMI returned slow mode %d\n", ret);
return ret;
}
EXPORT_SYMBOL_GPL(cbe_cpufreq_set_pmode_pmi);
static void cbe_cpufreq_handle_pmi(pmi_message_t pmi_msg)
{
u8 node, slow_mode;
BUG_ON(pmi_msg.type != PMI_TYPE_FREQ_CHANGE);
node = pmi_msg.data1;
slow_mode = pmi_msg.data2;
pmi_slow_mode_limit[node] = slow_mode;
pr_debug("cbe_handle_pmi: node: %d max_freq: %d\n", node, slow_mode);
}
static int pmi_notifier(struct notifier_block *nb,
unsigned long event, void *data)
{
struct cpufreq_policy *policy = data;
struct cpufreq_frequency_table *cbe_freqs = policy->freq_table;
u8 node;
/* Should this really be called for CPUFREQ_ADJUST and CPUFREQ_NOTIFY
* policy events?)
*/
node = cbe_cpu_to_node(policy->cpu);
pr_debug("got notified, event=%lu, node=%u\n", event, node);
if (pmi_slow_mode_limit[node] != 0) {
pr_debug("limiting node %d to slow mode %d\n",
node, pmi_slow_mode_limit[node]);
cpufreq_verify_within_limits(policy, 0,
cbe_freqs[pmi_slow_mode_limit[node]].frequency);
}
return 0;
}
static struct notifier_block pmi_notifier_block = {
.notifier_call = pmi_notifier,
};
static struct pmi_handler cbe_pmi_handler = {
.type = PMI_TYPE_FREQ_CHANGE,
.handle_pmi_message = cbe_cpufreq_handle_pmi,
};
static int __init cbe_cpufreq_pmi_init(void)
{
cbe_cpufreq_has_pmi = pmi_register_handler(&cbe_pmi_handler) == 0;
if (!cbe_cpufreq_has_pmi)
return -ENODEV;
cpufreq_register_notifier(&pmi_notifier_block, CPUFREQ_POLICY_NOTIFIER);
return 0;
}
device_initcall(cbe_cpufreq_pmi_init);