Re: [PATCH] x86/pmstat: Check size of PMSTAT_get_pxstat buffers

2025-05-12 Thread Jan Beulich
On 07.05.2025 16:37, Ross Lagerwall wrote: > On Thu, Apr 17, 2025 at 2:23 PM Jan Beulich wrote: >> >> On 17.04.2025 12:30, Ross Lagerwall wrote: >>> --- a/xen/drivers/acpi/pmstat.c >>> +++ b/xen/drivers/acpi/pmstat.c >>> @@ -104,6 +104,14 @@ int do_get_pm_info(struct xen_sysctl_get_pmstat *op) >>>

Re: [PATCH] x86/pmstat: Check size of PMSTAT_get_pxstat buffers

2025-05-07 Thread Ross Lagerwall
On Thu, Apr 17, 2025 at 2:23 PM Jan Beulich wrote: > > On 17.04.2025 12:30, Ross Lagerwall wrote: > > --- a/xen/drivers/acpi/pmstat.c > > +++ b/xen/drivers/acpi/pmstat.c > > @@ -104,6 +104,14 @@ int do_get_pm_info(struct xen_sysctl_get_pmstat *op) > > cpufreq_residency_update(op->cpuid, p

Re: [PATCH] x86/pmstat: Check size of PMSTAT_get_pxstat buffers

2025-04-18 Thread Jan Beulich
On 17.04.2025 12:30, Ross Lagerwall wrote: > --- a/xen/drivers/acpi/pmstat.c > +++ b/xen/drivers/acpi/pmstat.c > @@ -104,6 +104,14 @@ int do_get_pm_info(struct xen_sysctl_get_pmstat *op) > cpufreq_residency_update(op->cpuid, pxpt->u.cur); > > ct = pmpt->perf.state_count; > + > +

[PATCH] x86/pmstat: Check size of PMSTAT_get_pxstat buffers

2025-04-17 Thread Ross Lagerwall
Check that the total number of states passed in and hence the size of buffers is sufficient to avoid writing more than the caller has allocated. The interface is not explicit about whether getpx.total is expected to be set by the caller in this case but since it is always set in libxenctrl it seem