Xext/shm: Refuse to work for remote clients
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.
v2: Allow ShmQueryVersion request even for remote clients
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=11080
Signed-off-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit ec7e2b54c5
)
This commit is contained in:
parent
9e417072bc
commit
d7220428da
18
Xext/shm.c
18
Xext/shm.c
|
@ -1302,9 +1302,14 @@ static int
|
||||||
ProcShmDispatch(ClientPtr client)
|
ProcShmDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
switch (stuff->data) {
|
|
||||||
case X_ShmQueryVersion:
|
if (stuff->data == X_ShmQueryVersion)
|
||||||
return ProcShmQueryVersion(client);
|
return ProcShmQueryVersion(client);
|
||||||
|
|
||||||
|
if (!client->local)
|
||||||
|
return BadRequest;
|
||||||
|
|
||||||
|
switch (stuff->data) {
|
||||||
case X_ShmAttach:
|
case X_ShmAttach:
|
||||||
return ProcShmAttach(client);
|
return ProcShmAttach(client);
|
||||||
case X_ShmDetach:
|
case X_ShmDetach:
|
||||||
|
@ -1461,9 +1466,14 @@ static int _X_COLD
|
||||||
SProcShmDispatch(ClientPtr client)
|
SProcShmDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
switch (stuff->data) {
|
|
||||||
case X_ShmQueryVersion:
|
if (stuff->data == X_ShmQueryVersion)
|
||||||
return SProcShmQueryVersion(client);
|
return SProcShmQueryVersion(client);
|
||||||
|
|
||||||
|
if (!client->local)
|
||||||
|
return BadRequest;
|
||||||
|
|
||||||
|
switch (stuff->data) {
|
||||||
case X_ShmAttach:
|
case X_ShmAttach:
|
||||||
return SProcShmAttach(client);
|
return SProcShmAttach(client);
|
||||||
case X_ShmDetach:
|
case X_ShmDetach:
|
||||||
|
|
Loading…
Reference in New Issue