summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Linhart <chris@demorecorder.com>2015-09-13 15:45:15 +0200
committerChristian Linhart <chris@demorecorder.com>2015-10-26 17:35:16 +0100
commitf4348694c939f83e7135df4779d1bd138836c4db (patch)
tree3142b74b2a8a3c195cadbbe3536c333f2d5d83e8
parent1601efa74cf128ac53cb507cc0392d7554f25c1a (diff)
xselinux: add explicit padding for struc "ListItem"
This is needed so that subsequent list-items in a list are aligned to 4 bytes which is necessary because ListItem contains 32-bit values of types ATOM and CARD32. (Actually, only the final align-pad is needed for that.) The xserver makes sure that the length of both char-lists is a multiple of 4: http://cgit.freedesktop.org/xorg/xserver/tree/Xext/xselinux_ext.c?id=xorg-server-1.17.99.901#n360 So, instead of a explicit padding we could add something like an assertion or precondition that the fields "object_context_len" and "data_context_len" have to be a multiple of 4. Unfortunately I couldn't find a protocol specification of the xselinux extension, to see whether the multiple of 4 is mandated by the protocol spec or whether there should be align-pads. (and whether there should be an align pad between "object_context" and "data_context" Does anybody know where the spec for the xselinux protocol is? There ought to be a spec somewhere for this because this is security relevant. Signed-off-by: Christian Linhart <chris@demorecorder.com> Reviewed-by: Peter Harris <pharris@opentext.com>
-rw-r--r--src/xselinux.xml2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/xselinux.xml b/src/xselinux.xml
index 7751470..a97a146 100644
--- a/src/xselinux.xml
+++ b/src/xselinux.xml
@@ -111,9 +111,11 @@ authorization from the authors.
<list type="char" name="object_context">
<fieldref>object_context_len</fieldref>
</list>
+ <pad align="4" />
<list type="char" name="data_context">
<fieldref>data_context_len</fieldref>
</list>
+ <pad align="4" />
</struct>
<request name="SetPropertyCreateContext" opcode="8">