summaryrefslogtreecommitdiff
path: root/os/Makefile.am
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-11-03 13:12:40 -0800
committerKeith Packard <keithp@keithp.com>2013-11-11 15:16:07 -0800
commit41da295eb50fa08eaacd0ecde99f43a716fcb41a (patch)
tree27cffe15843774f40a4f3f494952c4a86a56151d /os/Makefile.am
parent719e880d7698d92f9b854b217ef9680aaa446f2e (diff)
Trap SIGBUS to handle truncated shared memory segments
If a client passes a section of memory via file descriptor and then subsequently truncates that file, the underlying pages will be freed and the addresses invalidated. Subsequent accesses to the page will fail with a SIGBUS error. Trap that SIGBUS, figure out which segment was causing the error and then allocate new pages to fill in for that region. Mark the offending shared segment as invalid and free the resource ID so that the client will be able to tell when subsequently attempting to use the segment. Signed-off-by: Keith Packard <keithp@keithp.com> v2: Use MAP_FIXED to simplify the recovery logic (Mark Kettenis) v3: Also catch errors in ShmCreateSegment Conflicts: include/dix-config.h.in include/xorg-config.h.in
Diffstat (limited to 'os/Makefile.am')
-rw-r--r--os/Makefile.am5
1 files changed, 5 insertions, 0 deletions
diff --git a/os/Makefile.am b/os/Makefile.am
index 364b6da2d..a1bbb4d1e 100644
--- a/os/Makefile.am
+++ b/os/Makefile.am
@@ -5,6 +5,7 @@ AM_CFLAGS = $(DIX_CFLAGS) $(SHA1_CFLAGS)
SECURERPC_SRCS = rpcauth.c
XDMCP_SRCS = xdmcp.c
XORG_SRCS = log.c
+BUSFAULT_SRCS = busfault.c
libos_la_SOURCES = \
WaitFor.c \
@@ -39,6 +40,10 @@ AM_CFLAGS += $(LIBUNWIND_CFLAGS)
libos_la_LIBADD += $(LIBUNWIND_LIBS)
endif
+if BUSFAULT
+libos_la_SOURCES += $(BUSFAULT_SRCS)
+endif
+
EXTRA_DIST = $(SECURERPC_SRCS) $(XDMCP_SRCS)
if SPECIAL_DTRACE_OBJECTS