802d4e0cf8
If one would end up with an actor attached to mapped actor, where the attached actor doesn't itself have an up to date stage view list while listening on the stage for updating, when clearing the stage views of the list, anything that would query the stage views list at this time would end up accessing freed memory. This could happen if 1) An actor was added to a newly created container actor attached to the stage 2) The actor got a timeline attached to it 3) The actor was moved to a container that already was mapped 4) A hotplug happened After (1) both the container and actor would not have any stage views. After (2) the timeline would listen on the stage for stage views updates. After (3) the actor would still listen on the stage for stage views updates. When (4) happened, the actor would be signalled when the stage got its stage view cleared, at which point it would traverse up its actor's tree finding an appropriate stage view to base its animation on. The problem here would be that it'd query the already mapped container and its yet-to-be-cleared stage view list, resulting in use-after free, resulting in for example the following backtrace: 0) g_type_check_instance_cast () 1) CLUTTER_STAGE_VIEW () 2) clutter_actor_pick_frame_clock () 3) clutter_actor_pick_frame_clock () 4) update_frame_clock () 5) on_frame_clock_actor_stage_views_changed () 6) g_closure_invoke () 7) signal_emit_unlocked_R () 8) g_signal_emit_valist () 9) g_signal_emit () 10) clear_stage_views_cb () 11) _clutter_actor_traverse_depth () 12) _clutter_actor_traverse () 13) clutter_actor_clear_stage_views_recursive () 14) clutter_stage_clear_stage_views () ... Avoid this issue by making sure that we don't emit 'stage-views-changed' signals while the actor tree is in an invalid state. While we now end up traversing tree twice, it doesn't change the Big-O notation. It has not been measured whether this has any noticible performance impact. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1950 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2025> |
||
---|---|---|
.gitlab/issue_templates | ||
.gitlab-ci | ||
clutter | ||
cogl | ||
data | ||
doc | ||
meson | ||
po | ||
src | ||
subprojects | ||
tools | ||
.gitignore | ||
.gitlab-ci.yml | ||
check-style.py | ||
config.h.meson | ||
COPYING | ||
HACKING.md | ||
meson_options.txt | ||
meson.build | ||
mutter.doap | ||
NEWS | ||
README.md |
Mutter
Mutter is a Wayland display server and X11 window manager and compositor library.
When used as a Wayland display server, it runs on top of KMS and libinput. It implements the compositor side of the Wayland core protocol as well as various protocol extensions. It also has functionality related to running X11 applications using Xwayland.
When used on top of Xorg it acts as a X11 window manager and compositing manager.
It contains functionality related to, among other things, window management, window compositing, focus tracking, workspace management, keybindings and monitor configuration.
Internally it uses a fork of Cogl, a hardware acceleration abstraction library used to simplify usage of OpenGL pipelines, as well as a fork af Clutter, a scene graph and user interface toolkit.
Mutter is used by, for example, GNOME Shell, the GNOME core user interface, and by Gala, elementary OS's window manager. It can also be run standalone, using the command "mutter", but just running plain mutter is only intended for debugging purposes.
Contributing
To contribute, open merge requests at https://gitlab.gnome.org/GNOME/mutter.
It can be useful to look at the documentation available at the Wiki.
Coding style and conventions
See HACKING.md.
Git messages
Commit messages should follow the GNOME commit message
guidelines. We require an URL
to either an issue or a merge request in each commit. Try to always prefix
commit subjects with a relevant topic, such as compositor:
or
clutter/actor:
, and it's always better to write too much in the commit
message body than too little.
Default branch
The default development branch is main
. If you still have a local
checkout under the old name, use:
git checkout master
git branch -m master main
git fetch
git branch --unset-upstream
git branch -u origin/main
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
License
Mutter is distributed under the terms of the GNU General Public License, version 2 or later. See the COPYING file for detalis.