Fix: Don't assume that PROT_WRITE grants read permissions
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 22 Sep 2014 16:59:11 +0000 (12:59 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 23 Sep 2014 16:07:03 +0000 (12:07 -0400)
commitfcf104173870de4678c8f69e33039d39193c939a
tree99bd068b93294e3878e2dad7530a5ec36226d67c
parent7ff90364f5b293613e133aff5cd6ec80be9ebc18
Fix: Don't assume that PROT_WRITE grants read permissions

The prot flag passed to mmap() is set to PROT_WRITE when the O_RDWR
access flags is used. This assumes that PROT_WRITE grants read
permissions on the mmap'ed region. While this is true on x86, this
causes a segmentation fault on SPARC and, presumably, other
architectures implementing strict access permissions.

CTF Writer needs read permissions since the unaligned integer writes
may use load instructions as the value is read back to perform the
required shifting/masking is performed in the _bt_bitfield_write_*
macros.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/ctf/ctf.c
formats/lttng-live/lttng-live-comm.c
include/babeltrace/ctf/types.h
This page took 0.02504 seconds and 4 git commands to generate.