|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH V2] xen/memory: Make resource_max_frames() to return 0 on unknown type
On 17.02.25 15:52, Andrew Cooper wrote: Hello On 17/02/2025 1:11 pm, Oleksandr Tyshchenko wrote:On 17.02.25 13:09, Andrew Cooper wrote: Hello AndrewOn 17/02/2025 10:27 am, Oleksandr Tyshchenko wrote:From: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx> This is actually what the caller acquire_resource() expects on any kind of error (the comment on top of resource_max_frames() also suggests that).:( So it broke somewhere between v3 and v8 of the original patch series, but I can't seem to find the intervening series on lore. Given the comment, I suspect I got inadvertently-reviewed into this bug.Otherwise, the caller will treat -errno as a valid value and propagate incorrect nr_frames to the VM. As a possible consequence, a VM trying to query a resource size of an unknown type will get the success result from the hypercall and obtain nr_frames 4294967201.This is one of the few interfaces we have low level testing for. tools/tests/resource/test-resource.cyesPlease could you add a step looking for an invalid resource id and check you get 0 back?Sure. I was thinking where to add this step and propose the following change. I will send a formal patch once I find a way how to easily test this change.https://lore.kernel.org/xen-devel/cover.36ee649a8537af1a5fb5b3c5b7ffc0d8a1369969.1739496480.git-series.marmarek@xxxxxxxxxxxxxxxxxxxxxx wires these tests up in Gitlab CI. thanks for the pointer.I didn't manage to run as is. But I managed to craft something suitable for running just test-resource based on these patches.
Thanks for the preliminary review, I agree with the comments. I will send a patch for the test-resource soon. ~Andrew
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |