Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Associated resources are not properly converted if they are this.* #133

Open
matt-sheets opened this issue Feb 28, 2023 · 0 comments
Open
Milestone

Comments

@matt-sheets
Copy link
Collaborator

In the following example:

virtual resource tmp {
	@associated_call
	fn associated_call_from_tmp(domain source) {
		allow(source, tmp, file, [read]);
	}

	fn not_an_associated_call(domain source) {
		allow(source, tmp, file, [write]);
	}
}

resource qwe {
   fn some_func(domain source, resource some_resource) {
       allow(source, some_resource, file, read);
   }
}

@associate([tmp])
domain cvb {
    qwe.some_func(this, this.tmp);
}

The following relevant cil will be created:

(type cvb-tmp)
(roletype object_r cvb-tmp)
(typeattributeset tmp (cvb-tmp))
(typeattributeset resource (cvb-tmp))
(macro cvb-tmp-associated_call_from_tmp ((type this) (type source)) (allow source tmp (file (read))))
(macro cvb-tmp-not_an_associated_call ((type this) (type source)) (allow source tmp (file (write))))
(call cvb-tmp-associated_call_from_tmp (cvb-tmp cvb))
(call qwe-some_func (qwe cvb cvb.tmp))

As you can see most of the cvb.tmp are correctly converted to cvb-tmp with the exception of this.tmp where this is cvb. That remains cvb.tmp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants