[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] x86/pmstat: correct PMSTAT_get_pxstat buffer size checking
On Mon, Jun 16, 2025 at 1:00 PM Jan Beulich <jbeulich@xxxxxxxx> wrote: > > min(pmpt->perf.state_count, op->u.getpx.total) == op->u.getpx.total can > be expressed differently as pmpt->perf.state_count >= op->u.getpx.total. > Copying when the two are equal is fine; (partial) copying when the state > count is larger than the number of array elements that a buffer was > allocated to hold is what - as per the comment - we mean to avoid. Drop > the use of min() again, but retain its effect for the subsequent copying > from pxpt->u.pt. > > Fixes: aa70996a6896 ("x86/pmstat: Check size of PMSTAT_get_pxstat buffers") > Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> > Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> > Reviewed-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx> Thanks, Ross
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |