Author: markj Date: Wed Jan 23 17:36:58 2019 New Revision: 343350 URL: https://svnweb.freebsd.org/changeset/base/343350
Log: MFC r343265: hwpmc: Plug memory disclosures from PMC_OP_{GETPMCINFO,GETCPUINFO}. admbugs: 765 Modified: stable/12/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/12/sys/dev/hwpmc/hwpmc_mod.c Wed Jan 23 17:34:01 2019 (r343349) +++ stable/12/sys/dev/hwpmc/hwpmc_mod.c Wed Jan 23 17:36:58 2019 (r343350) @@ -3512,6 +3512,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_a struct pmc_classdep *pcd; int cl; + memset(&gci, 0, sizeof(gci)); gci.pm_cputype = md->pmd_cputype; gci.pm_ncpu = pmc_cpu_max(); gci.pm_npmc = md->pmd_npmc; @@ -3661,7 +3662,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_a npmc = md->pmd_npmc; pmcinfo_size = npmc * sizeof(struct pmc_info); - pmcinfo = malloc(pmcinfo_size, M_PMC, M_WAITOK); + pmcinfo = malloc(pmcinfo_size, M_PMC, M_WAITOK | M_ZERO); p = pmcinfo; _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"