tools/libxc: Don't leak foreign mappings when loading modules
PATCH 1/2 tools/libxc: Don't leak foreign mappings when loading modules
Spotted by Coverity
---
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Boris Ostrovsky <[email protected]>
--- tools/libxc/xc_dom_core.c | 1 + 1 file changed, 1 insertion(+)
tools/libxc/xc_dom_core.c +1 -0
@@ -1119,6 +1119,7 @@ static int xc_dom_load_acpi(struct xc_dom_image *dom) }memcpy (ptr, dom->acpi_modules[i].data, dom->acpi_modules[i].length); +munmap (ptr,XC_PAGE_SIZE * num_pages);free (extents); i++;
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
PATCH 2/2 x86/emulate: Resolve MISSING_BREAK issue in x86_decode()
Coverity doesn't appear to be able to spot that this is a terminal error path, but leave a comment to "fix" MISSING_BREAK.
---
CC: Jan Beulich <[email protected]>
This issue is newly exposed since splitting x86_decode() away from x86_emulate(). I seem to recall that Coverity has an upper bound of paths-per-function which it will tolerate (to avoid infinite loops), and the split allows double the exploration space.
--- xen/arch/x86/x86_emulate/x86_emulate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/x86_emulate/x86_emulate.c +1 -1
@@ -1891,7 +1891,7 @@ x86_decode(switch ( def_ad_bytes ) {default : -BUG (); +BUG ();/* Shouldn't be possible. */ case 2 :if (in_realmode (ctxt, ops) || (state->regs->eflags &EFLG_VM ) )break ;
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH 2/2] x86/emulate: Resolve MISSING_BREAK issue in x86_decode()
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 30.09.16 at 12:01, <[email protected]> wrote:
Coverity doesn't appear to be able to spot that this is a terminal error path, but leave a comment to "fix"
MISSING_BREAK.Signed-off-by Andrew Cooper <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH 2/2] x86/emulate: Resolve MISSING_BREAK issue in x86_decode()
Quoted 8 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 30.09.16 at 12:01, <[email protected]> wrote:
Coverity doesn't appear to be able to spot that this is a terminal error path, but leave a comment to "fix"
MISSING_BREAK.Signed-off-by Andrew Cooper <[email protected]>Acked-by Jan Beulich <[email protected]>
Series pushed.
Quoted 5 lines
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 3 lines · Andrew Cooper
Spotted by Coverity
Signed-off-by Andrew Cooper <[email protected]>
Quoted 23 lines
---
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Boris Ostrovsky <[email protected]>--- tools/libxc/xc_dom_core.c | 1 + 1 file changed, 1 insertion(+)tools/libxc/xc_dom_core.c +1
-0@@ -1119,6 +1119,7 @@ static int xc_dom_load_acpi(struct xc_dom_image *dom) }memcpy (ptr, dom->acpi_modules[i].data, dom->acpi_modules[i].length); +munmap (ptr,XC_PAGE_SIZE * num_pages);free (extents); i++;Signature · 1 line
2.1.4
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel