Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[storage] Ignore inotify if service is already removed. Fixes JB#53294
Ignore inotify for a service that has been already removed. This may happen in cases when the service is removed normally using storage.c functionality but inotify still gets the notify about the removal of a dir as it is triggered by the actual removal. With this change the processing of the event is simply stopped if it does not exist anymore. Otherwise it would result in double freeing of the service causing connmand later on to segfault with: Thread 1 "connmand" received signal SIGSEGV, Segmentation fault. 0x0007fb64 in __connman_access_service_policy_check (p=0xf7ac60, method=CONNMAN_ACCESS_SERVICE_GET_PROPERTY, arg=0x9c2a0 "Passphrase", sender=0x0, default_access=CONNMAN_ACCESS_DENY) at src/access.c:250 250 if (p && p->driver->service_policy_check) (gdb) bt 0 0x0007fb64 in __connman_access_service_policy_check (p=0xf7ac60, method=CONNMAN_ACCESS_SERVICE_GET_PROPERTY, arg=0x9c2a0 "Passphrase", sender=0x0, default_access=CONNMAN_ACCESS_DENY) at src/access.c:250 1 0x00047552 in can_get_property (service=0xf05f30, default_access=<optimized out>, sender=0x0, name=<optimized out>) at src/service.c:3101 2 restricted_string_changed (service=service@entry=0xf05f30, name=<optimized out>, value=value@entry=0x0, default_get_access=<optimized out>) at src/service.c:3142 3 0x0004fbd2 in __connman_service_remove (service=0xf05f30) at src/service.c:5918 4 0x000507cc in __connman_service_unload_services (services=<optimized out>, len=1) at src/service.c:9609 5 0x00064ad8 in storage_inotify_cb (event=0xffaebc74, ident=<optimized out>, user_data=<optimized out>) at src/storage.c:528 6 0x000793f0 in inotify_data (channel=<optimized out>, user_data=<optimized out>, cond=<optimized out>) at src/inotify.c:140 7 0xeb9da982 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 8 0xeb9dabf0 in ?? () from /usr/lib/libglib-2.0.so.0 9 0xeb9dae34 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0 10 0x00023982 in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:994
- Loading branch information