x86/mm: Fix Coverity issues 1373105 and 1373106
PATCH 1/1 x86/mm: Fix Coverity issues 1373105 and 1373106
Added missing error checks in p2m_set_mem_access_multi().
--- xen/arch/x86/mm/p2m.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
xen/arch/x86/mm/p2m.c +6 -2
@@ -1936,8 +1936,12 @@ long p2m_set_mem_access_multi(struct domain *d,uint8_t access;uint64_t gfn_l; -copy_from_guest_offset (&gfn_l, pfn_list, start,1 ); -copy_from_guest_offset (&access, access_list, start,1 ); +if (copy_from_guest_offset (&gfn_l, pfn_list, start,1 ) || +copy_from_guest_offset (&access, access_list, start,1 ) ) + { + rc = -EINVAL ; +break ; + }if ( !xenmem_access_to_p2m_access (p2m, access, &a) ) {
Signature · 7 lines
1.9.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 12 lines · Razvan Cojocaru
Added missing error checks in
p2m_set_mem_access_multi().Signed-off-by Razvan Cojocaru <[email protected]>--- xen/arch/x86/mm/p2m.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)xen/arch/x86/mm/p2m.c +0
-0
xen/arch/x86/mm/p2m.c long p2m_set_mem_access_multi(struct domain *d, · line 1943
Quoted 10 lines
xen/arch/x86/mm/p2m.c +5
-2@@ -1936,8 +1936,12 @@ long p2m_set_mem_access_multi(struct domain *d,uint8_t access;uint64_t gfn_l; -copy_from_guest_offset (&gfn_l, pfn_list, start,1 ); -copy_from_guest_offset (&access, access_list, start,1 ); +if (copy_from_guest_offset (&gfn_l, pfn_list, start,1 ) || +copy_from_guest_offset (&access, access_list, start,1 ) ) + { + rc = -EINVAL ; +break ;
There seems to have been an accident here with a TAB getting inserted instead of spaces. If it can't be fixed on commit I'll resend.
Thanks,
Razvan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
xen/arch/x86/mm/p2m.c long p2m_set_mem_access_multi(struct domain *d, · line 1942
Quoted 13 lines
Quoted 1 line
Quoted 1 line · On 21.09.16 at 14:25, <[email protected]> wrote:
xen/arch/x86/mm/p2m.c +4
-2@@ -1936,8 +1936,12 @@ long p2m_set_mem_access_multi(struct domain *d,uint8_t access;uint64_t gfn_l; -copy_from_guest_offset (&gfn_l, pfn_list, start,1 ); -copy_from_guest_offset (&access, access_list, start,1 ); +if (copy_from_guest_offset (&gfn_l, pfn_list, start,1 ) || +copy_from_guest_offset (&access, access_list, start,1 ) ) + { + rc = -EINVAL ;
-EFAULT
xen/arch/x86/mm/p2m.c long p2m_set_mem_access_multi(struct domain *d, · line 1943
Quoted 1 line
xen/arch/x86/mm/p2m.c +1
-0+break ;
Bogus tab.
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel