Skip to content

Commit

Permalink
xen-dom-xs: create local domain directory with correct perms
Browse files Browse the repository at this point in the history
During Xenstore entries initialization we should create
"local/domain/{domid}" directory and give {domid} domain read/write
access to child entries. When it is missing, local directory will
have access provided from first xss_do_write() for this domain, which
may lead to unexpected access issues.

Signed-off-by: Dmytro Firsov <[email protected]>
Reviewed-by: Mykyta Poturai <[email protected]>
Reviewed-by: Grygorii Strashko <[email protected]>
Acked-by: Volodymyr Babchuk <[email protected]>
Reviewed-by: Leonid Komarianskyi <[email protected]>
  • Loading branch information
firscity committed May 9, 2024
1 parent 01d69fb commit 4feb5a0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions xen-dom-mgmt/src/xen-dom-xs.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,12 @@ int xs_initialize_xenstore(uint32_t domid, const struct xen_domain *domain)
"device/suspend/event-channel",
NULL };

sprintf(lbuffer, "%s/%d", basepref, domid);
rc = xss_write_guest_domain_rw(lbuffer, "", domid);
if (rc) {
goto deinit;
}

// TODO: generate properly
snprintf(uuid, INIT_XENSTORE_UUID_BUF_SIZE, "00000000-0000-0000-0000-%012d", domid);

Expand Down

0 comments on commit 4feb5a0

Please sign in to comment.