diff options
Diffstat (limited to 'pkg/csource/generated.go')
| -rw-r--r-- | pkg/csource/generated.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/csource/generated.go b/pkg/csource/generated.go index f25ee1998..c68c99cc2 100644 --- a/pkg/csource/generated.go +++ b/pkg/csource/generated.go @@ -3216,6 +3216,7 @@ static int do_sandbox_namespace(void) #if SYZ_EXECUTOR || SYZ_REPEAT && SYZ_USE_TMP_DIR #include <dirent.h> #include <errno.h> +#include <linux/fs.h> #include <string.h> #include <sys/mount.h> static void remove_dir(const char* dir) @@ -3254,6 +3255,16 @@ retry: debug("unlink(%s)\n", filename); if (unlink(filename) == 0) break; + if (errno == EPERM) { + int fd = open(filename, O_RDONLY); + if (fd != -1) { + struct fsxattr attr = {0}; + if (ioctl(fd, FS_IOC_FSSETXATTR, &attr) == 0) + debug("reset FS_XFLAG_IMMUTABLE\n"); + close(fd); + continue; + } + } if (errno == EROFS) { debug("ignoring EROFS\n"); break; |
