x86/mm: Fix infinite loop in get_spage_pages()
PATCH 1/1 x86/mm: Fix infinite loop in get_spage_pages()
c/s 2b8eb37 switched int i to being unsigned, but the undo logic on failure relied in i being signed. As i being unsigned in still preforable, adjust the undo logic to work with an unsigned i.
Coverity-ID: 1413017
---
CC: Jan Beulich <[email protected]>
--- xen/arch/x86/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/mm.c +1 -1
@@ -2687,7 +2687,7 @@ static int get_spage_pages(struct page_info *page, struct domain *d) {if ( !get_page_and_type (page, d, PGT_writable_page) ) { -while ( --i >=0 ) +while ( i-- >0 )put_page_and_type (--page);return 0 ; }
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 8 lines · Andrew Cooper
c/s 2b8eb37 switched int i to being unsigned, but the undo logic on failure
relied in i being signed. As i being unsigned in still preforable, adjust the
undo logic to work with an unsigned i.Coverity-ID: 1413017
Signed-off-by Andrew Cooper <[email protected]>
But I think Wei posted a similar one earlier?
Quoted 19 lines
---
CC: Jan Beulich <[email protected]>
---xen/arch/x86/mm.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)xen/arch/x86/mm.c +1
-1@@ -2687,7 +2687,7 @@ static int get_spage_pages(struct page_info *page, struct domain *d) {if ( !get_page_and_type (page, d, PGT_writable_page) ) { -while ( --i >=0 ) +while ( i-- >0 )put_page_and_type (--page);return 0 ;
Quoted 9 lines
}Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Thanks!
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 6 lines · Andrew Cooper
c/s 2b8eb37 switched int i to being unsigned, but the undo logic on failure relied in i being signed. As i being unsigned in still preforable, adjust the undo logic to work with an unsigned i.
Coverity-ID: 1413017
Signed-off-by Andrew Cooper <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Andrew Cooper <[email protected]> 06/26/17 1:59 PM >>>
c/s 2b8eb37 switched int i to being unsigned, but the undo logic on failure relied in i being signed. As i being unsigned in still preforable, adjust the undo logic to work with an unsigned i.
Coverity-ID: 1413017
Signed-off-by Andrew Cooper <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel