intel / numatop

NumaTOP is an observation tool for runtime memory locality characterization and analysis of processes and threads running on a NUMA system.
BSD 3-Clause "New" or "Revised" License
197 stars 47 forks source link

function ll_init() is not initializing some fields in cfg #59

Open ColinIanKing opened 4 years ago

ColinIanKing commented 4 years ago

In common/os/os_perf.c function ll_init() is declaring cfg on the stack and then assigning conf from some uninitialized fields in cfg namely:

 839        conf->type = cfg.type;
 840        conf->config = (cfg.config) | (cfg.other_attr << 16);
 841        conf->config1 = cfg.extra_value;

Should cfg be memset before calling plat_ll_config?

ColinIanKing commented 4 years ago

Same kind of issue in profiling_init too with cfg fields:

 805        for (i = 0; i < PERF_COUNT_NUM; i++) {
 806                plat_profiling_config(i, &cfg);
 807                conf_arr[i].perf_count_id = i;
 808                conf_arr[i].type = cfg.type;