f845355 SBUS: defer deallocation of sbus_watch_ctx

2 files Authored by atikhonov 4 years ago, Committed by pbrezina 4 years ago,
    SBUS: defer deallocation of sbus_watch_ctx
    
    The following flow was causing use-after-free error:
      tevent_common_invoke_fd_handler(RW) -> sbus_watch_handler(RW) ->
      dbus_watch_handle(R) -> ...libdbus detects connection is closed... ->
      sbus_remove_watch() -> talloc_free(watch) ->
      ... get back to libdbus and back to sbus_watch_handler() ->
      "if (watch->dbus_write_watch) dbus_watch_handle(W)" => use-after-free
    
    To resolve an issue schedule deallocation of watch as immediate event.
    
    Resolves: https://pagure.io/SSSD/sssd/issue/2660
    
    Reviewed-by: Pavel Březina <pbrezina@redhat.com>
    
        
file modified
+23 -1
file modified
+1 -0