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 files38
satheesh575555/linux-4.19.72_cve-2022-36946Revision 34cc7d8183fd
- ↑..Parent directory
- Kconfig
- Makefile
- amd-rng.c
- atmel-rng.c
- bcm2835-rng.c
- cavium-rng-vf.c
- cavium-rng.c
- core.c
- exynos-trng.c
- geode-rng.c
- hisi-rng.c
- imx-rngc.c
- intel-rng.c
- iproc-rng200.c
- ixp4xx-rng.c
- ks-sa-rng.c
- meson-rng.c
- mtk-rng.c
- mxc-rnga.c
- n2-asm.S
- n2-drv.c
- n2rng.h
- nomadik-rng.c
- octeon-rng.c
- omap-rng.c
- omap3-rom-rng.c
- pasemi-rng.c
- pic32-rng.c
- powernv-rng.c
- pseries-rng.c
- s390-trng.c
- st-rng.c
- stm32-rng.c
- timeriomem-rng.c
- tx4939-rng.c
- via-rng.c
- virtio-rng.c
- xgene-rng.c
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
drivers/char/hw_random/powernv-rng.c
C · 1,870 bytes/*
* Copyright 2013 Michael Ellerman, Guo Chao, IBM Corp.
*
* 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 of the License, or (at your option) any later version.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/random.h>
#include <linux/hw_random.h>
static int powernv_rng_read(struct hwrng *rng, void *data, size_t max, bool wait)
{
unsigned long *buf;
int i, len;
/* We rely on rng_buffer_size() being >= sizeof(unsigned long) */
len = max / sizeof(unsigned long);
buf = (unsigned long *)data;
for (i = 0; i < len; i++)
powernv_get_random_long(buf++);
return len * sizeof(unsigned long);
}
static struct hwrng powernv_hwrng = {
.name = "powernv-rng",
.read = powernv_rng_read,
};
static int powernv_rng_remove(struct platform_device *pdev)
{
hwrng_unregister(&powernv_hwrng);
return 0;
}
static int powernv_rng_probe(struct platform_device *pdev)
{
int rc;
rc = hwrng_register(&powernv_hwrng);
if (rc) {
/* We only register one device, ignore any others */
if (rc == -EEXIST)
rc = -ENODEV;
return rc;
}
pr_info("Registered powernv hwrng.\n");
return 0;
}
static const struct of_device_id powernv_rng_match[] = {
{ .compatible = "ibm,power-rng",},
{},
};
MODULE_DEVICE_TABLE(of, powernv_rng_match);
static struct platform_driver powernv_rng_driver = {
.driver = {
.name = "powernv_rng",
.of_match_table = powernv_rng_match,
},
.probe = powernv_rng_probe,
.remove = powernv_rng_remove,
};
module_platform_driver(powernv_rng_driver);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Bare metal HWRNG driver for POWER7+ and above");