glibc: Add security buflen and 32bit regression patches

closes #1429
This commit is contained in:
jbu 2015-04-28 09:08:14 +02:00
parent 313b5b8a09
commit 5913710dfb
2 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,15 @@
Taken from http://www.linuxfromscratch.org/lfs/view/development/chapter06/glibc.html
--- sysdeps/i386/i686/multiarch/mempcpy_chk.S 2015-02-06 07:40:18.000000000 +0100
+++ sysdeps/i386/i686/multiarch/mempcpy_chk.S 2015-04-25 17:38:44.952119997 +0200
@@ -36,8 +36,8 @@
cmpl $0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
jne 1f
call __init_cpu_features
- leal __mempcpy_chk_ia32@GOTOFF(%ebx), %eax
-1: testl $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
+1: leal __mempcpy_chk_ia32@GOTOFF(%ebx), %eax
+ testl $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
jz 2f
leal __mempcpy_chk_sse2_unaligned@GOTOFF(%ebx), %eax
testl $bit_Fast_Unaligned_Load, FEATURE_OFFSET+index_Fast_Unaligned_Load+__cpu_features@GOTOFF(%ebx)

View file

@ -0,0 +1,14 @@
Taken from http://www.linuxfromscratch.org/lfs/view/development/chapter06/glibc.html
--- resolv/nss_dns/dns-host.c 2015-02-06 07:40:18.000000000 +0100
+++ resolv/nss_dns/dns-host.c 2015-04-25 17:38:58.365119958 +0200
@@ -615,7 +615,8 @@
int have_to_map = 0;
uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
buffer += pad;
- if (__glibc_unlikely (buflen < sizeof (struct host_data) + pad))
+ buflen = buflen > pad ? buflen - pad : 0;
+ if (__glibc_unlikely (buflen < sizeof (struct host_data)))
{
/* The buffer is too small. */
too_small: