From 83ac04c1a925ab14a49d9b5a9cbc379340f2890b Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Wed, 18 Sep 2024 00:00:22 +0900 Subject: [PATCH] fb: Fix FB junk leftover from stage1 in stage2 Signed-off-by: Hector Martin --- src/fb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/fb.c b/src/fb.c index d7b4f476..1a0e4e77 100644 --- a/src/fb.c +++ b/src/fb.c @@ -400,8 +400,12 @@ void fb_init(bool clear) &orig_logo); } - if (clear) + if (clear) { memset32(fb.ptr, 0, fb.size); + } else { + // Workaround for m1n1 stage 1 framebuffer UAF bug + memset32(fb.ptr, 0, min(256, fb.size)); + } console.margin.rows = 2; console.margin.cols = 4;