e_devicemgr: Prevent accessing user_data's member variable after wl_resource_destroy 34/319234/1
authorduna.oh <duna.oh@samsung.com>
Fri, 18 Oct 2024 04:12:37 +0000 (13:12 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Fri, 18 Oct 2024 05:35:46 +0000 (14:35 +0900)
commite1b9221fc1cb6eb2699d7cb7d61b0363e5432060
tree3d1bb51a26c641b8807a688fbd48a0ce6200d928
parent109c4835e2926886553de29cffe2b9cd1092d104
e_devicemgr: Prevent accessing user_data's member variable after wl_resource_destroy

This patch fixes the following segfault on E20.
Since wl_resource_destroy() triggers freeing the user_data, do not access user_data
after calling wl_resource_destory().

1  (anonymous namespace)::sigSegvHandler (sig=11, info=0xfff0fe10, ucontext=0xfff0fe90) at /usr/src/debug/glibc-2.30-3.14.arm/gwp_asan/segv_handler_posix.cpp:195
2  <signal handler called> ()
3  _e_devicemgr_wl_device_cb_seat_destroy (l=0xf54cb01c, data=<optimized out>) at /usr/src/debug/enlightenment-0.20.0-tz9_34.0.2.arm/src/bin/server/e_devicemgr_wl.c:113
4  wl_priv_signal_final_emit (signal=signal@entry=0x29258f8, data=data@entry=0x29258c8) at /usr/src/debug/wayland-1.22.0-0.arm/builddir/../src/wayland-server.c:2714
5  remove_and_destroy_resource (element=0x29258c8, data=<optimized out>, flags=0) at /usr/src/debug/wayland-1.22.0-0.arm/builddir/../src/wayland-server.c:940
6  for_each_helper (func=func@entry=0xf6e63b31 <remove_and_destroy_resource>, data=data@entry=0x0, entries=<optimized out>, entries=<optimized out>) at /usr/src/debug/wayland-1.22.0-0.arm/builddir/../src/wayland-util.c:444
7  wl_map_for_each (map=map@entry=0x2cb8a28, func=0xf6e63b31 <remove_and_destroy_resource>, data=data@entry=0x0) at /usr/src/debug/wayland-1.22.0-0.arm/builddir/../src/wayland-util.c:458
8  wl_client_destroy (client=0x2cb8a10) at /usr/src/debug/wayland-1.22.0-0.arm/builddir/../src/wayland-server.c:1181

Change-Id: I7ed7230827d494c6fa7487e17074d5d429657557
src/bin/server/e_devicemgr_wl.c