makedumpfile: fix off-by-one bug in page_to_pfn()
Subsystems (2)
PATCH 1/1 makedumpfile: fix off-by-one bug in page_to_pfn()
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.
--- makedumpfile.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
makedumpfile.c +1 -1
@@ -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 ;
Signature · 6 lines
1.7.1 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Hi Wen,
Thank you for the patch.
I will check it.
Thanks
Kumagai
Quoted 26 lines · On Wed, 23 Nov 2011 13:53:51 +0800 Wen Congyang <[email protected]> wrote:
The pfn region in a mmd is [
mmd->pfn_start,mmd->pfn_end). So the max index should bemmd->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 <[email protected]>--- makedumpfile.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)makedumpfile.c +1
-1@@ -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 ;Signature · 1 line
1.7.1
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
At 11/24/2011 01:20 PM, Atsushi Kumagai Write:
Quoted 4 lines
Hi Wen,
Thank you for the patch.
I will check it.
Hi, kumagai
do you have any comment for this patch?
Thanks
Wen Congyang
Quoted 31 lines
Thanks
KumagaiQuoted 23 lines · On Wed, 23 Nov 2011 13:53:51 +0800 Wen Congyang <[email protected]> wrote:
The pfn region in a mmd is [
mmd->pfn_start,mmd->pfn_end). So the max index should bemmd->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 <[email protected]>--- makedumpfile.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)makedumpfile.c +1
-1@@ -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;
Quoted 9 lines
Quoted 3 lines
makedumpfile.c +0
-0break ;Signature · 1 line
1.7.1_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Hi Wen,
Quoted 9 lines · Wen Congyang
At 11/24/2011 01:20 PM, Atsushi Kumagai Write:
Quoted 4 lines
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
Quoted 46 lines
Thanks
Wen CongyangQuoted 31 lines
Thanks
KumagaiQuoted 23 lines · On Wed, 23 Nov 2011 13:53:51 +0800 Wen Congyang <[email protected]> wrote:
The pfn region in a mmd is [
mmd->pfn_start,mmd->pfn_end). So the max index should bemmd->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 <[email protected]>--- makedumpfile.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)makedumpfile.c +1
-1@@ -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;Quoted 9 lines
Quoted 3 lines
makedumpfile.c +0
-0break ;Signature · 1 line
1.7.1_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 4 lines
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
At 12/13/2011 08:21 AM, [email protected] Write:
Quoted 9 lines
Hi Wen,
Quoted 6 lines · Wen Congyang
At 11/24/2011 01:20 PM, Atsushi Kumagai Write:
Quoted 4 lines
Hi Wen,
Thank you for the patch.
I will check it.
Quoted 8 lines
Quoted 3 lines
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
Quoted 56 lines
Thanks
tachibanaQuoted 50 lines
Thanks
Wen CongyangQuoted 31 lines
Thanks
KumagaiQuoted 23 lines · On Wed, 23 Nov 2011 13:53:51 +0800 Wen Congyang <[email protected]> wrote:
The pfn region in a mmd is [
mmd->pfn_start,mmd->pfn_end). So the max index should bemmd->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 <[email protected]>--- makedumpfile.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)makedumpfile.c +1
-1@@ -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;Quoted 9 lines
Quoted 3 lines
makedumpfile.c +0
-0break ;Signature · 1 line
1.7.1_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec