Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jan 2018 12:01:33 +0000 (UTC)
From:      Wojciech Macek <wma@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r328325 - head/sys/powerpc/powerpc
Message-ID:  <201801241201.w0OC1X9R087638@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <pdk@semihalf.com>
  Submitted by:          Wojciech Macek <wma@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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801241201.w0OC1X9R087638>