grub fix CVE-2015-8370

This commit is contained in:
AlmAck 2015-12-20 12:10:25 +01:00
parent f8097df00a
commit 7c01cefd53
2 changed files with 56 additions and 2 deletions

View File

@ -0,0 +1,47 @@
From e16eeda1200deabd0d3a4af968d526d62845a85f Mon Sep 17 00:00:00 2001
From: Hector Marco-Gisbert <hecmargi@upv.es>
Date: Fri, 13 Nov 2015 16:21:09 +0100
Subject: [PATCH] Fix security issue when reading username and password
This patch fixes two integer underflows at:
* grub-core/lib/crypto.c
* grub-core/normal/auth.c
Resolves: CVE-2015-8370
Signed-off-by: Hector Marco-Gisbert <hecmargi@upv.es>
Signed-off-by: Ismael Ripoll-Ripoll <iripoll@disca.upv.es>
---
grub-core/lib/crypto.c | 2 +-
grub-core/normal/auth.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/grub-core/lib/crypto.c b/grub-core/lib/crypto.c
index 010e550..524a3d8 100644
--- a/grub-core/lib/crypto.c
+++ b/grub-core/lib/crypto.c
@@ -468,7 +468,7 @@ grub_password_get (char buf[], unsigned buf_size)
break;
}
- if (key == '\b')
+ if (key == '\b' && cur_len)
{
cur_len--;
continue;
diff --git a/grub-core/normal/auth.c b/grub-core/normal/auth.c
index c6bd96e..5782ec5 100644
--- a/grub-core/normal/auth.c
+++ b/grub-core/normal/auth.c
@@ -172,7 +172,7 @@ grub_username_get (char buf[], unsigned buf_size)
break;
}
- if (key == '\b')
+ if (key == '\b' && cur_len)
{
cur_len--;
grub_printf ("\b");
--
2.6.4

View File

@ -16,7 +16,7 @@ _EFI_ARCH="x86_64"
pkgname="grub"
pkgdesc="GNU GRand Unified Bootloader (2)"
pkgver=2.02.beta2
pkgrel=3
pkgrel=4
url="https://www.gnu.org/software/grub/"
arch=('x86_64')
license=('GPL3')
@ -46,6 +46,7 @@ source=("grub-${_pkgver}::git+git://git.sv.gnu.org/grub.git#tag=${_GRUB_GIT_TAG}
'grub-10_linux-detect-archlinux-initramfs.patch'
'grub-intel-ucode.patch'
'grub-add-GRUB_COLOR_variables.patch'
'0001-Fix-security-issue-when-reading-username-and-password.patch'
'grub.default'
'update-grub')
@ -56,9 +57,11 @@ md5sums=('SKIP'
'945527e0de8d384166a4cf23439ae9ee'
'a678629bc82c4e70c48d28242036d1d7'
'e506ae4a9f9f7d1b765febfa84e10d48'
'9589ec46a04f9bb4d5da987340a4a324'
'31e4c7414cef3db3fb26c40ac8da97f2'
'9910bdfd42fa7d3e21e6961bfcc977f9')
_pkgver() {
cd "${srcdir}/grub-${_pkgver}/"
echo "$(git describe --tags)" | sed -e 's|grub.||g' -e 's|-|\.|g'
@ -68,7 +71,11 @@ prepare() {
cd "${srcdir}/grub-${_pkgver}/"
msg "Patch to load Intel microcode"
msg "Security fix CVE-2015-8370"
patch -Np1 -i ../0001-Fix-security-issue-when-reading-username-and-password.patch
patch -Np1 -i "${srcdir}/grub-intel-ucode.patch"
echo