From: Andrei Borzenkov <arvidjaar@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>, coreboot@coreboot.org
Subject: Dell Dimension 8300 reboots when grub2 cbfs module is loaded
Date: Sun, 1 Nov 2015 17:53:11 +0300 [thread overview]
Message-ID: <56362757.3070801@gmail.com> (raw)
I was debugging problem reported by user on Dell Dimension 8300 - it
rebooted when doing "ls -l". It turned out, the problem was triggered by
loading cbfs which probed for header. System has 2GB memory, and attempt
to read from address 0xffffffff caused instant reboot. 0xffffffff was
returned by read from non-existing address 0xfffffffc.
The proof of concept patch below avoids it, but I wonder what the proper
fix is.
diff --git a/grub-core/fs/cbfs.c b/grub-core/fs/cbfs.c
index a34eb88..a5a2fde 100644
--- a/grub-core/fs/cbfs.c
+++ b/grub-core/fs/cbfs.c
@@ -344,8 +344,9 @@ init_cbfsdisk (void)
ptr = *(grub_uint32_t *) 0xfffffffc;
head = (struct cbfs_header *) (grub_addr_t) ptr;
+ grub_dprintf ("cbfs", "head=%p\n", head);
- if (!validate_head (head))
+ if (0xffffffff - ptr < sizeof (*head) || !validate_head (head))
return;
cbfsdisk_size = ALIGN_UP (grub_be_to_cpu32 (head->romsize),
next reply other threads:[~2015-11-01 14:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-01 14:53 Andrei Borzenkov [this message]
2015-11-03 16:12 ` [coreboot] Dell Dimension 8300 reboots when grub2 cbfs module is loaded Martin Roth
2015-11-03 16:28 ` Vladimir 'phcoder' Serbinenko
2015-11-03 17:08 ` Andrei Borzenkov
2015-11-03 17:10 ` Vladimir 'phcoder' Serbinenko
2015-11-03 17:14 ` Andrei Borzenkov
2015-11-03 17:19 ` Andrei Borzenkov
2015-11-03 17:46 ` [coreboot] " Aaron Durbin
2015-11-03 18:05 ` Vladimir 'phcoder' Serbinenko
2015-11-03 21:41 ` Nico Huber
2015-11-04 11:35 ` Andrei Borzenkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56362757.3070801@gmail.com \
--to=arvidjaar@gmail.com \
--cc=coreboot@coreboot.org \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.