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
Query on the code in Race_Condition #40
Comments
This has been working fine on my computer. Are you using the SEED VM? The background of your terminal does not seem to be the SEED VM. |
All the labs need to be done on the SEED VM, or you will observe some issues. I just realized that the problem you identified in the SetUID lab might be caused by the same reason. I will double check, and we may have to roll back the change that I just merged. |
I checked it again in the SEED VM. There're the same warnings. |
OK, I see that you used "gcc -Wall" while I simply use "gcc". That makes sense. I will keep the changes. |
It also has the segmentation fault |
Can you post a screenshot of your desktop? |
I have recreated your problem. Let me figure out why. I tested this lab many times. |
I see the problem. In the past, I never create /tmp/XYZ, because fopen will create one automatically. If we create one ourselves, the |
That looks make sense. |
I am reopening this issue for discussion. I am doing some comparison between Ubuntu 16.04 and 20.04, and found out that open() system call's behavior is different. In 16.04, root can open any file in /tmp; but in 20.04, root cannot do that. That is why we see the problem. Adding an error checking does not solve this problem, because the program becomes meaningless: it will never be able to write to /tmp/XYZ in the normal case. I did a search, and found a way to disable this behavior. We need to run this command (see reference here)
|
I ran the
vulp.c
code snippet as below.Before I setuid on
vulp
, it can normally modify the tmpfile. However, after I setuid, it fails with a segmentation fault.I looked into the program and find that it passed the check of
access
but fails to open the file because of 'Permission denied'.Is this an expected behaviour? Do you think we should check if
fopen
succeed and add aperro
?The text was updated successfully, but these errors were encountered: