blob: 78f514e03df5b71b6b9eea02ce57350d39dbd947 [file] [log] [blame]
Patrick Williamsf1e5d692016-03-30 15:21:19 -05001From 451d80e52d851432e109771bb8febafca7a5f1f2 Mon Sep 17 00:00:00 2001
2From: Hector Marco-Gisbert <hecmargi@upv.es>
3Date: Wed, 16 Dec 2015 07:57:18 +0300
4Subject: [PATCH] Fix security issue when reading username and password
5
6This patch fixes two integer underflows at:
7 * grub-core/lib/crypto.c
8 * grub-core/normal/auth.c
9
10CVE-2015-8370
11
12Signed-off-by: Hector Marco-Gisbert <hecmargi@upv.es>
13Signed-off-by: Ismael Ripoll-Ripoll <iripoll@disca.upv.es>
14Also-By: Andrey Borzenkov <arvidjaar@gmail.com>
15
16Upstream-Status: Backport
17
18http://git.savannah.gnu.org/cgit/grub.git/commit/?id=451d80e52d851432e109771bb8febafca7a5f1f2
19
20CVE: CVE-2015-8370
21Signed-off-by: Armin Kuster <akuster@mvista.com>
22
23---
24 grub-core/lib/crypto.c | 3 ++-
25 grub-core/normal/auth.c | 7 +++++--
26 2 files changed, 7 insertions(+), 3 deletions(-)
27
28Index: git/grub-core/lib/crypto.c
29===================================================================
30--- git.orig/grub-core/lib/crypto.c
31+++ git/grub-core/lib/crypto.c
32@@ -458,7 +458,8 @@ grub_password_get (char buf[], unsigned
33
34 if (key == '\b')
35 {
36- cur_len--;
37+ if (cur_len)
38+ cur_len--;
39 continue;
40 }
41
42Index: git/grub-core/normal/auth.c
43===================================================================
44--- git.orig/grub-core/normal/auth.c
45+++ git/grub-core/normal/auth.c
46@@ -174,8 +174,11 @@ grub_username_get (char buf[], unsigned
47
48 if (key == '\b')
49 {
50- cur_len--;
51- grub_printf ("\b");
52+ if (cur_len)
53+ {
54+ cur_len--;
55+ grub_printf ("\b");
56+ }
57 continue;
58 }
59