-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
Also see #78.
Our fuzzer DIFFuzzer (source is closed at the moment) found this bug on commit 2cc2af5030f8bf831cd8355bc4780a34acbf6faa (tag: v2.7.10)
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
int main() {
int res;
res = mkdir("1", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
int fd = creat("1/2", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
res = unlink("1/2");
printf("UNLINK %d(%s)\n", res, strerror(errno));
res = rmdir("1");
printf("RMDIR %d(%s)\n", res, strerror(errno));
res = close(fd);
printf("CLOSE %d(%s)\n", res, strerror(errno));
}
// ::Expected::
// UNLINK 0(Success)
// RMDIR 0(Success)
// CLOSE 0(Success)
// ::Actual::
// UNLINK 0(Success)
// RMDIR -1(Directory not empty)
// CLOSE 0(Directory not empty)If file with open file descriptor is deleted using unlink, rmdir will still fail.
System info:
Ubuntu 22.04.5 LTS
Kernel 5.15.178
gcc 11.4.0
Metadata
Metadata
Assignees
Labels
No labels