From 022e208a25c3e8e66d740982ab53d36b02bcbe67 Mon Sep 17 00:00:00 2001 From: patrick Date: Sun, 23 Apr 2023 10:29:35 +0000 Subject: [PATCH] Stop setting ri->ri_bs to prevent a panic caused by rasops accessing its uninitialized content. When we rasops_init() with RI_VCONS, a new screen is allocated. If ri->ri_bs is set, this will be copied. Otherwise a new one will be allocated and filled with ASCII spaces. Copying the ri->ri_bs is useful in case we have an early console which contents we want to keep. As we do not have an early console here, there's no point in setting it at the moment. With this my Hetzner arm64 VM doesn't panic anymore. ok jcs@ kettenis@ --- sys/dev/pv/viogpu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/dev/pv/viogpu.c b/sys/dev/pv/viogpu.c index c00a6b395d4..e8a91c34310 100644 --- a/sys/dev/pv/viogpu.c +++ b/sys/dev/pv/viogpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: viogpu.c,v 1.1 2023/04/20 19:28:31 jcs Exp $ */ +/* $OpenBSD: viogpu.c,v 1.2 2023/04/23 10:29:35 patrick Exp $ */ /* * Copyright (c) 2021-2023 joshua stein @@ -92,7 +92,6 @@ struct viogpu_softc { struct wsscreen_descr sc_wsd; struct wsscreen_list sc_wsl; struct wsscreen_descr *sc_scrlist[1]; - struct wsdisplay_charcell sc_fb_bs[VIOGPU_HEIGHT * VIOGPU_WIDTH]; int console; int primary; @@ -261,7 +260,6 @@ viogpu_attach(struct device *parent, struct device *self, void *aux) ri->ri_gnum = 8; ri->ri_rpos = 16; ri->ri_rnum = 8; - ri->ri_bs = sc->sc_fb_bs; rasops_init(ri, VIOGPU_HEIGHT, VIOGPU_WIDTH); strlcpy(sc->sc_wsd.name, "std", sizeof(sc->sc_wsd.name)); -- 2.20.1