mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
fix: add unrecoverable to avoid out of bound access
Related-To: NEO-9038 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d76145ee65
commit
a31dd7b454
@@ -101,6 +101,8 @@ DIR *(*sysCallsOpendir)(const char *name) = nullptr;
|
||||
struct dirent *(*sysCallsReaddir)(DIR *dir) = nullptr;
|
||||
int (*sysCallsClosedir)(DIR *dir) = nullptr;
|
||||
int (*sysCallsGetDevicePath)(int deviceFd, char *buf, size_t &bufSize) = nullptr;
|
||||
off_t lseekReturn = 4096u;
|
||||
std::atomic<int> lseekCalledCount(0);
|
||||
|
||||
int mkdir(const std::string &path) {
|
||||
if (sysCallsMkdir != nullptr) {
|
||||
@@ -457,5 +459,10 @@ int closedir(DIR *dir) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
off_t lseek(int fd, off_t offset, int whence) noexcept {
|
||||
lseekCalledCount++;
|
||||
return lseekReturn;
|
||||
}
|
||||
|
||||
} // namespace SysCalls
|
||||
} // namespace NEO
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
#include <cstdint>
|
||||
#include <dirent.h>
|
||||
#include <iostream>
|
||||
@@ -73,5 +74,8 @@ extern bool mmapCaptureExtendedPointers;
|
||||
extern bool mmapAllowExtendedPointers;
|
||||
extern uint32_t mmapFuncCalled;
|
||||
extern uint32_t munmapFuncCalled;
|
||||
|
||||
extern off_t lseekReturn;
|
||||
extern std::atomic<int> lseekCalledCount;
|
||||
} // namespace SysCalls
|
||||
} // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user