On 28/07/2023 09:30, Chaitanya S Prakash wrote:
These madvise/mincore/mlock/munlock/msync testcases will indeed fail in PCuABI (and only in PCuABI), but that is purely because the length they are passed is greater than the length of addr, not because the mapping is smaller. It would be clearer to reduce the bounds of addr instead of passing a length that is larger than the mapping. Also, given that the tests are the same regardless of the particular syscall, it would be good to refactor them to reduce duplication.
I'll change the tests accordingly. As of now I'm having one positive and one negative case for each of the above mentioned syscalls, are you referring to duplication in terms of the method of testing?
Yes, as far as I can tell they are all the same except for the syscall they make.
I'm only testing for this condition: CapabilityOwnsRange(addr, addr.address, len) does not hold, then the call fails with -EINVAL
As I can't increase the bounds of the capability, I would only be able to test this condition by reducing the bounds, right? Wouldn't that inevitably lead to the testcases being quite similar?
I'm not sure I understand the point, as the testcases are already the same. In terms of bounds, what that condition ensures is that the requested range falls within the capability bounds, so if we want to check the failure case it makes sense to shrink the capability bounds.
Kevin