All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] makedumpfile: fix off-by-one bug in page_to_pfn()
@ 2011-11-23  5:53 Wen Congyang
  2011-11-24  5:20 ` Atsushi Kumagai
  0 siblings, 1 reply; 5+ messages in thread
From: Wen Congyang @ 2011-11-23  5:53 UTC (permalink / raw)
  To: kexec

The pfn region in a mmd is [mmd->pfn_start, mmd->pfn_end).
So the max index should be mmd->pfn_end - mmd->pfn_start -1.
If index >=(not >) mmd->pfn_end - mmd->pfn_start, we should check
the next mmd.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>

---
 makedumpfile.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/makedumpfile.c b/makedumpfile.c
index 7b7c266..db8e53f 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -2879,7 +2879,7 @@ page_to_pfn(unsigned long page)
 		if (page < mmd->mem_map)
 			continue;
 		index = (page - mmd->mem_map) / SIZE(page);
-		if (index > mmd->pfn_end - mmd->pfn_start)
+		if (index >= mmd->pfn_end - mmd->pfn_start)
 			continue;
 		pfn = mmd->pfn_start + index;
 		break;
-- 
1.7.1

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] makedumpfile: fix off-by-one bug in page_to_pfn()
  2011-11-23  5:53 [PATCH] makedumpfile: fix off-by-one bug in page_to_pfn() Wen Congyang
@ 2011-11-24  5:20 ` Atsushi Kumagai
  2011-12-12  9:23   ` Wen Congyang
  0 siblings, 1 reply; 5+ messages in thread
From: Atsushi Kumagai @ 2011-11-24  5:20 UTC (permalink / raw)
  To: wency; +Cc: tachibana, kexec

Hi Wen,

Thank you for the patch. 
I will check it.

Thanks
Kumagai


On Wed, 23 Nov 2011 13:53:51 +0800
Wen Congyang <wency@cn.fujitsu.com> wrote:

> The pfn region in a mmd is [mmd->pfn_start, mmd->pfn_end).
> So the max index should be mmd->pfn_end - mmd->pfn_start -1.
> If index >=(not >) mmd->pfn_end - mmd->pfn_start, we should check
> the next mmd.
> 
> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> 
> ---
>  makedumpfile.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/makedumpfile.c b/makedumpfile.c
> index 7b7c266..db8e53f 100644
> --- a/makedumpfile.c
> +++ b/makedumpfile.c
> @@ -2879,7 +2879,7 @@ page_to_pfn(unsigned long page)
>  		if (page < mmd->mem_map)
>  			continue;
>  		index = (page - mmd->mem_map) / SIZE(page);
> -		if (index > mmd->pfn_end - mmd->pfn_start)
> +		if (index >= mmd->pfn_end - mmd->pfn_start)
>  			continue;
>  		pfn = mmd->pfn_start + index;
>  		break;
> -- 
> 1.7.1

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] makedumpfile: fix off-by-one bug in page_to_pfn()
  2011-11-24  5:20 ` Atsushi Kumagai
@ 2011-12-12  9:23   ` Wen Congyang
  2011-12-13  0:21     ` tachibana
  0 siblings, 1 reply; 5+ messages in thread
From: Wen Congyang @ 2011-12-12  9:23 UTC (permalink / raw)
  To: Atsushi Kumagai; +Cc: tachibana, kexec

At 11/24/2011 01:20 PM, Atsushi Kumagai Write:
> Hi Wen,
> 
> Thank you for the patch. 
> I will check it.

Hi, kumagai

do you have any comment for this patch?

Thanks
Wen Congyang

