Call shmget() with permission 0600 instead of 0777
authorBrian Paul <brianp@vmware.com>
Wed, 9 Oct 2019 18:05:16 +0000 (12:05 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 18 Nov 2019 19:28:59 +0000 (12:28 -0700)
commit02c3dad0f3b4d26e0faa5cc51d06bc50d693dcdc
tree701aeb05da830be270d1ff8a663c1dd8c991a871
parentfdaf8144a8bf65afa7dc66b8d827da38e27a850a
Call shmget() with permission 0600 instead of 0777

A security advisory (TALOS-2019-0857/CVE-2019-5068) found that
creating shared memory regions with permission mode 0777 could allow
any user to access that memory.  Several Mesa drivers use shared-
memory XImages to implement back buffers for improved performance.

This path changes the shmget() calls to use 0600 (user r/w).

Tested with legacy Xlib driver and llvmpipe.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
src/gallium/winsys/sw/dri/dri_sw_winsys.c
src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
src/mesa/drivers/x11/xm_buffer.c