From: Wen Congyang <wency@cn.fujitsu.com>
To: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
Cc: tachibana@mxm.nes.nec.co.jp, kexec@lists.infradead.org
Subject: Re: [PATCH] makedumpfile: fix off-by-one bug in page_to_pfn()
Date: Mon, 12 Dec 2011 17:23:59 +0800 [thread overview]
Message-ID: <4EE5C82F.1000404@cn.fujitsu.com> (raw)
In-Reply-To: <20111124142051.8b5df388.kumagai-atsushi@mxc.nes.nec.co.jp>
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
next prev parent reply other threads:[~2011-12-12 9:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2011-12-13 0:21 ` tachibana
2011-12-13 0:36 ` Wen Congyang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EE5C82F.1000404@cn.fujitsu.com \
--to=wency@cn.fujitsu.com \
--cc=kexec@lists.infradead.org \
--cc=kumagai-atsushi@mxc.nes.nec.co.jp \
--cc=tachibana@mxm.nes.nec.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox