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/crash_dump.c
C · 1,853 bytes/*
* Routines for doing kexec-based kdump
*
* Copyright (C) 2017 Linaro Limited
* Author: AKASHI Takahiro <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/crash_dump.h>
#include <linux/errno.h>
#include <linux/io.h>
#include <linux/memblock.h>
#include <linux/uaccess.h>
#include <asm/memory.h>
/**
* copy_oldmem_page() - copy one page from old kernel memory
* @pfn: page frame number to be copied
* @buf: buffer where the copied page is placed
* @csize: number of bytes to copy
* @offset: offset in bytes into the page
* @userbuf: if set, @buf is in a user address space
*
* This function copies one page from old kernel memory into buffer pointed by
* @buf. If @buf is in userspace, set @userbuf to %1. Returns number of bytes
* copied or negative error in case of failure.
*/
ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
size_t csize, unsigned long offset,
int userbuf)
{
void *vaddr;
if (!csize)
return 0;
vaddr = memremap(__pfn_to_phys(pfn), PAGE_SIZE, MEMREMAP_WB);
if (!vaddr)
return -ENOMEM;
if (userbuf) {
if (copy_to_user((char __user *)buf, vaddr + offset, csize)) {
memunmap(vaddr);
return -EFAULT;
}
} else {
memcpy(buf, vaddr + offset, csize);
}
memunmap(vaddr);
return csize;
}
/**
* elfcorehdr_read - read from ELF core header
* @buf: buffer where the data is placed
* @csize: number of bytes to read
* @ppos: address in the memory
*
* This function reads @count bytes from elf core header which exists
* on crash dump kernel's memory.
*/
ssize_t elfcorehdr_read(char *buf, size_t count, u64 *ppos)
{
memcpy(buf, phys_to_virt((phys_addr_t)*ppos), count);
return count;
}