Re: [PATCH 08/10] Add support for MIT-SHM AttachFd request

2013-11-03 Thread Keith Packard
Kristian Høgsberg k...@bitplanet.net writes: Just so we're clear, what I'm saying above is that this request can be trivially exploited by any client to crash the X server with SIGBUS. I've posted a patch to the list which catches SIGBUS, maps new memory over the old region, tracks down the

Re: [PATCH 08/10] Add support for MIT-SHM AttachFd request

2013-11-02 Thread Keith Packard
Mark Kettenis mark.kette...@xs4all.nl writes: Might make sense to use shm_mkstemp() here, but it seems that's an OpenBSD-ism even though Debian has a bug report for it long before we added it ;). I'd love to use a simpler API for this; if your kernel supports one, patches are welcome. --

Re: [PATCH 08/10] Add support for MIT-SHM AttachFd request

2013-11-01 Thread Kristian Høgsberg
On Fri, Nov 1, 2013 at 12:37 AM, Keith Packard kei...@keithp.com wrote: Kristian Høgsberg k...@bitplanet.net writes: On Thu, Oct 31, 2013 at 3:43 PM, Keith Packard kei...@keithp.com wrote: This passes a file descriptor from the client to the server, which is then mmap'd A problem we

Re: [PATCH 08/10] Add support for MIT-SHM AttachFd request

2013-11-01 Thread Keith Packard
Kristian Høgsberg k...@bitplanet.net writes: Just so we're clear, what I'm saying above is that this request can be trivially exploited by any client to crash the X server with SIGBUS. Yup, that's clear enough. -- keith.pack...@intel.com pgp60dUX4jgwZ.pgp Description: PGP signature

Re: [PATCH 08/10] Add support for MIT-SHM AttachFd request

2013-11-01 Thread Mark Kettenis
From: Keith Packard kei...@keithp.com Date: Thu, 31 Oct 2013 15:43:40 -0700 This passes a file descriptor from the client to the server, which is then mmap'd +static int +ProcShmCreateSegment(ClientPtr client) +{ +int fd; +ShmDescPtr shmdesc; +

[PATCH 08/10] Add support for MIT-SHM AttachFd request

2013-10-31 Thread Keith Packard
This passes a file descriptor from the client to the server, which is then mmap'd Signed-off-by: Keith Packard kei...@keithp.com --- Xext/shm.c| 159 -- Xext/shmint.h | 1 + include/os.h | 2 + os/io.c | 8 +++ 4 files

Re: [PATCH 08/10] Add support for MIT-SHM AttachFd request

2013-10-31 Thread Kristian Høgsberg
On Thu, Oct 31, 2013 at 3:43 PM, Keith Packard kei...@keithp.com wrote: This passes a file descriptor from the client to the server, which is then mmap'd A problem we recently hit in wayland, which also affects this extension is that a client can set up shared memory like this and the truncate