fb: Fix FB junk leftover from stage1 in stage2

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2024-09-18 00:00:22 +09:00
parent 9741ff9b97
commit 83ac04c1a9

View file

@ -400,8 +400,12 @@ void fb_init(bool clear)
&orig_logo); &orig_logo);
} }
if (clear) if (clear) {
memset32(fb.ptr, 0, fb.size); 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.rows = 2;
console.margin.cols = 4; console.margin.cols = 4;