[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)
committerPeter Michael Green <plugwash@raspbian.org>
Mon, 15 Nov 2021 00:13:31 +0000 (00:13 +0000)
commitc8051c075aa9e6ae368dcfc4e9221844d649f752
tree7883f562055d10e65c084709e51d0ee3d9b30952
parent1f04c5fc4fb3a6b9619534930c51a26e262dd27d
[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