diff options
| author | Alex Richardson <Alexander.Richardson@cl.cam.ac.uk> | 2021-03-18 10:45:50 +0000 |
|---|---|---|
| committer | Simon Ser <contact@emersion.fr> | 2021-04-15 07:34:53 +0000 |
| commit | e88193492771f6d3c9f6d9d7b9b2b21b1a04e92d (patch) | |
| tree | 07fb2ca42ea1cb0bd23e733c8bf5d15e58e56eaf /tests/cpp-compile-test.cpp | |
| parent | meson: Only require expat when building wayland-scanner (diff) | |
| download | wayland-e88193492771f6d3c9f6d9d7b9b2b21b1a04e92d.tar wayland-e88193492771f6d3c9f6d9d7b9b2b21b1a04e92d.tar.gz wayland-e88193492771f6d3c9f6d9d7b9b2b21b1a04e92d.tar.bz2 wayland-e88193492771f6d3c9f6d9d7b9b2b21b1a04e92d.tar.lz wayland-e88193492771f6d3c9f6d9d7b9b2b21b1a04e92d.tar.xz wayland-e88193492771f6d3c9f6d9d7b9b2b21b1a04e92d.tar.zst wayland-e88193492771f6d3c9f6d9d7b9b2b21b1a04e92d.zip | |
os-wrappers-test.c: Correctly forward arguments to fcntl
We can't just unconditionally read the optional arguments (and also read
it as a void* despite actually being an int).
While this happens to work on most architectures because the first few
variadic arguments are passed in registers, this is non-portable and
causes a crash on architectures that set bounds on variadic function
arguments (for example CHERI-enabled architectures). It could also cause
problems on big-endian architectures that pass variadic arguments on the
stack rather than in registers.
For CHERI-MIPS, reading sizeof(void*) causes a read of 16 bytes from the
bounded varargs capability. This always crashes since even calls with the
optional argument only have 4 bytes available.
Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Reviewed-by: Simon Ser <contact@emersion.fr>
Diffstat (limited to 'tests/cpp-compile-test.cpp')
0 files changed, 0 insertions, 0 deletions
