diff options
Diffstat (limited to 'executor/common_linux.h')
| -rw-r--r-- | executor/common_linux.h | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h index d3f4b6ea1..e5587d1c7 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -2872,27 +2872,6 @@ struct fs_image_segment { uintptr_t offset; }; -#define IMAGE_MAX_SEGMENTS 4096 -#define IMAGE_MAX_SIZE (129 << 20) - -static unsigned long fs_image_segment_check(unsigned long size, unsigned long nsegs, struct fs_image_segment* segs) -{ - if (nsegs > IMAGE_MAX_SEGMENTS) - nsegs = IMAGE_MAX_SEGMENTS; - for (size_t i = 0; i < nsegs; i++) { - if (segs[i].size > IMAGE_MAX_SIZE) - segs[i].size = IMAGE_MAX_SIZE; - segs[i].offset %= IMAGE_MAX_SIZE; - if (segs[i].offset > IMAGE_MAX_SIZE - segs[i].size) - segs[i].offset = IMAGE_MAX_SIZE - segs[i].size; - if (size < segs[i].offset + segs[i].offset) - size = segs[i].offset + segs[i].offset; - } - if (size > IMAGE_MAX_SIZE) - size = IMAGE_MAX_SIZE; - return size; -} - // Setup the loop device needed for mounting a filesystem image. Takes care of // creating and initializing the underlying file backing the loop device and // returns the fds to the file and device. @@ -2900,8 +2879,6 @@ static unsigned long fs_image_segment_check(unsigned long size, unsigned long ns static int setup_loop_device(long unsigned size, long unsigned nsegs, struct fs_image_segment* segs, const char* loopname, int* memfd_p, int* loopfd_p) { int err = 0, loopfd = -1; - - size = fs_image_segment_check(size, nsegs, segs); int memfd = syscall(__NR_memfd_create, "syzkaller", 0); if (memfd == -1) { err = errno; |
