Duncan Laurie has uploaded a new patch set (#2). ( https://review.coreboot.org/20368 )
Change subject: libpayload: corebootfb: Add null check for framebuffer address
......................................................................
libpayload: corebootfb: Add null check for framebuffer address
If the framebuffer address is zero the corebootfb_init() function
should abort and not attempt to use it for video, otherwise it
will likely hang.
This was tested by booting on a board that does not have a display
attached and includes the previous patch to zero the framebuffer
structure in the coreboot tables.
Change-Id: I53ca2e947a7915cebb31b51e11ac6c310d9d6c55
Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
---
M payloads/libpayload/drivers/video/corebootfb.c
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/68/20368/2
--
To view, visit https://review.coreboot.org/20368
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I53ca2e947a7915cebb31b51e11ac6c310d9d6c55
Gerrit-Change-Number: 20368
Gerrit-PatchSet: 2
Gerrit-Owner: Duncan Laurie <dlaurie(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Duncan Laurie has uploaded a new patch set (#2). ( https://review.coreboot.org/20367 )
Change subject: lib/coreboot_tables: Zero framebuffer structure
......................................................................
lib/coreboot_tables: Zero framebuffer structure
Zero the framebuffer structure so if it is not filled in (either if
no display is present or if there is an error) then it does not
provide garbage data to the payload.
This was noticed when booting a board without a display attached as
the payload wrote to the framebuffer at a random address.
With this change the payload can properly handle the case where a
display is not attached and not corrupt memory.
Change-Id: I8114d88496cd2a4f2e7f07f377fe76f3180a7f40
Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
---
M src/lib/coreboot_table.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/67/20367/2
--
To view, visit https://review.coreboot.org/20367
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I8114d88496cd2a4f2e7f07f377fe76f3180a7f40
Gerrit-Change-Number: 20367
Gerrit-PatchSet: 2
Gerrit-Owner: Duncan Laurie <dlaurie(a)chromium.org>
Duncan Laurie has uploaded this change for review. ( https://review.coreboot.org/20368
Change subject: libpayload: corebootfb: Add null check for framebuffer address
......................................................................
libpayload: corebootfb: Add null check for framebuffer address
If the framebuffer address is zero the corebootfb_init() function
should abort and not attempt to use it for video, otherwise it
will likely hang.
This was tested by booting on a board that does not have a display
attached and includes the previous patch to zero the framebuffer
structure in the coreboot tables.
Change-Id: I53ca2e947a7915cebb31b51e11ac6c310d9d6c55
Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
---
M payloads/libpayload/drivers/video/corebootfb.c
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/68/20368/1
diff --git a/payloads/libpayload/drivers/video/corebootfb.c b/payloads/libpayload/drivers/video/corebootfb.c
index 46f891f..1aeac12 100644
--- a/payloads/libpayload/drivers/video/corebootfb.c
+++ b/payloads/libpayload/drivers/video/corebootfb.c
@@ -237,6 +237,8 @@
fbinfo = virt_to_phys(lib_sysinfo.framebuffer);
fbaddr = FI->physical_address;
+ if (fbaddr == 0)
+ return -1;
coreboot_video_console.columns = FI->x_resolution / FONT_WIDTH;
coreboot_video_console.rows = FI->y_resolution / FONT_HEIGHT;
--
To view, visit https://review.coreboot.org/20368
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I53ca2e947a7915cebb31b51e11ac6c310d9d6c55
Gerrit-Change-Number: 20368
Gerrit-PatchSet: 1
Gerrit-Owner: Duncan Laurie <dlaurie(a)chromium.org>
Duncan Laurie has uploaded this change for review. ( https://review.coreboot.org/20367
Change subject: lib/coreboot_tables: Zero framebuffer structure
......................................................................
lib/coreboot_tables: Zero framebuffer structure
Zero the framebuffer structure so if it is not filled in (either if
it is not present or if there is an error) then it does not present
garbage data to the payload.
This was noticed when booting a board without a display attached as
the payload wrote to the framebuffer at a random address.
With this change the payload can properly handle the case where a
display is not attached and not corrupt memory.
Change-Id: I8114d88496cd2a4f2e7f07f377fe76f3180a7f40
Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
---
M src/lib/coreboot_table.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/67/20367/1
diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c
index aa6c7a5..52c18d0 100644
--- a/src/lib/coreboot_table.c
+++ b/src/lib/coreboot_table.c
@@ -138,7 +138,7 @@
static void lb_framebuffer(struct lb_header *header)
{
struct lb_framebuffer *framebuffer;
- struct lb_framebuffer fb;
+ struct lb_framebuffer fb = {0};
if (!IS_ENABLED(CONFIG_LINEAR_FRAMEBUFFER) || fill_lb_framebuffer(&fb))
return;
--
To view, visit https://review.coreboot.org/20367
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8114d88496cd2a4f2e7f07f377fe76f3180a7f40
Gerrit-Change-Number: 20367
Gerrit-PatchSet: 1
Gerrit-Owner: Duncan Laurie <dlaurie(a)chromium.org>