[PATCH] server: Add API to protect access to an SHM buffer

Neil Roberts neil at linux.intel.com
Tue Oct 1 05:50:56 PDT 2013


Hi

José Bollo <jobol at nonadev.net> writes:

> That is a really interesting point.
> I have two questions about it:
>  - Is it normal that the client trucates the buffer? Is your patch
>    designed to allow normal operations? or to allow forbiden uses?
>  - If it is not "normal", is there good reasons to continue to 
>    serve a nasty client?

No, it's not normal that the client would truncate the buffer. The patch
is effectively designed to disallow this and recover gracefully instead
of making the compositor crash. It won't continue to serve the client
but instead it will send it an error. The problem with truncating is
probably only an issue if there are malicious clients. However the case
where the client sends the wrong size to wl_shm.create_pool would be
worth guarding against in any case because it would be quite easy for a
buggy client to get that wrong and the compositor should really be
robust against that.

Regards,
- Neil
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


More information about the wayland-devel mailing list