[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>
Tue, 2 Nov 2021 23:56:45 +0000 (23:56 +0000)
commite8edf1e09e20733e0b63ac81ba49317e49170022
treebf6fc117a139b700ae416fbac1b071632fc0fa7e
parenta6977e380661ce1b4477a5efed5b61003e5648ac
[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