[PATCH libaio 26/28] harness: Fix PROT_WRITE mmap check
authorGuillem Jover <guillem@hadrons.org>
Wed, 14 Aug 2019 02:42:42 +0000 (04:42 +0200)
committerGuillem Jover <guillem@debian.org>
Thu, 11 Nov 2021 03:56:01 +0000 (03:56 +0000)
commit8c2fbcc4e534649b2e6075b80ba460e0f68a9733
tree6ff23b2686fa7e0ccfb44652fcd75e1bd531f7a8
parent5a1c25eb8e1ecdf53d36d85a66140215bf0364c2
[PATCH libaio 26/28] harness: Fix PROT_WRITE mmap check

This partially reverts commit d7f5065448efb49b2a26e728ff735e12ea05b62e.

The actual problem in the original code was that read() was being used
to assert whether the buffer was readable, but the kernel was instead
reading from the file descriptor and then writing into the buffer, so
no EFAULT was being generated (on architectures that do so).

We needed to use a write() so that the kernel would read from the
buffer.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0026-harness-Fix-PROT_WRITE-mmap-check.patch
harness/cases/5.t