[Mesa-dev] [Nine] 'meson: add -Werror=empty-body to disallow `if(x); `' - 'broke' Nine

2019-10-24 Thread Dieter Nützel

Hello Eric,

your mentioned commit (8d43e2b2ded0fe3c82d49561cdab9f208f9e64b6) broke 
building with NIne (-Dgallium-nine=true) for me.


starting with
[-]
e_st@sta/cubetexture9.c.o' -c 
../src/gallium/state_trackers/nine/cubetexture9.c
../src/gallium/state_trackers/nine/cubetexture9.c: In function 
‘NineCubeTexture9_ctor’:
../src/gallium/state_trackers/nine/cubetexture9.c:108:43: error: suggest 
braces around empty body in an ‘if’ statement [-Werror=empty-body]

  108 | "but this is unimplemented\n");
  |   ^
cc1: some warnings being treated as errors

--
Next

/surface9.c.o' -c ../src/gallium/state_trackers/nine/surface9.c
../src/gallium/state_trackers/nine/surface9.c: In function 
‘NineSurface9_GetContainer’:
../src/gallium/state_trackers/nine/surface9.c:334:40: error: suggest 
braces around empty body in an ‘if’ statement [-Werror=empty-body]

  334 | DBG("QueryInterface FAILED!\n");
  |^
cc1: some warnings being treated as errors

--

@sta/swapchain9.c.o' -c ../src/gallium/state_trackers/nine/swapchain9.c
../src/gallium/state_trackers/nine/swapchain9.c: In function ‘present’:
../src/gallium/state_trackers/nine/swapchain9.c:737:51: error: suggest 
braces around empty body in an ‘if’ statement [-Werror=empty-body]

  737 | pSourceRect->top, pSourceRect->bottom);
  |   ^
../src/gallium/state_trackers/nine/swapchain9.c:741:47: error: suggest 
braces around empty body in an ‘if’ statement [-Werror=empty-body]

  741 | pDestRect->top, pDestRect->bottom);
  |   ^
cc1: some warnings being treated as errors

--

evice9.c.o' -c ../src/gallium/state_trackers/nine/device9.c
../src/gallium/state_trackers/nine/device9.c: In function 
‘NineDevice9_ctor’:
../src/gallium/state_trackers/nine/device9.c:296:49: error: suggest 
braces around empty body in an ‘if’ statement [-Werror=empty-body]

  296 | DBG("\033[1;32mCSMT is active\033[0m\n");
  | ^
../src/gallium/state_trackers/nine/device9.c: In function 
‘create_zs_or_rt_surface’:
../src/gallium/state_trackers/nine/device9.c:1221:87: error: suggest 
braces around empty body in an ‘if’ statement [-Werror=empty-body]
 1221 |   DBG("FIXME Used shared handle! This option isn't probably 
handled correctly!\n");
  |  
 ^
../src/gallium/state_trackers/nine/device9.c: In function 
‘NineDevice9_UpdateSurface’:
../src/gallium/state_trackers/nine/device9.c:1307:53: error: suggest 
braces around empty body in an ‘if’ statement [-Werror=empty-body]

 1307 | pSourceRect->right, pSourceRect->bottom);
  | ^
../src/gallium/state_trackers/nine/device9.c:1309:68: error: suggest 
braces around empty body in an ‘if’ statement [-Werror=empty-body]
 1309 | DBG("pDestPoint = (%u,%u)\n", pDestPoint->x, 
pDestPoint->y);
  |  
  ^
../src/gallium/state_trackers/nine/device9.c: In function 
‘NineDevice9_StretchRect’:
../src/gallium/state_trackers/nine/device9.c:1588:53: error: suggest 
braces around empty body in an ‘if’ statement [-Werror=empty-body]

 1588 | pSourceRect->right, pSourceRect->bottom);
  | ^
../src/gallium/state_trackers/nine/device9.c:1591:49: error: suggest 
braces around empty body in an ‘if’ statement [-Werror=empty-body]

 1591 | pDestRect->right, pDestRect->bottom);
  | ^
../src/gallium/state_trackers/nine/device9.c: In function 
‘NineDevice9_ColorFill’:
../src/gallium/state_trackers/nine/device9.c:1786:41: error: suggest 
braces around empty body in an ‘if’ statement [-Werror=empty-body]

 1786 | pRect->right, pRect->bottom);
  | ^
