fix(MDC): revert f1shy's MDC changes and renames

This commit is contained in:
naturecodevoid
2023-06-04 07:19:42 -07:00
parent e7f766095a
commit 8bd8ec8723
12 changed files with 1137 additions and 1163 deletions

View File

@@ -0,0 +1,10 @@
#ifdef MDC
#pragma once
#include <stdlib.h>
#include <stdbool.h>
/// Uses CVE-2022-46689 to overwrite `overwrite_length` bytes of `file_to_overwrite` with `overwrite_data`, starting from `file_offset`.
/// `file_to_overwrite` should be a file descriptor opened with O_RDONLY.
/// `overwrite_length` must be less than or equal to `PAGE_SIZE`.
/// Returns `true` if the overwrite succeeded, and `false` if the device is not vulnerable.
bool unaligned_copy_switch_race(int file_to_overwrite, off_t file_offset, const void* overwrite_data, size_t overwrite_length);
#endif /* MDC */