Re: [Patch BUGFIX] kcore: fix its wrong size on x86_64

From: Amerigo Wang
Date: Thu Jun 18 2009 - 00:38:57 EST


On Wed, Jun 17, 2009 at 08:37:40PM -0700, Eric W. Biederman wrote:
>Amerigo Wang <xiyou.wangcong@xxxxxxxxx> writes:
>
>> On Tue, Jun 16, 2009 at 12:27:36PM -0700, Eric W. Biederman wrote:
>>>AmÃrico Wang <xiyou.wangcong@xxxxxxxxx> writes:
>>>>> I think a case can be made either way. ÂIn practice neither answer
>>>>> gives us a dense offset space on x86_64 so I think I prefer the
>>>>> current definition which sets or clears the high bits as opposed
>>>>> to something that mangles the address more.
>>>>>
>>>>
>>>> I am trying to dig more... There must be something wrong there.
>>>
>>>How so?
>>
>> See what you will get for kc_vaddr_to_offset(__va(0))?
>> It is supposed to be 0.
>
>I see: 0x0000880000001000 That extra 0x1000 looks suspicous.


huh? 0x0000880000000000 not?

>
>It MUST NOT be 0. That is where the ELF header lives in the file.

Of course I knew this.

Just read the code:

phdr->p_offset = kc_vaddr_to_offset(m->addr) + dataoff;

So it should be 0, 'dataoff' is there...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/