[PATCH xserver] Xext/shm: Refuse to work for remote clients

Alexander Volkov a.volkov at rusbitech.ru
Mon Jun 4 13:47:30 UTC 2018


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 <a.volkov at rusbitech.ru>
---
 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



More information about the xorg-devel mailing list