../src/gallium/state_trackers/nine/device9.c: In function 
‘NineDevice9_CreateOffscreenPlainSurface’:
../src/gallium/state_trackers/nine/device9.c:1864:43: error: suggest 
braces around empty body in an ‘if’ statement [-Werror=empty-body]

 1864 | DBG("Failed to create surface.\n");
  |   ^
cc1: some warnings being treated as errors

--

st@sta/nine_shader.c.o' -c 
../src/gallium/state_trackers/nine/nine_shader.c
../src/gallium/state_trackers/nine/nine_shader.c: In function 
‘tx_dst_param_as_src’:
../src/gallium/state_trackers/nine/nine_shader.c:1437:52: error: suggest 
braces around empty body in an ‘if’ statement [-Werror=empty-body]

 1437 | WARN("mask is 0, using identity swizzle\n");
  |

--
Last

ine_ff.c.o' -c ../src/gallium/state_trackers/nine/nine_ff.c
../src/gallium/state_t

[Mesa-dev] [ANNOUNCE] mesa 19.2.2

2019-10-24 Thread Dylan Baker
Hi list,

Sorry for the slight delay in the release, my fault. I'm pleased to announce the
availability of mesa 19.2.2, the second point release in the mesa 19.2 series.
Things have started to slow down a bit, and I like that. We've had an assortment
of fixes in this release, notably a bunch of work to get Solaris and illumos
working with mesa, as well as more work fixing issues in the migration of
package-config and headers being handled by libglvnd instead of mesa when mesa
is built with support for glvnd.

There's  bunch of other changes here, with radv and intel leading the pack,
otherwise just a few things here and there.

Dylan


Shortlog


Alan Coopersmith (6):
  c99_compat.h: Don't try to use 'restrict' in C++ code
  util: Make Solaris implemention of p_atomic_add work with gcc
  util: Workaround lack of flock on Solaris
  util: Solaris has linux-style pthread_setname_np
  meson: recognize "sunos" as the system name for Solaris
  intel/common: include unistd.h for ioctl() prototype on Solaris

Alejandro Piñeiro (1):
  v3d: take into account prim_counts_offset

Bas Nieuwenhuizen (3):
  radv: Disallow sparse shared images.
  nir/dead_cf: Remove dead control flow after infinite loops.
  radv: Fix single stage constant flush with merged shaders.

Clément Guérin (1):
  radeonsi: enable zerovram for Rocket League

Connor Abbott (2):
  nir/sink: Rewrite loop handling logic
  nir/sink: Don't sink load_ubo to outside of its defining loop

Dylan Baker (3):
  docs: Add SHA256 sum for 19.2.1
  docs: Add release notes for 19.2.2
  Bump version for 19.2.2 release

Eric Engestrom (7):
  GL: drop symbols mangling support
  meson: rename `glvnd_missing_pc_files` to `not 
glvnd_has_headers_and_pc_files`
  meson: move a couple of include installs around
  meson: split headers one per line
  meson: split Mesa headers as a separate installation
  meson: skip installation of GLVND-provided headers
  util/u_atomic: fix return type of p_atomic_{inc,dec}_return() and 
p_atomic_{cmp,}xchg()

Ian Romanick (2):
  nir/search: Fix possible NULL dereference in is_fsign
  intel/vec4: Don't try both sources as immediates for DPH

James Xiong (1):
  iris: finish aux import on get_param

Kenneth Graunke (2):
  iris: Properly unreference extra VBOs for draw parameters
  iris: Implement the Gen < 9 tessellation quads workaround

Lepton Wu (1):
  egl/android: Remove our own reference to buffers.

Lionel Landwerlin (3):
  etnaviv: remove variable from global namespace
  anv: fix vkUpdateDescriptorSets with inline uniform blocks
  anv: fix memory leak on device destroy

Lucas Stach (3):
  etnaviv: fix vertex buffer state emission for single stream GPUs
  rbug: fix transmitted texture sizes
  rbug: unwrap index buffer resource

Pierre-Eric Pelloux-Prayer (1):
  mesa: fix invalid target error handling for teximage

Roland Scheidegger (1):
  gallivm: Fix saturated signed psub/padd intrinsics on llvm 8

