Find a file
Eric Guo 58ab5760c1 panfrost: Fix NULL pointer dereference in panfrost_emit_images
Fix a crash in image descriptor emission caused by stale image_mask bits.

Root cause:
- set_shader_images used a shift expression with count==64 when clearing
  image_mask, which is undefined behavior in C.
- This could leave image_mask inconsistent with actual image bindings,
  so panfrost_emit_images() might dereferences NULL image resources.

Fixes:
- Use 64-bit-safe bit helpers for mask updates to avoid invalid shifts.

Crash observed when running: OpenCL-CTS api/test_api
Backtrace:
  #0 util_image_to_sampler_view (v->resource is NULL)
  #1 panfrost_emit_images
  #2 panfrost_update_shader_state
  #3 panfrost_launch_grid_on_batch
  #4 panfrost_launch_grid

Backport-to: *
Signed-off-by: Eric Guo <eric.guo@nxp.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
(cherry picked from commit c1770565f3)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
2026-04-01 11:45:35 +02:00
.ci-farms Revert "ci: lima farm maintenance" 2026-02-11 15:51:45 +01:00
.ci-farms-disabled Revert "ci: lima farm maintenance" 2026-02-11 15:51:45 +01:00
.github/workflows
.gitlab
.gitlab-ci ci: Drop duplicate Intel shader-db run 2026-04-01 11:45:33 +02:00
.marge/hooks
android
bin pick-ui: add Backport-to: * as a synonym to Cc: mesa-stable 2026-02-25 14:22:19 +01:00
build-support
docs docs: add sha sum for 26.0.3 2026-03-18 17:25:12 +01:00
include Revert "renderdoc: Add Haiku platform support" 2026-01-07 09:08:46 +00:00
licenses
src panfrost: Fix NULL pointer dereference in panfrost_emit_images 2026-04-01 11:45:35 +02:00
subprojects meson: specify minimal target meson version for rust subprojects 2025-12-12 17:28:49 +00:00
.clang-format meson: Restore .clang-format for ninja clang-format target 2026-02-04 18:39:34 +01:00
.clang-format-ignore
.clang-format-include ethos: Initial commit of a driver for the Arm Ethos-U65 NPU. 2025-10-15 20:10:15 +00:00
.dir-locals.el
.editorconfig editorconfig: Set for glsl files 2025-11-14 19:31:17 +00:00
.git-blame-ignore-revs radv: Add re-format commit to .git-blame-ignore-revs 2025-11-12 07:55:36 +00:00
.gitattributes
.gitignore
.gitlab-ci.yml ci: changing .gitlab-ci.yml itself also means the container jobs must exist 2026-04-01 11:45:30 +02:00
.graphqlrc.yml
.mailmap mailmap: update my name and email 2025-11-03 22:08:48 +00:00
.mr-label-maker.yml mr-label-maker: tag src/virtio/virtgpu_kumquat* as part of gfxstream 2026-01-05 17:01:39 +00:00
.pick_status.json panfrost: Fix NULL pointer dereference in panfrost_emit_images 2026-04-01 11:45:35 +02:00
.shellcheckrc
clippy.toml ci: read the MSRV from clippy.toml to avoid having too many copies to keep in sync 2025-12-20 00:13:19 +01:00
CODEOWNERS CODEOWNERS: Add KosmicKrisp owners 2025-10-21 02:28:09 +00:00
meson.build clc: Fix static link with clang>=22 2026-04-01 11:45:32 +02:00
meson.options meson: add mpeg12dec as a video-codec 2026-01-20 22:42:08 +00:00
README.rst
rustfmt.toml
VERSION VERSION: bump for 26.0.3 2026-03-18 16:54:10 +01:00

`Mesa <https://mesa3d.org>`_ - The 3D Graphics Library
======================================================


Source
------

This repository lives at https://gitlab.freedesktop.org/mesa/mesa.
Other repositories are likely forks, and code found there is not supported.


Build & install
---------------

You can find more information in our documentation (`docs/install.rst
<https://docs.mesa3d.org/install.html>`_), but the recommended way is to use
Meson (`docs/meson.rst <https://docs.mesa3d.org/meson.html>`_):

.. code-block:: sh

  $ meson setup build
  $ ninja -C build/
  $ sudo ninja -C build/ install

Support
-------

Many Mesa devs hang on IRC; if you're not sure which channel is
appropriate, you should ask your question on `OFTC's #dri-devel
<irc://irc.oftc.net/dri-devel>`_, someone will redirect you if
necessary.
Remember that not everyone is in the same timezone as you, so it might
take a while before someone qualified sees your question.
To figure out who you're talking to, or which nick to ping for your
question, check out `Who's Who on IRC
<https://dri.freedesktop.org/wiki/WhosWho/>`_.

The next best option is to ask your question in an email to the
mailing lists: `mesa-dev\@lists.freedesktop.org
<https://lists.freedesktop.org/mailman/listinfo/mesa-dev>`_


Bug reports
-----------

If you think something isn't working properly, please file a bug report
(`docs/bugs.rst <https://docs.mesa3d.org/bugs.html>`_).


Contributing
------------

Contributions are welcome, and step-by-step instructions can be found in our
documentation (`docs/submittingpatches.rst
<https://docs.mesa3d.org/submittingpatches.html>`_).

Note that Mesa uses gitlab for patches submission, review and discussions.