Exploit databaseDownload repository ZIP
GH-9a497cc26994d431b276e9e3b7a8f75c
satheesh575555/linux-4.19.72_cve-2023-0386
Sources for CVE-2023-0386
19 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files42
satheesh575555/linux-4.19.72_cve-2023-0386Revision ef9a4a9fbf2b
- ↑..Parent directory
- Kconfig
- Makefile
- alignment.c
- asids-debugfs.c
- cache-debugfs.c
- cache-j2.c
- cache-sh2.c
- cache-sh2a.c
- cache-sh3.c
- cache-sh4.c
- cache-sh5.c
- cache-sh7705.c
- cache-shx3.c
- cache.c
- consistent.c
- extable_32.c
- extable_64.c
- fault.c
- flush-sh4.c
- gup.c
- hugetlbpage.c
- init.c
- ioremap.c
- ioremap_fixed.c
- kmap.c
- mmap.c
- nommu.c
- numa.c
- pgtable.c
- pmb.c
- sram.c
- tlb-debugfs.c
- tlb-pteaex.c
- tlb-sh3.c
- tlb-sh4.c
- tlb-sh5.c
- tlb-urb.c
- tlbex_32.c
- tlbex_64.c
- tlbflush_32.c
- tlbflush_64.c
- uncached.c
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
arch/sh/mm/consistent.c
C · 1,616 bytes/*
* Copyright (C) 2004 - 2007 Paul Mundt
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <linux/io.h>
static int __init memchunk_setup(char *str)
{
return 1; /* accept anything that begins with "memchunk." */
}
__setup("memchunk.", memchunk_setup);
static void __init memchunk_cmdline_override(char *name, unsigned long *sizep)
{
char *p = boot_command_line;
int k = strlen(name);
while ((p = strstr(p, "memchunk."))) {
p += 9; /* strlen("memchunk.") */
if (!strncmp(name, p, k) && p[k] == '=') {
p += k + 1;
*sizep = memparse(p, NULL);
pr_info("%s: forcing memory chunk size to 0x%08lx\n",
name, *sizep);
break;
}
}
}
int __init platform_resource_setup_memory(struct platform_device *pdev,
char *name, unsigned long memsize)
{
struct resource *r;
dma_addr_t dma_handle;
void *buf;
r = pdev->resource + pdev->num_resources - 1;
if (r->flags) {
pr_warning("%s: unable to find empty space for resource\n",
name);
return -EINVAL;
}
memchunk_cmdline_override(name, &memsize);
if (!memsize)
return 0;
buf = dma_alloc_coherent(&pdev->dev, memsize, &dma_handle, GFP_KERNEL);
if (!buf) {
pr_warning("%s: unable to allocate memory\n", name);
return -ENOMEM;
}
memset(buf, 0, memsize);
r->flags = IORESOURCE_MEM;
r->start = dma_handle;
r->end = r->start + memsize - 1;
r->name = name;
return 0;
}