[Crash-utility] fix_lkcd_address problem
Dave Anderson
anderson at redhat.com
Wed Sep 19 18:05:24 UTC 2007
Alan Tyson wrote:
> Hi,
>
> I believe that there is an incorrect comparison in fix_lkcd_address:
>
> 059 ulonglong
> 060 fix_lkcd_address(ulonglong addr)
> 061 {
> 062 int i;
> 063 ulong offset;
> 064
> 065 for (i = 0; i < lkcd->fix_addr_num; i++) {
> 066 if ( (addr >=lkcd->fix_addr[i].task) &&
> 067 (addr <= lkcd->fix_addr[i].task + STACKSIZE())){
> ^^^^^- here
>
> On Itanium fix_addr[i] + STACKSIZE() may be the address of an adjacent
> task structure. As it stands both parts of the comparison pass if addr is
> the address in the fix_addr[i].task field or if it is the task structure
> which follows that one. The result is this it is not possible to read the
> task structure of the task that follows a task which is in this fixup list
> and zeroes are returned instead.
>
> Regards,
>
> Alan Tyson, HP.
Hi Alan,
I normally defer all LKCD-related fixes to Troy Heber,
but unless he disapproves for whatever reason, this one
looks pretty obvious, and I've queued it for the next release.
Thanks,
Dave
>
> --- lkcd_common.c.orig 2007-08-27 16:51:11.000000000 +0100
> +++ lkcd_common.c 2007-09-19 16:46:07.000000000 +0100
> @@ -64,7 +64,7 @@ fix_lkcd_address(ulonglong addr)
>
> for (i = 0; i < lkcd->fix_addr_num; i++) {
> if ( (addr >=lkcd->fix_addr[i].task) &&
> - (addr <= lkcd->fix_addr[i].task + STACKSIZE())){
> + (addr < lkcd->fix_addr[i].task + STACKSIZE())){
>
> offset = addr - lkcd->fix_addr[i].task;
> addr = lkcd->fix_addr[i].saddr + offset;
>
>
>
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
More information about the Crash-utility
mailing list