wayland/src
Jonas Ådahl bf34ac75d0 connection: Don't add uninitialized memory as 4 byte alignment padding
When we are adding padding bytes making our wl_buffer buffer content 4
byte aligned, we are just moving the pointer. Since the buffer is
allocated using plain malloc(), this means our padding bytes are
effectively uninitialized data, which could be anything previously
allocated in the server process. As we'll be sharing this buffer
content with arbitrary clients, we are effectively sharing private
memory with every client, and even though a well behaving client will
discard any such memory, a malicious client may not.

Therefor, to avoid any potential missuse of the uninitialized padding
memory shared between the server and client, initialize the buffer
content to 0, making the padding bytes always 0.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-02-11 13:48:23 -08:00
..
.gitignore gitignore: adpat to scanner and protocol path changes 2014-11-19 16:35:49 +02:00
connection.c connection: Don't add uninitialized memory as 4 byte alignment padding 2016-02-11 13:48:23 -08:00
dtddata.S scanner: drop altmacro from dtddata.S 2015-11-19 09:48:11 +02:00
event-loop.c event-loop: remove extra header 2015-11-16 11:42:01 -08:00
scanner.c scanner: Fix oddities in copyright printing 2016-02-04 11:11:21 -08:00
scanner.mk Rename source subdir from wayland to src 2011-08-12 16:25:14 -04:00
wayland-client-core.h Track protocol object versions inside wl_proxy. 2016-01-19 13:58:50 -06:00
wayland-client-uninstalled.pc.in build: add uninstalled pkg-config files 2012-05-29 10:09:59 -04:00
wayland-client.c Track protocol object versions inside wl_proxy. 2016-01-19 13:58:50 -06:00
wayland-client.h src: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-12 15:31:24 -07:00
wayland-client.pc.in Export the Wayland protocol XML file 2013-09-21 21:48:56 -07:00
wayland-egl-core.h src: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-12 15:31:24 -07:00
wayland-egl.h src: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-12 15:31:24 -07:00
wayland-os.c src: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-12 15:31:24 -07:00
wayland-os.h src: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-12 15:31:24 -07:00
wayland-private.h server: Add an API to get the file descriptor for a client 2016-01-19 14:52:54 -08:00
wayland-scanner-uninstalled.pc.in build: Add wayland-scanner.pc. 2013-07-03 16:38:12 -04:00
wayland-scanner.pc.in build: Add wayland-scanner.pc. 2013-07-03 16:38:12 -04:00
wayland-server-core.h server: Add an API to get the file descriptor for a client 2016-01-19 14:52:54 -08:00
wayland-server-uninstalled.pc.in build: add uninstalled pkg-config files 2012-05-29 10:09:59 -04:00
wayland-server.c server: Fail to bind object when requested version is 0 2016-02-01 17:26:08 -08:00
wayland-server.h src: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-12 15:31:24 -07:00
wayland-server.pc.in Export the Wayland protocol XML file 2013-09-21 21:48:56 -07:00
wayland-shm.c cosmetic: add an space after if 2016-02-04 16:37:40 -08:00
wayland-util.c cosmetic: use tabs instead of spaces 2016-02-04 16:37:34 -08:00
wayland-util.h cosmetic: fix inconsistent code style with header prototypes. 2015-10-26 10:50:48 -07:00
wayland-version.h.in src: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-12 15:31:24 -07:00