prosyslab-classroom / cs348-information-security

60 stars 10 forks source link

[Question][Hw4] Regarding semantics of Scenarios #297

Closed m-spitfire closed 1 year ago

m-spitfire commented 1 year ago

Name: Murad Bashirov

Is this a valid scenario?

enum access_control_t { Acl, Capability };
enum permission_t { Own, Read, Execute };

const enum access_control_t access_control = Capability;

void init() {
  create_object("secret_file");
  create_object("conferer");
  create_object("deputy");
  create_subject("attacker");
  create_subject("conferer");
  create_subject("deputy");
  enter(Execute, "attacker", "conferer");
  enter(Read, "attacker", "secret_file");
  enter(Own, "conferer", "secret_file");
  enter(Execute, "conferer", "deputy");
}

void attacker() {
    int fd = open("secret_file", Read);
    execute_with_capability(fd, "conferer");
}

void conferer(int fd) {
  confer(Read, "deputy", "secret_file");
  execute_with_capability(fd, "deputy");
}

void deputy(int fd) {
    read_with_capability(fd, "secret_file");
}

Meaning, can scenarios use the same capability names when passing the capability around more than once?

github-actions[bot] commented 1 year ago

Possible duplication detected. Refer to #288

sujin0529 commented 1 year ago

Yes, this homework follows C semantics. So, your example scenario is valid.

Thanks.

m-spitfire commented 1 year ago

Thanks.