svn commit: r329864 - head/sys/x86/x86
Konstantin Belousov
kib at FreeBSD.org
Fri Feb 23 11:20:59 UTC 2018
Author: kib
Date: Fri Feb 23 11:20:59 2018
New Revision: 329864
URL: https://svnweb.freebsd.org/changeset/base/329864
Log:
Do not return out of bound pointers from intr_lookup_source().
This hardens the code against driver and upper level bugs causing
invalid indexes used, e.g. on msi release.
Reported by: gallatin
Reviewed by: gallatin, hselasky
Sponsored by: Mellanox Technologies
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D14470
Modified:
head/sys/x86/x86/intr_machdep.c
Modified: head/sys/x86/x86/intr_machdep.c
==============================================================================
--- head/sys/x86/x86/intr_machdep.c Fri Feb 23 11:17:16 2018 (r329863)
+++ head/sys/x86/x86/intr_machdep.c Fri Feb 23 11:20:59 2018 (r329864)
@@ -178,6 +178,8 @@ struct intsrc *
intr_lookup_source(int vector)
{
+ if (vector < 0 || vector >= nitems(interrupt_sources))
+ return (NULL);
return (interrupt_sources[vector]);
}
More information about the svn-src-all
mailing list