prosyslab-classroom / cs348-information-security

61 stars 10 forks source link

[Question][Hw4] Arguments of Execute_with_capability #286

Closed frogfrog2 closed 1 year ago

frogfrog2 commented 1 year ago
void attacker() {
  int fd = open("wizard", Execute);
  execute_with_capability(fd, "deputy");
}

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

Name: Jihwan Park

Acoording to the document, three arguments of Execute_with_capability are object_file, perm, and proc, respectively. I found a reply that this will be updated to perm, object_file, and proc only by changing their order. However, it doesn't seem correct either, according to "main.ml". Similar to the argument of Execute command in Acl part, Execute_with_capability command in Capability part receives 'a new process to be executed' as the second argument (whose type is Object.t). Meanwhile, the first argument of Execute_with_capability is the name of the variable that contains capability, and the third argument is the parameter name of 'a new process to be executed'. For example, the third line of the code snippet above corresponds to Execute_with_capability command with arguments "fd", deputy(Object.t), "ffdd".

I'm pretty sure about this, and I'd appreciate it if you could check whether my understanding is correct or not. Thanks!

sujin0529 commented 1 year ago

Hi,

Exactly what you understand is correct. I represented it like that because the third argument was information related to the process, but I don't think that it was communicated correctly.

Thanks.