Date: Wed, 25 Nov 2015 07:14:59 +0000 (UTC) From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291291 - head/sys/kern Message-ID: <201511250714.tAP7Ex5i085397@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ae Date: Wed Nov 25 07:14:58 2015 New Revision: 291291 URL: https://svnweb.freebsd.org/changeset/base/291291 Log: Check that hhk_helper pointer isn't NULL before access. It isn't forbidden to use NULL pointer for hook_helper in hookinfo structure when hhook_add_hook() adds new helper hook. Modified: head/sys/kern/kern_hhook.c Modified: head/sys/kern/kern_hhook.c ============================================================================== --- head/sys/kern/kern_hhook.c Wed Nov 25 04:13:28 2015 (r291290) +++ head/sys/kern/kern_hhook.c Wed Nov 25 07:14:58 2015 (r291291) @@ -101,7 +101,8 @@ hhook_run_hooks(struct hhook_head *hhh, HHH_RLOCK(hhh, &rmpt); STAILQ_FOREACH(hhk, &hhh->hhh_hooks, hhk_next) { - if (hhk->hhk_helper->h_flags & HELPER_NEEDS_OSD) { + if (hhk->hhk_helper != NULL && + hhk->hhk_helper->h_flags & HELPER_NEEDS_OSD) { hdata = osd_get(OSD_KHELP, hosd, hhk->hhk_helper->h_id); if (hdata == NULL) continue;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511250714.tAP7Ex5i085397>