> 
> Thanks
> Kumagai
> 
> 
> On Wed, 23 Nov 2011 13:53:51 +0800
> Wen Congyang <wency@cn.fujitsu.com> wrote:
> 
>> The pfn region in a mmd is [mmd->pfn_start, mmd->pfn_end).
>> So the max index should be mmd->pfn_end - mmd->pfn_start -1.
>> If index >=(not >) mmd->pfn_end - mmd->pfn_start, we should check
>> the next mmd.
>>
>> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
>>
>> ---
>>  makedumpfile.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/makedumpfile.c b/makedumpfile.c
>> index 7b7c266..db8e53f 100644
>> --- a/makedumpfile.c
>> +++ b/makedumpfile.c
>> @@ -2879,7 +2879,7 @@ page_to_pfn(unsigned long page)
>>  		if (page < mmd->mem_map)
>>  			continue;
>>  		index = (page - mmd->mem_map) / SIZE(page);
>> -		if (index > mmd->pfn_end - mmd->pfn_start)
>> +		if (index >= mmd->pfn_end - mmd->pfn_start)
>>  			continue;
>>  		pfn = mmd->pfn_start + index;
>>  		break;
>> -- 
>> 1.7.1
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
> 


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] makedumpfile: fix off-by-one bug in page_to_pfn()
  2011-12-12  9:23   ` Wen Congyang
@ 2011-12-13  0:21     ` tachibana
  2011-12-13  0:36       ` Wen Congyang
  0 siblings, 1 reply; 5+ messages in thread
From: tachibana @ 2011-12-13  0:21 UTC (permalink / raw)
  To: Wen Congyang; +Cc: kexec, tachibana, Atsushi Kumagai

Hi Wen,

On 2011/12/12 17:23:59 +0800, Wen Congyang <wency@cn.fujitsu.com> wrote:
> At 11/24/2011 01:20 PM, Atsushi Kumagai Write:
> > Hi Wen,
> > 
> > Thank you for the patch. 
> > I will check it.
> 
> Hi, kumagai
> 
> do you have any comment for this patch?

Sorry for late reply.
I will merge your fix to the next makedumpfile. By the way, did you 
detect this problem only by source program? Or by result of makedumpfile?
If there is no problem, please let me know it.

Thanks
tachibana


> 
> Thanks
> Wen Congyang
> 
> > 
> > Thanks
> > Kumagai
> > 
> > 
> > On Wed, 23 Nov 2011 13:53:51 +0800
> > Wen Congyang <wency@cn.fujitsu.com> wrote:
> > 
> >> The pfn region in a mmd is [mmd->pfn_start, mmd->pfn_end).
> >> So the max index should be mmd->pfn_end - mmd->pfn_start -1.
> >> If index >=(not >) mmd->pfn_end - mmd->pfn_start, we should check
> >> the next mmd.
> >>
> >> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> >>
> >> ---
> >>  makedumpfile.c |    2 +-
> >>  1 files changed, 1 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/makedumpfile.c b/makedumpfile.c
> >> index 7b7c266..db8e53f 100644
> >> --- a/makedumpfile.c
> >> +++ b/makedumpfile.c
> >> @@ -2879,7 +2879,7 @@ page_to_pfn(unsigned long page)
> >>  		if (page < mmd->mem_map)
> >>  			continue;
> >>  		index = (page - mmd->mem_map) / SIZE(page);
> >> -		if (index > mmd->pfn_end - mmd->pfn_start)
> >> +		if (index >= mmd->pfn_end - mmd->pfn_start)
> >>  			continue;
> >>  		pfn = mmd->pfn_start + index;
> >>  		break;
> >> -- 
> >> 1.7.1
> > 
> > _______________________________________________
> > kexec mailing list
> > kexec@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/kexec
> > 
> 
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] makedumpfile: fix off-by-one bug in page_to_pfn()
  2011-12-13  0:21     ` tachibana
@ 2011-12-13  0:36       ` Wen Congyang
  0 siblings, 0 replies; 5+ messages in thread
From: Wen Congyang @ 2011-12-13  0:36 UTC (permalink / raw)
  To: tachibana; +Cc: kexec, Atsushi Kumagai

At 12/13/2011 08:21 AM, tachibana@mxm.nes.nec.co.jp Write:
> Hi Wen,
> 
> On 2011/12/12 17:23:59 +0800, Wen Congyang <wency@cn.fujitsu.com> wrote:
>> At 11/24/2011 01:20 PM, Atsushi Kumagai Write:
>>> Hi Wen,
>>>
>>> Thank you for the patch. 
>>> I will check it.
>>
>> Hi, kumagai
>>
>> do you have any comment for this patch?
> 
> Sorry for late reply.
> I will merge your fix to the next makedumpfile. By the way, did you 
> detect this problem only by source program? Or by result of makedumpfile?
> If there is no problem, please let me know it.

By result of makedumpfile. I find some pages are still in vmcore.

Thanks
Wen Congyang

> 
> Thanks
> tachibana
> 
> 
>>
>> Thanks
>> Wen Congyang
>>
>>>
>>> Thanks
>>> Kumagai
>>>
>>>
>>> On Wed, 23 Nov 2011 13:53:51 +0800
>>> Wen Congyang <wency@cn.fujitsu.com> wrote:
>>>
>>>> The pfn region in a mmd is [mmd->pfn_start, mmd->pfn_end).
>>>> So the max index should be mmd->pfn_end - mmd->pfn_start -1.
>>>> If index >=(not >) mmd->pfn_end - mmd->pfn_start, we should check
>>>> the next mmd.
>>>>
>>>> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
>>>>
>>>> ---
>>>>  makedumpfile.c |    2 +-
>>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>>
>>>> diff --git a/makedumpfile.c b/makedumpfile.c
>>>> index 7b7c266..db8e53f 100644
>>>> --- a/makedumpfile.c
>>>> +++ b/makedumpfile.c
>>>> @@ -2879,7 +2879,7 @@ page_to_pfn(unsigned long page)
>>>>  		if (page < mmd->mem_map)
>>>>  			continue;
>>>>  		index = (page - mmd->mem_map) / SIZE(page);
>>>> -		if (index > mmd->pfn_end - mmd->pfn_start)
>>>> +		if (index >= mmd->pfn_end - mmd->pfn_start)
>>>>  			continue;
>>>>  		pfn = mmd->pfn_start + index;
>>>>  		break;
>>>> -- 
>>>> 1.7.1
>>>
>>> _______________________________________________
>>> kexec mailing list
>>> kexec@lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/kexec
>>>
>>
>>
>> _______________________________________________
>> kexec mailing list
>> kexec@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/kexec
> 


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-12-13  0:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-23  5:53 [PATCH] makedumpfile: fix off-by-one bug in page_to_pfn() Wen Congyang
2011-11-24  5:20 ` Atsushi Kumagai
2011-12-12  9:23   ` Wen Congyang
2011-12-13  0:21     ` tachibana
2011-12-13  0:36       ` Wen Congyang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.