Re: [LTP] [PATCH v2] security/dirtyc0w_shmem: Add new test for CVE-2022-2590

Petr Vorel
2022-11-25T10:39:33Z

Hi Martin, David,

> On 23. 11. 22 11:35, David Hildenbrand wrote:
> > + uffdio_api.api = UFFD_API;
> > + uffdio_api.features = UFFD_FEATURE_MINOR_SHMEM;
> > + TEST(ioctl(uffd, UFFDIO_API, &uffdio_api));
> > + if (TST_RET < 0) {

> One more thing, checking just the ioctl() return value here is not enough.
> You need to check that uffdio_api.features still includes the
> UFFD_FEATURE_MINOR_SHMEM flag after the call. PPC64 does not seem to support
> it on kernel 5.14 and the ioctl() still succeeds there.
Very good catch, thanks!

David, please send official patch (speedups merging). Thanks a lot!

Kind regards,
Petr