From: Michael Jeanson Date: Wed, 15 May 2019 18:49:14 +0000 (-0400) Subject: fix: Add PROT_READ to ctfser mmap flags X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=9223d1f36459ed833b1c4ce11001846d6b1d4e9d fix: Add PROT_READ to ctfser mmap flags On Linux PROT_WRITE implies PROT_READ but on other Unices like Solaris, it's not the case. This resulted in a segfault when reading from the mapping. Signed-off-by: Michael Jeanson Change-Id: If11bbcf32e33bf5e682afaade2d3769a141c6583 Reviewed-on: https://review.lttng.org/c/babeltrace/+/1302 Reviewed-by: Jérémie Galarneau Tested-by: jenkins --- diff --git a/ctfser/ctfser.c b/ctfser/ctfser.c index e06972b9..bb9590ab 100644 --- a/ctfser/ctfser.c +++ b/ctfser/ctfser.c @@ -52,7 +52,8 @@ uint64_t get_packet_size_increment_bytes(void) static inline void mmap_align_ctfser(struct bt_ctfser *ctfser) { - ctfser->base_mma = mmap_align(ctfser->cur_packet_size_bytes, PROT_WRITE, + ctfser->base_mma = mmap_align(ctfser->cur_packet_size_bytes, + PROT_READ | PROT_WRITE, MAP_SHARED, ctfser->fd, ctfser->mmap_offset); }