When freeing a connection remove also all the cached entries related
to this connection, otherwise if we access this cached entry through
another valid connection, we will hit memory corruption bugs.
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
if (conn->ep->policy_db)
kdbus_policy_remove_conn(conn->ep->policy_db, conn);
- if (conn->bus->policy_db)
+ if (conn->bus->policy_db) {
+ kdbus_policy_remove_conn(conn->bus->policy_db, conn);
kdbus_policy_remove_owner(conn->bus->policy_db, conn);
+ }
kdbus_meta_free(conn->owner_meta);
kdbus_match_db_free(conn->match_db);
/**
* struct kdbus_domain_user - resource accounting for users
* @kref: Reference counter
- * @domain: Domain of the user
+ * @domain: Domain of the user
* @hentry: Entry in domain user map
* @idr: Smalles possible index number of all users
* @uid: UID of the user