Samuel Pitoiset (6):
  drirc: enable vk_x11_override_min_image_count for DOOM
  radv: bump minTexelBufferOffsetAlignment to 4
  radv: fix DCC fast clear code for intensity formats
  Revert "radv: do not emit PKT3_CONTEXT_CONTROL with AMDGPU 3.6.0+"
  radv: fix DCC fast clear code for intensity formats (correctly)
  radv: fix updating bound fast ds clear values with different aspects

Timothy Arceri (1):
  glsl: fix crash compiling bindless samplers inside unnamed UBOs


git tag: mesa-19.2.2

https://mesa.freedesktop.org/archive/mesa-19.2.2.tar.xz
SHA256: 7e4f0e2678bfcf3b94f533078b514f37943378a4a8604e477c888ec8a2904394  
mesa-19.2.2.tar.xz
SHA512: 
a3269052c2dfb5404180d1aebd68f5b9b0cc136d634ba89fed3f60fcc9b279072e09ee2db9b485375d39e886209053841df920c9d0b975e0de2825e3da4164a5
  mesa-19.2.2.tar.xz
PGP:  https://mesa.freedesktop.org/archive/mesa-19.2.2.tar.xz.sig



signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] Call shmget() with permission 0600 instead of 0777

2019-10-24 Thread Brian Paul
Ping.  Anyone?

-Brian

On Tue, Oct 22, 2019 at 3:52 PM Brian Paul  wrote:

