[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/6] bitmap.h: set smaller image size limit when fuzzing
From: |
Daniel Axtens |
Subject: |
[PATCH 2/6] bitmap.h: set smaller image size limit when fuzzing |
Date: |
Tue, 28 Mar 2023 01:04:55 +1100 |
Large images mean large memory allocations, which could fail or at least be
very slow.
Also large images mean large files, which fuzzing generally cannot create.
Finally,
most parsing bugs (at least that we've found!) don't seem to rely on actually
large
images. So simply reduce the maximum size of an image to something we're more
likely
to actually be able to provide.
---
include/grub/bitmap.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/grub/bitmap.h b/include/grub/bitmap.h
index 431048936132..1e0c2666bc10 100644
--- a/include/grub/bitmap.h
+++ b/include/grub/bitmap.h
@@ -25,7 +25,11 @@
#include <grub/video.h>
#include <grub/safemath.h>
+#ifdef FUZZING_BUILD_MODE_NOT_SAFE_FOR_PRODUCTION
+#define IMAGE_HW_MAX_PX 512
+#else
#define IMAGE_HW_MAX_PX 16384
+#endif
struct grub_video_bitmap
{
--
2.25.1
- [PATCH 0/6] Support fuzzing grub's image file parsers, Daniel Axtens, 2023/03/27
- [PATCH 1/6] configure.ac: detect if compiler supports -fsanitize=fuzzer, Daniel Axtens, 2023/03/27
- [PATCH 4/6] tests: create a fuzzer for the jpeg image format, Daniel Axtens, 2023/03/27
- [PATCH 6/6] docs: document fuzzer support, Daniel Axtens, 2023/03/27
- [PATCH 3/6] tests: create a fuzzer for the png image format, Daniel Axtens, 2023/03/27
- [PATCH 2/6] bitmap.h: set smaller image size limit when fuzzing,
Daniel Axtens <=
- [PATCH 5/6] tests: create a fuzzer for the tga image format, Daniel Axtens, 2023/03/27