Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1pgnU0-0007sw-It for mharc-grub-devel@gnu.org; Mon, 27 Mar 2023 10:06:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pgnTx-0007pW-Kg for grub-devel@gnu.org; Mon, 27 Mar 2023 10:05:57 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pgnTm-0002rY-Q3 for grub-devel@gnu.org; Mon, 27 Mar 2023 10:05:55 -0400 Received: by mail-pl1-x635.google.com with SMTP id u10so8531047plz.7 for ; Mon, 27 Mar 2023 07:05:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; t=1679925928; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LJsmzja8cyQ4mOoYjj58JwSYBRixdKaT9XermSehEPE=; b=juxtyH3WCVrxf4yBJ05kr6DX+imIofbKtkkaFM0GcKxRGjem1cx8qRVteaIPcSnmNk m3eqBiLsKcCqUMiAOYYTydrz9PI36cZ9g1C8aX5Jbx6FU0YtnPRg52yx+ar4m3gdZNRz GVDYhtV58+m9BGBUV7XZ4rKqBGwUrO+eh2WNc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679925928; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LJsmzja8cyQ4mOoYjj58JwSYBRixdKaT9XermSehEPE=; b=yl9AlczTCV/DxQE0C4q6r/3StlzgT748Q+Te3QIjf5NQBzsiVTnx0floHIKQ0z14Ff aCp9r9rH7kbj/Dy8PScFZUN8eb96Y6q5b2JzPYPa7TL2QN5pdODtlhh9CRhDQYoCqGTc 6mm6Q1UgChF3TP/OXhUa1190MDqhMg9qAT6dtiY4YPO80fYZU3A2OM1jaYk6kxxfX4wv yhacVo4yCGoQZErSv0s5JgwCBOYixCDW6y7iV9QekcRJPTKCeUmlEqqEkEBYKpNOW2MV pHmmCJyNxaPaZ47N9jnlAVGP2uzIvYXoHyCec3wDLJgwW9rZKYjjvSKLM8Ts1f9Nyu/7 Lbiw== X-Gm-Message-State: AAQBX9eJIdoD1jTfrNqrsy1Dg+DPqGH4G62k8mqLkyXmEojCRmmeyrxr sMKcmkDK5Ic5YLDnYyBVfv6hN7EXdg9ZPweFHEc= X-Google-Smtp-Source: AKy350bTppbbuOytiAZI1eaMKTR9EPEnTC6vJYV9Z0Elr+xB8DNFAG2eIWullBpcMvxCZQVxwlXhtw== X-Received: by 2002:a17:903:5cb:b0:1a0:6139:e9ef with SMTP id kf11-20020a17090305cb00b001a06139e9efmr10968306plb.59.1679925928132; Mon, 27 Mar 2023 07:05:28 -0700 (PDT) Received: from linkitivity.lan (123-243-125-234.tpgi.com.au. [123.243.125.234]) by smtp.gmail.com with ESMTPSA id c11-20020a170902aa4b00b001a1fe42a141sm8493032plr.115.2023.03.27.07.05.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 07:05:27 -0700 (PDT) From: Daniel Axtens To: grub-devel@gnu.org Cc: Daniel Axtens Subject: [PATCH 2/6] bitmap.h: set smaller image size limit when fuzzing Date: Tue, 28 Mar 2023 01:04:55 +1100 Message-Id: <20230327140459.601018-3-dja@axtens.net> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230327140459.601018-1-dja@axtens.net> References: <20230327140459.601018-1-dja@axtens.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=dja@axtens.net; helo=mail-pl1-x635.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2023 14:05:57 -0000 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 #include +#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