Avoid access to System V shared memory segment on the X server side
for clients forwarded via SSH. Also prevent them from hanging while
waiting for the reply from the ShmCreateSegment request.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=11080
Signed-off-by: Alexander Volkov <[email protected]>
---
 Xext/shm.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Xext/shm.c b/Xext/shm.c
index fc8441c43..41ab0e2b6 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -1302,6 +1302,10 @@ static int
 ProcShmDispatch(ClientPtr client)
 {
     REQUEST(xReq);
+
+    if (!client->local)
+        return BadRequest;
+
     switch (stuff->data) {
     case X_ShmQueryVersion:
         return ProcShmQueryVersion(client);
@@ -1461,6 +1465,10 @@ static int _X_COLD
 SProcShmDispatch(ClientPtr client)
 {
     REQUEST(xReq);
+
+    if (!client->local)
+        return BadRequest;
+
     switch (stuff->data) {
     case X_ShmQueryVersion:
         return SProcShmQueryVersion(client);
-- 
2.17.0

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to