Skip to content

Commit

Permalink
MFC r343265:
Browse files Browse the repository at this point in the history
hwpmc: Plug memory disclosures from PMC_OP_{GETPMCINFO,GETCPUINFO}.

admbugs:	765
  • Loading branch information
markjdb committed Jan 23, 2019
1 parent c69e471 commit d5dd66e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sys/dev/hwpmc/hwpmc_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -3512,6 +3512,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_args)
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;
Expand Down Expand Up @@ -3661,7 +3662,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_args)
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;

Expand Down

0 comments on commit d5dd66e

Please sign in to comment.