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:04:46 +0000 (12:04 -0400)
commitc88c09f9909b46d098b677aa5fc8a1dc528580fd
tree9303ed688ad9f63fb8460504e861bdd33d95989d
parent626c7caf8bb204775147c9a29d383938e40e0239
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.024894 seconds and 4 git commands to generate.