Re: ARM: gcore, arm_regsets causes segfault

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Per Fransson <per.fransson.ml@xxxxxxxxx>
Subject:  ARM: gcore, arm_regsets causes segfault
Date: Wed, 9 May 2012 18:01:56 +0200

> Hi,
> 
> The for loop in
> 
>    libgcore/gcore_coredump.c:fill_thread_core_info()
> 
> does a
> 
>    notesize(struct memelfnote *)
> 
> where memelfnote->name points to the name of the corresponding
> arm_regset member (except REGSET_GPR).
> 
> But notesize calls strlen on those strings and
> 
>    arm_regsets[REGSET_VFP]->name == 0x0
> 
> making it segfault.
> 
> Regards,
> Per
> 

Hello Fransson,

Thanks for your report.

Lei, could you review and test attached patch?

Thanks.
HATAYAMA, Daisuke
>From 113c4bb2812e935e887ebdc6ff401c03d29a8ffb Mon Sep 17 00:00:00 2001
From: HATAYAMA Daisuke <d.hatayama@xxxxxxxxxxxxxx>
Date: Thu, 10 May 2012 09:13:01 +0900
Subject: [PATCH] arm: fix segfault at notesize calculation

arm_regsets[REGSET_VFP] now doesn't have its name causing NULL pointer
dereference at note size calculation in function notesize. Give it
proper name "CORE".
---
 src/libgcore/gcore_arm.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/libgcore/gcore_arm.c b/src/libgcore/gcore_arm.c
index 770924b..75852a8 100644
--- a/src/libgcore/gcore_arm.c
+++ b/src/libgcore/gcore_arm.c
@@ -105,6 +105,7 @@ static struct user_regset arm_regsets[] = {
 	},
 	[REGSET_VFP] = {
 		.core_note_type = NT_ARM_VFP,
+		.name = "CORE",
 		.size = ARM_VFPREGS_SIZE,
 		.active = vfp_vector_active,
 		.get = vfp_get,
-- 
1.7.4.4

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux