Author: wma
Date: Wed Jan 24 12:01:32 2018
New Revision: 328325
URL: https://svnweb.freebsd.org/changeset/base/328325

Log:
  PPC: Add KASSERT in intrcnt_add which checks for buffer overflow
  
  Authored by:           Patryk Duda <p...@semihalf.com>
  Submitted by:          Wojciech Macek <w...@semihalf.com>
  Obtained from:         Semihalf
  Sponsored by:          IBM, QCM Technologies

Modified:
  head/sys/powerpc/powerpc/intr_machdep.c

Modified: head/sys/powerpc/powerpc/intr_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/intr_machdep.c     Wed Jan 24 11:03:18 2018        
(r328324)
+++ head/sys/powerpc/powerpc/intr_machdep.c     Wed Jan 24 12:01:32 2018        
(r328325)
@@ -178,6 +178,8 @@ intrcnt_add(const char *name, u_long **countp)
        int idx;
 
        idx = atomic_fetchadd_int(&intrcnt_index, 1);
+       KASSERT(idx < INTR_VECTORS, ("intrcnt_add: Interrupt counter index "
+           "reached INTR_VECTORS"));
        *countp = &intrcnt[idx];
        intrcnt_setname(name, idx);
 }
_______________________________________________
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