prosyslab-classroom / cs348-information-security

60 stars 10 forks source link

[Question][Hw4] What if file is opened by other process? #298

Closed m-spitfire closed 1 year ago

m-spitfire commented 1 year ago

Name: Murad Bashirov

Hello. I'm sorry for so many questions, but what should be the result of this 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_subject("attacker");
  create_subject("conferer");
  enter(Execute, "attacker", "conferer");
  enter(Read, "conferer", "secret_file");
}

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

void conferer(int fd) {
    int proc = open("secret_file", Read);
    read_with_capability(proc, "secret_file");
}

I am not sure what should it return.. Should it return Compromised? But it didn't open with attacker's fd.

Thanks

github-actions[bot] commented 1 year ago

Possible duplication detected. Refer to #297

sujin0529 commented 1 year ago

This homework follows C semantics. So, you'll find the answer easily!

But, what is a deputy object?

Thanks.

m-spitfire commented 1 year ago

I'm sorry, it should have been secret_file not deputy.

m-spitfire commented 1 year ago

This homework follows C semantics. So, you'll find the answer easily!

But, what is a deputy object?

Thanks.

@sujin0529 C semantics follows that even if open syscall has error with permission, it doesn't immediately crashes the program but follows the execution. So I should return Compromised in this case?

sujin0529 commented 1 year ago

Yes, you are right. This case should return Compromised.

m-spitfire commented 1 year ago

Thanks.