[Crash-utility] fix_lkcd_address problem

Alan Tyson atyson at hp.com
Wed Sep 19 17:03:17 UTC 2007


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.

--- 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;






More information about the Crash-utility mailing list