xserver-multidpi/os
Keith Packard 41da295eb5 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
2013-11-11 15:16:07 -08:00
..
.gitignore dix and os: gitignore dix.O and os.O 2011-09-23 17:14:47 -07:00
access.c os: move <arpa/inet.h> for any !win32 system 2013-10-05 15:26:55 +02:00
auth.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
backtrace.c os: use a constant for backtrace array size 2013-11-01 09:39:53 +10:00
busfault.c Trap SIGBUS to handle truncated shared memory segments 2013-11-11 15:16:07 -08:00
client.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
connection.c Clean up a couple of warnings in os/ 2013-10-31 16:58:12 -07:00
io.c Add support for MIT-SHM AttachFd request 2013-10-31 16:58:28 -07:00
log.c os: Remove any old logfile before trying to write to it 2013-07-11 07:39:03 +10:00
Makefile.am Trap SIGBUS to handle truncated shared memory segments 2013-11-11 15:16:07 -08:00
mitauth.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
oscolor.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
osdep.h os: Hide the Connection{In,Out}put implementation details 2012-09-20 14:40:18 -04:00
osinit.c Trap SIGBUS to handle truncated shared memory segments 2013-11-11 15:16:07 -08:00
rpcauth.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strcasecmp.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strcasestr.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strlcat.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strlcpy.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strndup.c os: Ensure <dix-config.h> is included in strndup.c 2013-02-14 09:20:46 -08:00
utils.c os: Actually use the computed clockid in GetTimeInMicros 2013-11-05 08:06:09 -08:00
WaitFor.c Trap SIGBUS to handle truncated shared memory segments 2013-11-11 15:16:07 -08:00
xdmauth.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xdmcp.c dix: provide accessor methods for the last device event time 2013-10-18 16:44:32 +10:00
xprintf.c os/xprintf: add Xvscnprintf and Xscnprintf 2012-05-03 14:59:23 +10:00
xsha1.c os: Add libnettle as a choice of SHA1 implementation 2012-11-05 13:34:18 -06:00
xstrans.c Clean up a couple of warnings in os/ 2013-10-31 16:58:12 -07:00