Re: [PATCH] xenpm: sanitize allocations in show_cpufreq_para_by_cpuid()

2025-04-05 Thread Jason Andryuk
On 2025-03-25 10:30, Jan Beulich wrote: On 25.03.2025 15:20, Andrew Cooper wrote: On 25/03/2025 12:51 pm, Jan Beulich wrote: malloc(), when passed zero size, may return NULL (the behavior is implementation defined). More importantly, this is the Musl behaviour, so is how ~most of Gitlab CI be

Re: [PATCH] xenpm: sanitize allocations in show_cpufreq_para_by_cpuid()

2025-03-25 Thread Jan Beulich
On 25.03.2025 15:30, Jan Beulich wrote: > On 25.03.2025 15:20, Andrew Cooper wrote: >> On 25/03/2025 12:51 pm, Jan Beulich wrote: >>> malloc(), when passed zero size, may return NULL (the behavior is >>> implementation defined). >> >> More importantly, this is the Musl behaviour, so is how ~most of

Re: [PATCH] xenpm: sanitize allocations in show_cpufreq_para_by_cpuid()

2025-03-25 Thread Jan Beulich
On 25.03.2025 15:20, Andrew Cooper wrote: > On 25/03/2025 12:51 pm, Jan Beulich wrote: >> malloc(), when passed zero size, may return NULL (the behavior is >> implementation defined). > > More importantly, this is the Musl behaviour, so is how ~most of Gitlab > CI behaves. > >> Extend the ->gov_

Re: [PATCH] xenpm: sanitize allocations in show_cpufreq_para_by_cpuid()

2025-03-25 Thread Andrew Cooper
On 25/03/2025 12:51 pm, Jan Beulich wrote: > malloc(), when passed zero size, may return NULL (the behavior is > implementation defined). More importantly, this is the Musl behaviour, so is how ~most of Gitlab CI behaves. > Extend the ->gov_num check to the other two > allocations as well. I'm

[PATCH] xenpm: sanitize allocations in show_cpufreq_para_by_cpuid()

2025-03-25 Thread Jan Beulich
malloc(), when passed zero size, may return NULL (the behavior is implementation defined). Extend the ->gov_num check to the other two allocations as well. Don't chance then actually using a NULL in print_cpufreq_para(). Fixes: 75e06d089d48 ("xenpm: add cpu frequency control interface, through whi