Author: vangyzen
Date: Fri Aug 21 14:22:32 2020
New Revision: 364457
URL: https://svnweb.freebsd.org/changeset/base/364457

Log:
  amd64 pmap: potential integer overflowing expression
  
  Coverity has identified the line in this change as "Potential integer
  overflowing expression" due to the variable i declared as an int
  and used in an expression with vm_paddr_t, a 64bit variable.
  
  This change has very little effect as when this line is execute
  nkpt is small and phys_addr is a the beginning of physical memory.
  But there is no explicit protection that the above is true.
  
  Submitted by: bret_ketc...@dell.com
  Reported by:  Coverity
  Reviewed by:  markj
  MFC after:    2 weeks
  Sponsored by: Dell EMC Isilon
  Differential Revision:        https://reviews.freebsd.org/D26141

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c Fri Aug 21 13:11:33 2020        (r364456)
+++ head/sys/amd64/amd64/pmap.c Fri Aug 21 14:22:32 2020        (r364457)
@@ -2111,7 +2111,7 @@ pmap_init(void)
                 * Collect the page table pages that were replaced by a 2MB
                 * page in create_pagetables().  They are zero filled.
                 */
-               if (i << PDRSHIFT < KERNend &&
+               if ((vm_paddr_t)i << PDRSHIFT < KERNend &&
                    pmap_insert_pt_page(kernel_pmap, mpte, false))
                        panic("pmap_init: pmap_insert_pt_page failed");
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to