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 files81
satheesh575555/linux-4.19.72_cve-2022-36946Revision 34cc7d8183fd
- ↑..Parent directory
- probes/
- vdso/
- .gitignore
- Makefile
- acpi.c
- acpi_numa.c
- acpi_parking_protocol.c
- alternative.c
- arm64ksyms.c
- armv8_deprecated.c
- asm-offsets.c
- cacheinfo.c
- cpu-reset.S
- cpu-reset.h
- cpu_errata.c
- cpu_ops.c
- cpufeature.c
- cpuidle.c
- cpuinfo.c
- crash_core.c
- crash_dump.c
- debug-monitors.c
- efi-entry.S
- efi-header.S
- efi-rt-wrapper.S
- efi.c
- entry-fpsimd.S
- entry-ftrace.S
- entry.S
- fpsimd.c
- ftrace.c
- head.S
- hibernate-asm.S
- hibernate.c
- hw_breakpoint.c
- hyp-stub.S
- image.h
- insn.c
- io.c
- irq.c
- jump_label.c
- kaslr.c
- kgdb.c
- kuser32.S
- machine_kexec.c
- module-plts.c
- module.c
- module.lds
- paravirt.c
- pci.c
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
arch/arm64/kernel/perf_regs.c
C · 1,335 bytes// SPDX-License-Identifier: GPL-2.0
#include <linux/compat.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/perf_event.h>
#include <linux/bug.h>
#include <linux/sched/task_stack.h>
#include <asm/perf_regs.h>
#include <asm/ptrace.h>
u64 perf_reg_value(struct pt_regs *regs, int idx)
{
if (WARN_ON_ONCE((u32)idx >= PERF_REG_ARM64_MAX))
return 0;
/*
* Compat (i.e. 32 bit) mode:
* - PC has been set in the pt_regs struct in kernel_entry,
* - Handle SP and LR here.
*/
if (compat_user_mode(regs)) {
if ((u32)idx == PERF_REG_ARM64_SP)
return regs->compat_sp;
if ((u32)idx == PERF_REG_ARM64_LR)
return regs->compat_lr;
}
if ((u32)idx == PERF_REG_ARM64_SP)
return regs->sp;
if ((u32)idx == PERF_REG_ARM64_PC)
return regs->pc;
return regs->regs[idx];
}
#define REG_RESERVED (~((1ULL << PERF_REG_ARM64_MAX) - 1))
int perf_reg_validate(u64 mask)
{
if (!mask || mask & REG_RESERVED)
return -EINVAL;
return 0;
}
u64 perf_reg_abi(struct task_struct *task)
{
if (is_compat_thread(task_thread_info(task)))
return PERF_SAMPLE_REGS_ABI_32;
else
return PERF_SAMPLE_REGS_ABI_64;
}
void perf_get_regs_user(struct perf_regs *regs_user,
struct pt_regs *regs,
struct pt_regs *regs_user_copy)
{
regs_user->regs = task_pt_regs(current);
regs_user->abi = perf_reg_abi(current);
}