const char *name,
struct kdbus_bloom_parameter *bloom,
u64 attach_owner,
- u64 attach_req,
u64 flags, kuid_t uid, kgid_t gid)
{
struct kdbus_bus *b;
int ret;
attach_flags_t attach_flags;
- attach_flags_t attach_flags_req;
if (bloom->size < 8 || bloom->size > KDBUS_BUS_BLOOM_MAX_SIZE || !KDBUS_IS_ALIGNED8(bloom->size) || bloom->n_hash < 1)
return ERR_PTR(-EINVAL);
if ((ret = kdbus_sanitize_attach_flags(attach_owner, &attach_flags)))
return ERR_PTR(ret);
- if ((ret = kdbus_sanitize_attach_flags(attach_req, &attach_flags_req)))
- return ERR_PTR(ret);
-
if ((ret = kdbus_verify_uid_prefix(name, domain->user_namespace, uid)))
return ERR_PTR(ret);
return ERR_PTR(ret);
memset(b, 0, sizeof(*b));
b->meta_valid = ret | kdbus_dst_sensitive_meta_collect(&b->meta, attach_flags);
- b->attach_flags_req = attach_flags_req;
}
kdbus_node_init(&b->node, KDBUS_NODE_BUS);
{ .type = KDBUS_ITEM_MAKE_NAME, .mandatory = true },
{ .type = KDBUS_ITEM_BLOOM_PARAMETER, .mandatory = true },
{ .type = KDBUS_ITEM_ATTACH_FLAGS_SEND },
- { .type = KDBUS_ITEM_ATTACH_FLAGS_RECV },
};
struct kdbus_args args = {
.allowed_flags =
bus = kdbus_bus_new(domain,
argv[0].item->str, &argv[1].item->bloom_parameter,
argv[2].item ? *(argv[2].item->data64) : 0,
- argv[3].item ? *(argv[3].item->data64) : 0,
cmd->flags, current_euid(), current_egid());
if (IS_ERR(bus)) {
ret = PTR_ERR(bus);
if ((ret = kdbus_sanitize_attach_flags(hello->attach_flags_send, &attach_flags_send)))
return ERR_PTR(ret);
- /* The attach flags must always satisfy the bus requirements. */
- if (bus->attach_flags_req & ~attach_flags_send)
- return ERR_PTR(-ECONNREFUSED);
-
if ((ret = kdbus_sanitize_attach_flags(hello->attach_flags_recv, &attach_flags_recv)))
return ERR_PTR(ret);
if ((ret = kdbus_sanitize_attach_flags(*item_attach_send, &attach_send)))
goto exit;
-
- kdbus_assert(conn->ep);
- kdbus_assert(conn->ep->bus);
- if (conn->ep->bus->attach_flags_req & ~attach_send) {
- ret = -EINVAL;
- goto exit;
- }
}
if (item_attach_recv) {