Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame^] | 1 | From 451d80e52d851432e109771bb8febafca7a5f1f2 Mon Sep 17 00:00:00 2001 |
| 2 | From: Hector Marco-Gisbert <hecmargi@upv.es> |
| 3 | Date: Wed, 16 Dec 2015 07:57:18 +0300 |
| 4 | Subject: [PATCH] Fix security issue when reading username and password |
| 5 | |
| 6 | This patch fixes two integer underflows at: |
| 7 | * grub-core/lib/crypto.c |
| 8 | * grub-core/normal/auth.c |
| 9 | |
| 10 | CVE-2015-8370 |
| 11 | |
| 12 | Signed-off-by: Hector Marco-Gisbert <hecmargi@upv.es> |
| 13 | Signed-off-by: Ismael Ripoll-Ripoll <iripoll@disca.upv.es> |
| 14 | Also-By: Andrey Borzenkov <arvidjaar@gmail.com> |
| 15 | |
| 16 | Upstream-Status: Backport |
| 17 | |
| 18 | http://git.savannah.gnu.org/cgit/grub.git/commit/?id=451d80e52d851432e109771bb8febafca7a5f1f2 |
| 19 | |
| 20 | CVE: CVE-2015-8370 |
| 21 | Signed-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 | |
| 28 | Index: 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 | |
| 42 | Index: 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 | |