[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, 24 Dec 2020 14:41:17 +0000 (14:41 +0000)
commitaf822422b67a634baf1edc286f67470663f9db0d
tree9fe739dec065d7bf662686595e4a133198a9efd4
parent74b53ae16d153b9637ef8360366f8f8f6c5b6837
[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