~ubuntu-branches/ubuntu/trusty/grub2/trusty-proposed

« back to all changes in this revision

Viewing changes to debian/patches/check_blocklists_overlap_fix.patch

  • Committer: Package Import Robot
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2015-09-23 21:29:20 UTC
  • Revision ID: package-import@ubuntu.com-20150923212920-lxcyrhbqt1f39h0n
Tags: 2.02~beta2-9ubuntu1.4
Fix overlap check in check_blocklists for load_env (backported patch from
upstream commit 1f6af2a9). (LP: #1311247)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.
 
6
 
 
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
 
11
 
 
12
Patch-Name: check_blocklists_overlap_fix.patch
 
13
---
 
14
 grub-core/commands/loadenv.c | 13 ++-----------
 
15
 1 file changed, 2 insertions(+), 11 deletions(-)
 
16
 
 
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)
 
23
         {
 
24
          grub_disk_addr_t s1, s2;
 
25
-         grub_disk_addr_t e1, e2, t;
 
26
+         grub_disk_addr_t e1, e2;
 
27
 
 
28
          s1 = p->sector;
 
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,
 
31
          s2 = q->sector;
 
32
          e2 = s2 + ((q->length + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS);
 
33
 
 
34
-         if (s2 > s1)
 
35
-           {
 
36
-             t = s2;
 
37
-             s2 = s1;
 
38
-             s1 = t;
 
39
-             t = e2;
 
40
-             e2 = e1;
 
41
-             e1 = t;
 
42
-           }
 
43
-          if (e1 > s2)
 
44
+         if (s1 < e2 && s2 < e1)
 
45
             {
 
46
               /* This might be actually valid, but it is unbelievable that
 
47
                  any filesystem makes such a silly allocation.  */