> 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-sta...@lists.freedesktop.org
> ---
>  src/gallium/winsys/sw/dri/dri_sw_winsys.c   | 3 ++-
>  src/gallium/winsys/sw/xlib/xlib_sw_winsys.c | 3 ++-
>  src/mesa/drivers/x11/xm_buffer.c| 3 ++-
>  3 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/src/gallium/winsys/sw/dri/dri_sw_winsys.c
> b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
> index 761f5d1..2e5970b 100644
> --- a/src/gallium/winsys/sw/dri/dri_sw_winsys.c
> +++ b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
> @@ -92,7 +92,8 @@ alloc_shm(struct dri_sw_displaytarget *dri_sw_dt,
> unsigned size)
>  {
> char *addr;
>
> -   dri_sw_dt->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT|0777);
> +   /* 0600 = user read+write */
> +   dri_sw_dt->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT | 0600);
> if (dri_sw_dt->shmid < 0)
>return NULL;
>
> diff --git a/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
> b/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
> index c14c9de..edebb48 100644
> --- a/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
> +++ b/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
> @@ -126,7 +126,8 @@ alloc_shm(struct xlib_displaytarget *buf, unsigned
> size)
> shminfo->shmid = -1;
> shminfo->shmaddr = (char *) -1;
>
> -   shminfo->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT|0777);
> +   /* 0600 = user read+write */
> +   shminfo->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT | 0600);
> if (shminfo->shmid < 0) {
>return NULL;
> }
> diff --git a/src/mesa/drivers/x11/xm_buffer.c
> b/src/mesa/drivers/x11/xm_buffer.c
> index d945d8a..0da08a6 100644
> --- a/src/mesa/drivers/x11/xm_buffer.c
> +++ b/src/mesa/drivers/x11/xm_buffer.c
> @@ -89,8 +89,9 @@ alloc_back_shm_ximage(XMesaBuffer b, GLuint width,
> GLuint height)
>return GL_FALSE;
> }
>
> +   /* 0600 = user read+write */
> b->shminfo.shmid = shmget(IPC_PRIVATE,
> b->backxrb->ximage->bytes_per_line
> -* b->backxrb->ximage->height, IPC_CREAT|0777);
> + * b->backxrb->ximage->height, IPC_CREAT |
> 0600);
> if (b->shminfo.shmid < 0) {
>_mesa_warning(NULL, "shmget failed while allocating back
> buffer.\n");
>XDestroyImage(b->backxrb->ximage);
> --
> 1.8.5.6
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] Call shmget() with permission 0600 instead of 0777

2019-10-24 Thread Stuart Young
Not my call, but both of these went into my gmail spam folder for DMARC
failures, so a lot of people might not have seen it.

On Fri, 25 Oct 2019 at 08:25, Brian Paul  wrote:

> Ping.  Anyone?
>
> -Brian
>
> On Tue, Oct 22, 2019 at 3:52 PM Brian Paul  wrote:
>
>> 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-sta...@lists.freedesktop.org
>> ---
>>  src/gallium/winsys/sw/dri/dri_sw_winsys.c   | 3 ++-
>>  src/gallium/winsys/sw/xlib/xlib_sw_winsys.c | 3 ++-
>>  src/mesa/drivers/x11/xm_buffer.c| 3 ++-
>>  3 files changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/gallium/winsys/sw/dri/dri_sw_winsys.c
>> b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
>> index 761f5d1..2e5970b 100644
>> --- a/src/gallium/winsys/sw/dri/dri_sw_winsys.c
>> +++ b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
>> @@ -92,7 +92,8 @@ alloc_shm(struct dri_sw_displaytarget *dri_sw_dt,
>> unsigned size)
>>  {
>> char *addr;
>>
>> -   dri_sw_dt->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT|0777);
>> +   /* 0600 = user read+write */
>> +   dri_sw_dt->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT | 0600);
>> if (dri_sw_dt->shmid < 0)
>>return NULL;
>>
>> diff --git a/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
>> b/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
>> index c14c9de..edebb48 100644
>> --- a/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
>> +++ b/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
>> @@ -126,7 +126,8 @@ alloc_shm(struct xlib_displaytarget *buf, unsigned
>> size)
>> shminfo->shmid = -1;
>> shminfo->shmaddr = (char *) -1;
>>
>> -   shminfo->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT|0777);
>> +   /* 0600 = user read+write */
>> +   shminfo->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT | 0600);
>> if (shminfo->shmid < 0) {
>>return NULL;
>> }
>> diff --git a/src/mesa/drivers/x11/xm_buffer.c
>> b/src/mesa/drivers/x11/xm_buffer.c
>> index d945d8a..0da08a6 100644
>> --- a/src/mesa/drivers/x11/xm_buffer.c
>> +++ b/src/mesa/drivers/x11/xm_buffer.c
>> @@ -89,8 +89,9 @@ alloc_back_shm_ximage(XMesaBuffer b, GLuint width,
>> GLuint height)
>>return GL_FALSE;
>> }
>>
>> +   /* 0600 = user read+write */
>> b->shminfo.shmid = shmget(IPC_PRIVATE,
>> b->backxrb->ximage->bytes_per_line
>> -* b->backxrb->ximage->height,
>> IPC_CREAT|0777);
>> + * b->backxrb->ximage->height, IPC_CREAT |
>> 0600);
>> if (b->shminfo.shmid < 0) {
>>_mesa_warning(NULL, "shmget failed while allocating back
>> buffer.\n");
>>XDestroyImage(b->backxrb->ximage);
>> --
>> 1.8.5.6
>>
>> ___
>> mesa-dev mailing list
>> mesa-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev



-- 
Stuart Young (aka Cefiar)
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [Nine] 'meson: add -Werror=empty-body to disallow `if(x); `' - 'broke' Nine

2019-10-24 Thread Eric Engestrom
Indeed, Axel's solution is the right one: you can make it a `(void) something`
or `do {} while (0)` for instance.

Sorry for not catching this before landing my commit; I'll give it a look
tomorrow, tag me (@eric) if you send an MR before I get around to fixing it.


On Thursday, 2019-10-24 23:31:01 +0200, Axel Davy wrote:
> Hi Dieter,
> 
> Maybe the best fix would be to change the definition of WARN and DBG when
> DEBUG is disabled.
> 
> The definitions are in nine_debug.h
> 
> I haven't tried by maybe using "(void)" instead of nothing would work ?
> 
> Yours,
> 
> Axel
> 
> On 24/10/2019 16:34, Dieter Nützel wrote:
> > Hello Eric,
> > 
> > your mentioned commit (8d43e2b2ded0fe3c82d49561cdab9f208f9e64b6) broke
> > building with NIne (-Dgallium-nine=true) for me.
> > 
> > starting with
> > [-]
> > e_st@sta/cubetexture9.c.o' -c
> > ../src/gallium/state_trackers/nine/cubetexture9.c
> > ../src/gallium/state_trackers/nine/cubetexture9.c: In function
> > ‘NineCubeTexture9_ctor’:
> > ../src/gallium/state_trackers/nine/cubetexture9.c:108:43: error: suggest
> > braces around empty body in an ‘if’ statement [-Werror=empty-body]
> >   108 | "but this is unimplemented\n");
> >   |   ^
> > cc1: some warnings being treated as errors
> > 
> > -- 
> > Next
> > 
> > /surface9.c.o' -c ../src/gallium/state_trackers/nine/surface9.c
> > ../src/gallium/state_trackers/nine/surface9.c: In function
> > ‘NineSurface9_GetContainer’:
> > ../src/gallium/state_trackers/nine/surface9.c:334:40: error: suggest
> > braces around empty body in an ‘if’ statement [-Werror=empty-body]
> >   334 | DBG("QueryInterface FAILED!\n");
> >   |    ^
> > cc1: some warnings being treated as errors
> > 
> > -- 
> > 
> > @sta/swapchain9.c.o' -c ../src/gallium/state_trackers/nine/swapchain9.c
> > ../src/gallium/state_trackers/nine/swapchain9.c: In function ‘present’:
> > ../src/gallium/state_trackers/nine/swapchain9.c:737:51: error: suggest
> > braces around empty body in an ‘if’ statement [-Werror=empty-body]
> >   737 | pSourceRect->top, pSourceRect->bottom);
> >   |   ^
> > ../src/gallium/state_trackers/nine/swapchain9.c:741:47: error: suggest
> > braces around empty body in an ‘if’ statement [-Werror=empty-body]
> >   741 | pDestRect->top, pDestRect->bottom);
> >   |   ^
> > cc1: some warnings being treated as errors
> > 
> > -- 
> > 
> > evice9.c.o' -c ../src/gallium/state_trackers/nine/device9.c
> > ../src/gallium/state_trackers/nine/device9.c: In function
> > ‘NineDevice9_ctor’:
> > ../src/gallium/state_trackers/nine/device9.c:296:49: error: suggest
> > braces around empty body in an ‘if’ statement [-Werror=empty-body]
> >   296 | DBG("\033[1;32mCSMT is active\033[0m\n");
> >   | ^
> > ../src/gallium/state_trackers/nine/device9.c: In function
> > ‘create_zs_or_rt_surface’:
> > ../src/gallium/state_trackers/nine/device9.c:1221:87: error: suggest
> > braces around empty body in an ‘if’ statement [-Werror=empty-body]
> >  1221 |   DBG("FIXME Used shared handle! This option isn't probably
> > handled correctly!\n");
> > |  ^
> > ../src/gallium/state_trackers/nine/device9.c: In function
> > ‘NineDevice9_UpdateSurface’:
> > ../src/gallium/state_trackers/nine/device9.c:1307:53: error: suggest
> > braces around empty body in an ‘if’ statement [-Werror=empty-body]
> >  1307 | pSourceRect->right, pSourceRect->bottom);
> >   | ^
> > ../src/gallium/state_trackers/nine/device9.c:1309:68: error: suggest
> > braces around empty body in an ‘if’ statement [-Werror=empty-body]
> >  1309 | DBG("pDestPoint = (%u,%u)\n", pDestPoint->x,
> > pDestPoint->y);
> > |   ^
> > ../src/gallium/state_trackers/nine/device9.c: In function
> > ‘NineDevice9_StretchRect’:
> > ../src/gallium/state_trackers/nine/device9.c:1588:53: error: suggest
> > braces around empty body in an ‘if’ statement [-Werror=empty-body]
> >  1588 | pSourceRect->right, pSourceRect->bottom);
> >   | ^
> > ../src/gallium/state_trackers/nine/device9.c:1591:49: error: suggest
> > braces around empty body in an ‘if’ statement [-Werror=empty-body]
> >  1591 | pDestRect->right, pDestRect->bottom);
> >   | ^
> > ../src/gallium/state_trackers/nine/device9.c: In function
> > ‘NineDevice9_ColorFill’:
> > ../src/gallium/state_trackers/nine/device9.c:1786:41: error: suggest
> > braces around empty body in an ‘if’ statement [-Werror=empty-body]
> >  1786 | pRect->right, pRect->bottom);
> >   | ^
> > ../src/gallium/state_trackers/nine/device9.c: In function
>