1
From 2549deb51c3636669b42370c1b2a5c7091016420 Mon Sep 17 00:00:00 2001
2
From: =?UTF-8?q?=D0=A0=D0=BE=D0=BC=D0=B0=D0=BD=20=D0=9F=D0=B5=D1=85=D0=BE?=
3
=?UTF-8?q?=D0=B2?= <roman_pekhov>
4
Date: Sun, 22 Jun 2014 03:51:50 +0400
5
Subject: * grub-core/commands/loadenv.c (check_blocklists): Fix overlap check.
7
Bug: http://savannah.gnu.org/bugs/?42134
8
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1311247
9
Origin: upstream, http://git.savannah.gnu.org/cgit/grub.git/commit/?id=1f6af2a9f8b02a71f213b4717d8e62c8a6b14fc5
10
Last-Update: 2015-01-23
12
Patch-Name: check_blocklists_overlap_fix.patch
14
grub-core/commands/loadenv.c | 13 ++-----------
15
1 file changed, 2 insertions(+), 11 deletions(-)
17
diff --git a/grub-core/commands/loadenv.c b/grub-core/commands/loadenv.c
18
index 6af8112..acd93d1 100644
19
--- a/grub-core/commands/loadenv.c
20
+++ b/grub-core/commands/loadenv.c
21
@@ -263,7 +263,7 @@ check_blocklists (grub_envblk_t envblk, struct blocklist *blocklists,
22
for (q = p->next; q; q = q->next)
24
grub_disk_addr_t s1, s2;
25
- grub_disk_addr_t e1, e2, t;
26
+ grub_disk_addr_t e1, e2;
29
e1 = s1 + ((p->length + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS);
30
@@ -271,16 +271,7 @@ check_blocklists (grub_envblk_t envblk, struct blocklist *blocklists,
32
e2 = s2 + ((q->length + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS);
44
+ if (s1 < e2 && s2 < e1)
46
/* This might be actually valid, but it is unbelievable that
47
any filesystem makes such a silly allocation. */