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 files55
satheesh575555/linux-4.19.72_cve-2023-0386Revision ef9a4a9fbf2b
- ↑..Parent directory
- 40x_mmu.c
- 44x_mmu.c
- 8xx_mmu.c
- Makefile
- copro_fault.c
- dma-noncoherent.c
- drmem.c
- dump_hashpagetable.c
- dump_linuxpagetables.c
- fault.c
- fsl_booke_mmu.c
- hash64_4k.c
- hash64_64k.c
- hash_low_32.S
- hash_native_64.c
- hash_utils_64.c
- highmem.c
- hugepage-hash64.c
- hugetlbpage-book3e.c
- hugetlbpage-hash64.c
- hugetlbpage-radix.c
- hugetlbpage.c
- init-common.c
- init_32.c
- init_64.c
- mem.c
- mmap.c
- mmu_context.c
- mmu_context_book3s64.c
- mmu_context_hash32.c
- mmu_context_iommu.c
- mmu_context_nohash.c
- mmu_decl.h
- numa.c
- pgtable-book3e.c
- pgtable-book3s64.c
- pgtable-hash64.c
- pgtable-radix.c
- pgtable.c
- pgtable_32.c
- pgtable_64.c
- pkeys.c
- ppc_mmu_32.c
- slb.c
- slb_low.S
- slice.c
- subpage-prot.c
- tlb-radix.c
- tlb_hash32.c
- tlb_hash64.c
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
arch/powerpc/mm/vphn.c
C · 2,071 bytes// SPDX-License-Identifier: GPL-2.0
#include <asm/byteorder.h>
#include "vphn.h"
/*
* The associativity domain numbers are returned from the hypervisor as a
* stream of mixed 16-bit and 32-bit fields. The stream is terminated by the
* special value of "all ones" (aka. 0xffff) and its size may not exceed 48
* bytes.
*
* --- 16-bit fields -->
* _________________________
* | 0 | 1 | 2 | 3 | be_packed[0]
* ------+-----+-----+------
* _________________________
* | 4 | 5 | 6 | 7 | be_packed[1]
* -------------------------
* ...
* _________________________
* | 20 | 21 | 22 | 23 | be_packed[5]
* -------------------------
*
* Convert to the sequence they would appear in the ibm,associativity property.
*/
int vphn_unpack_associativity(const long *packed, __be32 *unpacked)
{
__be64 be_packed[VPHN_REGISTER_COUNT];
int i, nr_assoc_doms = 0;
const __be16 *field = (const __be16 *) be_packed;
u16 last = 0;
bool is_32bit = false;
#define VPHN_FIELD_UNUSED (0xffff)
#define VPHN_FIELD_MSB (0x8000)
#define VPHN_FIELD_MASK (~VPHN_FIELD_MSB)
/* Let's fix the values returned by plpar_hcall9() */
for (i = 0; i < VPHN_REGISTER_COUNT; i++)
be_packed[i] = cpu_to_be64(packed[i]);
for (i = 1; i < VPHN_ASSOC_BUFSIZE; i++) {
u16 new = be16_to_cpup(field++);
if (is_32bit) {
/* Let's concatenate the 16 bits of this field to the
* 15 lower bits of the previous field
*/
unpacked[++nr_assoc_doms] =
cpu_to_be32(last << 16 | new);
is_32bit = false;
} else if (new == VPHN_FIELD_UNUSED)
/* This is the list terminator */
break;
else if (new & VPHN_FIELD_MSB) {
/* Data is in the lower 15 bits of this field */
unpacked[++nr_assoc_doms] =
cpu_to_be32(new & VPHN_FIELD_MASK);
} else {
/* Data is in the lower 15 bits of this field
* concatenated with the next 16 bit field
*/
last = new;
is_32bit = true;
}
}
/* The first cell contains the length of the property */
unpacked[0] = cpu_to_be32(nr_assoc_doms);
return nr_assoc_doms;
}