grub-devel
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]