Features:
+ - account and limit number of messages a connection can have in-flight
+ for another connection, like a connection can have a maximum of 100
+ messages in-flight, but only 10 of them to the same connection
+
- make kdbus.ko loadable a second time with a different:
/dev/kdbus/, /sys/bus/kdbus/ name
to be able to run test environments while the first one
is in use by the system
+
- allow to update the metadata subscription bit mask
+
- support the creation of anonymous buses
- - implement the EP_MAKE logic
-External API:
+ - limit the number of connections per uid
+
+ - memfd's file pos is shared, document pread/pwrite
+
- actually return compatible/incompatible flags to users
+
+External API:
- rules for:
-unknown items to ignore in userspace lib?
-unknown items to ignore if SEND sees them?
- - review all different structures of custom ioctls and items if they
- can be somehow unified
-Internal:
- - limit the number of connections per uid
- - memfd's file pos is shared, document pread/pwrite
+ - review all different structures of custom ioctls and items if they
+ can be further unified
* @make: Pointer to a struct kdbus_cmd_make containing the
* details for the bus creation
* @name: Name of the bus
+ * @bloom_size: Size of the bloom filter on this bus
* @mode: The access mode for the device node
* @uid: The uid of the device node
* @gid: The gid of the device node
* @fds_count: Number of files
* @src_id: The ID of the sender
* @cookie: Message cookie, used for replies
- * @src_name_id: The sequence number of the name this message is
+ * @dst_name_id: The sequence number of the name this message is
* addressed to, 0 for messages sent to an ID
*/
struct kdbus_conn_queue {
/**
* enum kdbus_handle_type - type a handle can be of
- * @_KDBUS_HANDLE_NULL: internal null marker
- * @KDBUS_HANDLE_CONTROL: new fd of a control node
- * @KDBUS_HANDLE_CONTROL_NS_OWNER: fd to hold a namespace
- * @KDBUS_HANDLE_CONTROL_BUS_OWNER: fd to hold a bus
- * @KDBUS_HANDLE_EP: new fd of a bus node
- * @KDBUS_HANDLE_EP_CONNECTED: connection after HELLO
- * @KDBUS_HANDLE_EP_OWNER: fd to hold an endpoint
- * @KDBUS_HANDLE_DISCONNECTED: handle is disconnected
+ * @_KDBUS_HANDLE_NULL: Uninitialized/invalid
+ * @KDBUS_HANDLE_CONTROL: New file descriptor of a control node
+ * @KDBUS_HANDLE_CONTROL_NS_OWNER: File descriptor to hold a namespace
+ * @KDBUS_HANDLE_CONTROL_BUS_OWNER: File descriptor to hold a bus
+ * @KDBUS_HANDLE_EP: New file descriptor of a bus node
+ * @KDBUS_HANDLE_EP_CONNECTED: A bus connection after HELLO
+ * @KDBUS_HANDLE_EP_OWNER: File descriptor to hold an endpoint
+ * @KDBUS_HANDLE_DISCONNECTED: Handle is disconnected
*/
enum kdbus_handle_type {
_KDBUS_HANDLE_NULL,
* @type: Type of this handle (KDBUS_HANDLE_*)
* @ns: Namespace for this handle
* @meta: Cached connection creator's metadata/credentials
- * @ep The endpoint this handle owns, in case @type
+ * @ep: The endpoint this handle owns, in case @type
* is KDBUS_HANDLE_EP
* @ns_owner: The namespace this handle owns, in case @type
* is KDBUS_HANDLE_CONTROL_NS_OWNER
gid = current_fsgid();
}
- //FIXME: what to do with the holder connection now?
ret = kdbus_ep_new(handle->ep->bus, handle->ep->bus->ns, n,
mode, current_fsuid(), gid,
make->flags & KDBUS_MAKE_POLICY_OPEN);
unsigned int mask = 0;
bool disconnected;
- /* Only an endpoint can read/write data */
+ /* Only a connected endpoint can read/write data */
if (handle->type != KDBUS_HANDLE_EP_CONNECTED)
return POLLERR | POLLHUP;
/**
* enum kdbus_item_type - item types to chain data in a list
+ * @_KDBUS_ITEM_NULL: Uninitialized/invalid
+ * @_KDBUS_ITEM_USER_BASE: Start of user items
* @KDBUS_ITEM_PAYLOAD_VEC: Vector to data
* @KDBUS_ITEM_PAYLOAD_OFF: Data at returned offset to message head
* @KDBUS_ITEM_PAYLOAD_MEMFD: Data as sealed memfd
* @KDBUS_ITEM_DST_NAME: Destination's well-known name
* @KDBUS_ITEM_PRIORITY: Queue priority for message
* @KDBUS_ITEM_MAKE_NAME: Name of namespace, bus, endpoint
+ * @_KDBUS_ITEM_POLICY_BASE: Start of policy items
* @KDBUS_ITEM_POLICY_NAME: Policy in struct kdbus_policy
* @KDBUS_ITEM_POLICY_ACCESS: Policy in struct kdbus_policy
+ * @_KDBUS_ITEM_ATTACH_BASE: Start of metadata attach items
* @KDBUS_ITEM_NAME: Well-know name with flags
* @KDBUS_ITEM_ID: Connection ID
* @KDBUS_ITEM_TIMESTAMP: Timestamp
* @KDBUS_ITEM_CAPS: The process capabilities
* @KDBUS_ITEM_SECLABEL: The security label
* @KDBUS_ITEM_AUDIT: The audit IDs
+ * @_KDBUS_ITEM_KERNEL_BASE: Start of kernel-generated message items
* @KDBUS_ITEM_NAME_ADD: Notify in struct kdbus_notify_name_change
* @KDBUS_ITEM_NAME_REMOVE: Notify in struct kdbus_notify_name_change
* @KDBUS_ITEM_NAME_CHANGE: Notify in struct kdbus_notify_name_change
/**
* enum kdbus_payload_type - type of payload carried by message
* @KDBUS_PAYLOAD_KERNEL: Kernel-generated simple message
- * @KDBUS_PAYLOAD_DBUS: D-Bus marshalling
+ * @KDBUS_PAYLOAD_DBUS: D-Bus marshalling "DBusDBus"
*/
enum kdbus_payload_type {
KDBUS_PAYLOAD_KERNEL,
- KDBUS_PAYLOAD_DBUS = 0x4442757344427573ULL, /* 'DBusDBus' */
+ KDBUS_PAYLOAD_DBUS = 0x4442757344427573ULL,
};
/**
/**
* enum kdbus_policy_access_type - permissions of a policy record
+ * @_KDBUS_POLICY_ACCESS_NULL: Uninitialized/invalid
* @KDBUS_POLICY_ACCESS_USER: Grant access to a uid
* @KDBUS_POLICY_ACCESS_GROUP: Grant access to gid
* @KDBUS_POLICY_ACCESS_WORLD: World-accessible
* @conn_src: The connection object originating the message
* @kmsg: The kmsg to perform the match on
*
- * Returns true in if there was a matching database entry, false otherwise.
-
* This function will walk through all the database entries previously uploaded
* with kdbus_match_db_add(). As soon as any of them has an all-satisfied rule
* set, this function will return true.
+ *
+ * Returns true in if there was a matching database entry, false otherwise.
*/
bool kdbus_match_db_match_kmsg(struct kdbus_match_db *db,
struct kdbus_conn *conn_src,
/**
* kdbus_kmsg_new() - allocate message
* @extra_size: additional size to reserve for data
- * @m: Returned Message
+ * @kmsg: Returned Message
*
* Returns: 0 on success, negative errno on failure.
*/
* kdbus_kmsg_new_from_user() - copy message from user memory
* @conn: Connection
* @msg: User-provided message
- * @m: Copy of message
+ * @kmsg: Copy of message
*
* Returns: 0 on success, negative errno on failure.
*/
/**
* struct kdbus_kmsg - internal message handling data
* @notify_type: Short-cut for faster lookup
- * @notify_id: Short-cut for faster lookup
+ * @notify_old_id: Short-cut for faster lookup
+ * @notify_new_id: Short-cut for faster lookup
* @notify_name: Short-cut for faster lookup
* @dst_name: Short-cut to msg for faster lookup
* @dst_name_id: Short-cut to msg for faster lookup