/openbmc/linux/tools/testing/selftests/fchmodat2/ |
H A D | fchmodat2_test.c | 12 int sys_fchmodat2(int dfd, const char *filename, mode_t mode, int flags) in sys_fchmodat2() argument 14 int ret = syscall(__NR_fchmodat2, dfd, filename, mode, flags); in sys_fchmodat2() 21 int dfd, ret; in setup_testdir() local 28 dfd = open(dirname, O_PATH | O_DIRECTORY); in setup_testdir() 29 if (dfd < 0) in setup_testdir() 32 ret = openat(dfd, "regfile", O_CREAT | O_WRONLY | O_TRUNC, 0644); in setup_testdir() 38 ret = symlinkat("regfile", dfd, "symlink"); in setup_testdir() 43 return dfd; in setup_testdir() 46 int expect_mode(int dfd, const char *filename, mode_t expect_mode) in expect_mode() argument 49 int ret = fstatat(dfd, filename, &st, AT_SYMLINK_NOFOLLOW); in expect_mode() [all …]
|
/openbmc/linux/fs/ |
H A D | utimes.c | 80 static int do_utimes_path(int dfd, const char __user *filename, in do_utimes_path() argument 95 error = user_path_at(dfd, filename, lookup_flags, &path); in do_utimes_path() 127 * @dfd: open file descriptor, -1 or AT_FDCWD 132 * If filename is NULL and dfd refers to an open file, then operate on 133 * the file. Otherwise look up filename, possibly using dfd as a 140 long do_utimes(int dfd, const char __user *filename, struct timespec64 *times, in do_utimes() argument 143 if (filename == NULL && dfd != AT_FDCWD) in do_utimes() 144 return do_utimes_fd(dfd, times, flags); in do_utimes() 145 return do_utimes_path(dfd, filename, times, flags); in do_utimes() 148 SYSCALL_DEFINE4(utimensat, int, dfd, const char __user *, filename, in SYSCALL_DEFINE4() argument [all …]
|
H A D | stat.c | 219 * @dfd: A file descriptor representing the base dir for a relative filename 232 static int vfs_statx(int dfd, struct filename *filename, int flags, in vfs_statx() argument 244 error = filename_lookup(dfd, filename, lookup_flags, &path, NULL); in vfs_statx() 274 int vfs_fstatat(int dfd, const char __user *filename, in vfs_fstatat() argument 287 if (dfd >= 0 && flags == AT_EMPTY_PATH) { in vfs_fstatat() 295 return vfs_fstat(dfd, stat); in vfs_fstatat() 299 ret = vfs_statx(dfd, name, statx_flags, stat, STATX_BASIC_STATS); in vfs_fstatat() 457 SYSCALL_DEFINE4(newfstatat, int, dfd, const char __user *, filename, in SYSCALL_DEFINE4() argument 463 error = vfs_fstatat(dfd, filename, &stat, flag); in SYSCALL_DEFINE4() 482 static int do_readlinkat(int dfd, const char __user *pathname, in do_readlinkat() argument [all …]
|
H A D | internal.h | 54 extern int filename_lookup(int dfd, struct filename *name, unsigned flags, 56 int do_rmdir(int dfd, struct filename *name); 57 int do_unlinkat(int dfd, struct filename *name); 61 int do_mkdirat(int dfd, struct filename *name, umode_t mode); 169 extern struct file *do_filp_open(int dfd, struct filename *pathname, 179 int do_fchownat(int dfd, const char __user *filename, uid_t user, gid_t group, 232 int do_statx(int dfd, struct filename *filename, unsigned int flags,
|
H A D | open.c | 457 static long do_faccessat(int dfd, const char __user *filename, int mode, int flags) in do_faccessat() argument 483 res = user_path_at(dfd, filename, lookup_flags, &path); in do_faccessat() 529 SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode) in SYSCALL_DEFINE3() argument 531 return do_faccessat(dfd, filename, mode, 0); in SYSCALL_DEFINE3() 534 SYSCALL_DEFINE4(faccessat2, int, dfd, const char __user *, filename, int, mode, in SYSCALL_DEFINE4() argument 537 return do_faccessat(dfd, filename, mode, flags); in SYSCALL_DEFINE4() 674 static int do_fchmodat(int dfd, const char __user *filename, umode_t mode, in do_fchmodat() argument 689 error = user_path_at(dfd, filename, lookup_flags, &path); in do_fchmodat() 701 SYSCALL_DEFINE4(fchmodat2, int, dfd, const char __user *, filename, in SYSCALL_DEFINE4() argument 704 return do_fchmodat(dfd, filename, mode, flags); in SYSCALL_DEFINE4() [all …]
|
H A D | namei.c | 587 int dfd; member 596 static void __set_nameidata(struct nameidata *p, int dfd, struct filename *name) in __set_nameidata() argument 601 p->dfd = dfd; in __set_nameidata() 610 static inline void set_nameidata(struct nameidata *p, int dfd, struct filename *name, in set_nameidata() argument 613 __set_nameidata(p, dfd, name); in set_nameidata() 2391 /* Absolute pathname -- fetch the root (LOOKUP_IN_ROOT uses nd->dfd). */ in path_init() 2400 if (nd->dfd == AT_FDCWD) { in path_init() 2417 struct fd f = fdget_raw(nd->dfd); in path_init() 2504 int filename_lookup(int dfd, struct filename *name, unsigned flags, in filename_lookup() argument 2511 set_nameidata(&nd, dfd, name, root); in filename_lookup() [all …]
|
/openbmc/linux/tools/testing/selftests/openat2/ |
H A D | helpers.c | 22 int raw_openat2(int dfd, const char *path, void *how, size_t size) in raw_openat2() argument 24 int ret = syscall(__NR_openat2, dfd, path, how, size); in raw_openat2() 28 int sys_openat2(int dfd, const char *path, struct open_how *how) in sys_openat2() argument 30 return raw_openat2(dfd, path, how, sizeof(*how)); in sys_openat2() 33 int sys_openat(int dfd, const char *path, struct open_how *how) in sys_openat() argument 35 int ret = openat(dfd, path, how->flags, how->mode); in sys_openat() 47 int touchat(int dfd, const char *path) in touchat() argument 49 int fd = openat(dfd, path, O_CREAT, 0700); in touchat() 71 bool fdequal(int fd, int dfd, const char *path) in fdequal() argument 77 dfdpath = fdreadlink(dfd); in fdequal()
|
H A D | resolve_test.c | 49 int dfd, tmpfd; in setup_testdir() local 59 dfd = open(dirname, O_PATH | O_DIRECTORY); in setup_testdir() 60 if (dfd < 0) in setup_testdir() 64 E_mkdirat(dfd, "root", 0755); in setup_testdir() 65 tmpfd = openat(dfd, "root", O_PATH | O_DIRECTORY); in setup_testdir() 68 close(dfd); in setup_testdir() 69 dfd = tmpfd; in setup_testdir() 71 E_symlinkat("/proc/self/exe", dfd, "procexe"); in setup_testdir() 72 E_symlinkat("/proc/self/root", dfd, "procroot"); in setup_testdir() 73 E_mkdirat(dfd, "root", 0755); in setup_testdir() [all …]
|
H A D | rename_attack_test.c | 37 int dfd; in setup_testdir() local 43 dfd = open(dirname, O_PATH | O_DIRECTORY); in setup_testdir() 44 if (dfd < 0) in setup_testdir() 47 E_mkdirat(dfd, "a", 0755); in setup_testdir() 48 E_mkdirat(dfd, "b", 0755); in setup_testdir() 49 E_mkdirat(dfd, "a/c", 0755); in setup_testdir() 51 return dfd; in setup_testdir() 86 int dfd, afd; in test_rename_attack() local 101 dfd = setup_testdir(); in test_rename_attack() 102 afd = openat(dfd, "a", O_PATH); in test_rename_attack() [all …]
|
H A D | helpers.h | 96 int raw_openat2(int dfd, const char *path, void *how, size_t size); 97 int sys_openat2(int dfd, const char *path, struct open_how *how); 98 int sys_openat(int dfd, const char *path, struct open_how *how); 102 int touchat(int dfd, const char *path); 104 bool fdequal(int fd, int dfd, const char *path);
|
/openbmc/u-boot/tools/ |
H A D | imagetool.c | 105 int dfd; in imagetool_save_subimage() local 107 dfd = open(file_name, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, in imagetool_save_subimage() 109 if (dfd < 0) { in imagetool_save_subimage() 115 if (write(dfd, (void *)file_data, file_len) != (ssize_t)file_len) { in imagetool_save_subimage() 118 close(dfd); in imagetool_save_subimage() 122 close(dfd); in imagetool_save_subimage()
|
H A D | aisimage.c | 180 int dfd; in ais_alloc_buffer() local 185 dfd = open(datafile, O_RDONLY|O_BINARY); in ais_alloc_buffer() 186 if (dfd < 0) { in ais_alloc_buffer() 192 if (fstat(dfd, &sbuf) < 0) { in ais_alloc_buffer() 213 close(dfd); in ais_alloc_buffer() 222 int dfd; in ais_copy_image() local 227 dfd = open(datafile, O_RDONLY|O_BINARY); in ais_copy_image() 228 if (dfd < 0) { in ais_copy_image() 234 if (fstat(dfd, &sbuf) < 0) { in ais_copy_image() 240 ptr = mmap(0, sbuf.st_size, PROT_READ, MAP_SHARED, dfd, 0); in ais_copy_image() [all …]
|
H A D | imx8image.c | 299 int dfd; in copy_file_aligned() local 313 dfd = open(datafile, O_RDONLY | O_BINARY); in copy_file_aligned() 314 if (dfd < 0) { in copy_file_aligned() 320 if (fstat(dfd, &sbuf) < 0) { in copy_file_aligned() 329 ptr = mmap(0, sbuf.st_size, PROT_READ, MAP_SHARED, dfd, 0); in copy_file_aligned() 358 close(dfd); in copy_file_aligned() 363 int dfd; in copy_file() local 373 dfd = open(datafile, O_RDONLY | O_BINARY); in copy_file() 374 if (dfd < 0) { in copy_file() 380 if (fstat(dfd, &sbuf) < 0) { in copy_file() [all …]
|
H A D | mkimage.c | 320 int dfd; in main() local 422 dfd = open(params.datafile, O_RDONLY | O_BINARY); in main() 423 if (dfd < 0) { in main() 430 if (fstat(dfd, &sbuf) < 0) { in main() 438 close(dfd); in main() 644 int dfd; in copy_file() local 660 if ((dfd = open(datafile, O_RDONLY|O_BINARY)) < 0) { in copy_file() 666 if (fstat(dfd, &sbuf) < 0) { in copy_file() 672 ptr = mmap(0, sbuf.st_size, PROT_READ, MAP_SHARED, dfd, 0); in copy_file() 739 (void) close (dfd); in copy_file()
|
H A D | imx8mimage.c | 226 int dfd; in copy_file() local 236 dfd = open(datafile, O_RDONLY | O_BINARY); in copy_file() 237 if (dfd < 0) { in copy_file() 243 if (fstat(dfd, &sbuf) < 0) { in copy_file() 249 ptr = mmap(0, sbuf.st_size, PROT_READ, MAP_SHARED, dfd, 0); in copy_file() 293 close(dfd); in copy_file()
|
/openbmc/linux/io_uring/ |
H A D | fs.c | 29 int dfd; member 36 int dfd; member 114 un->dfd = READ_ONCE(sqe->fd); in io_unlinkat_prep() 138 ret = do_rmdir(un->dfd, un->filename); in io_unlinkat() 140 ret = do_unlinkat(un->dfd, un->filename); in io_unlinkat() 164 mkd->dfd = READ_ONCE(sqe->fd); in io_mkdirat_prep() 184 ret = do_mkdirat(mkd->dfd, mkd->filename, mkd->mode); in io_mkdirat()
|
H A D | statx.c | 16 int dfd; member 33 sx->dfd = READ_ONCE(sqe->fd); in io_statx_prep() 62 ret = do_statx(sx->dfd, sx->filename, sx->flags, sx->mask, sx->buffer); in io_statx()
|
H A D | openclose.c | 21 int dfd; member 60 open->dfd = READ_ONCE(sqe->fd); in __io_openat_prep() 135 file = do_filp_open(open->dfd, open->filename, &op); in io_openat2()
|
/openbmc/linux/Documentation/trace/ |
H A D | kprobetrace.rst | 172 p:myprobe do_sys_open dfd=%ax filename=%dx flags=%cx mode=+4($stack) 176 p:myprobe,do_sys_open,dfd=%ax,filename=%dx,flags=%cx,mode=+4($stack) 184 …echo 'p:myprobe do_sys_open dfd=%ax filename=%dx flags=%cx mode=+4($stack)' > /sys/kernel/tracing/… 213 field:unsigned long dfd; offset:20; size:4; signed:0; 219 print fmt: "(%lx) dfd=%lx filename=%lx flags=%lx mode=%lx", REC->__probe_ip, 220 REC->dfd, REC->filename, REC->flags, REC->mode 258 …<...>-1447 [001] 1038282.286875: myprobe: (do_sys_open+0x0/0xd6) dfd=3 filename=7fffd1ec4440 flag… 260 …<...>-1447 [001] 1038282.286885: myprobe: (do_sys_open+0x0/0xd6) dfd=ffffff9c filename=40413c fla… 262 …<...>-1447 [001] 1038282.286969: myprobe: (do_sys_open+0x0/0xd6) dfd=ffffff9c filename=4041c6 fla…
|
/openbmc/linux/include/linux/ |
H A D | syscalls.h | 389 asmlinkage long sys_mknodat(int dfd, const char __user * filename, umode_t mode, 391 asmlinkage long sys_mkdirat(int dfd, const char __user * pathname, umode_t mode); 392 asmlinkage long sys_unlinkat(int dfd, const char __user * pathname, int flag); 419 asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode); 420 asmlinkage long sys_faccessat2(int dfd, const char __user *filename, int mode, 426 asmlinkage long sys_fchmodat(int dfd, const char __user *filename, 428 asmlinkage long sys_fchmodat2(int dfd, const char __user *filename, 430 asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user, 433 asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, 435 asmlinkage long sys_openat2(int dfd, const char __user *filename, [all …]
|
/openbmc/linux/arch/powerpc/platforms/cell/spufs/ |
H A D | coredump.c | 24 static int spufs_ctx_note_size(struct spu_context *ctx, int dfd) in spufs_ctx_note_size() argument 34 sprintf(fullname, "SPU/%d/%s", dfd, name); in spufs_ctx_note_size() 116 struct coredump_params *cprm, int dfd) in spufs_arch_write_note() argument 123 sprintf(fullname, "SPU/%d/%s", dfd, spufs_coredump_read[i].name); in spufs_arch_write_note()
|
/openbmc/linux/Documentation/devicetree/bindings/pinctrl/ |
H A D | mediatek,mt7981-pinctrl.yaml | 88 "dfd" "dfd" 0, 1, 4, 5 101 "dfd_ntrst" "dfd" 8 161 enum: [wa_aice, dfd, jtag, pta, pcm, udi, usb, ant, eth, i2c, led, 183 const: dfd 187 enum: [dfd, dfd_ntrst]
|
/openbmc/linux/kernel/trace/ |
H A D | kprobe_event_gen_test.c | 42 #define KPROBE_GEN_TEST_ARG0 "dfd=%ax" 49 #define KPROBE_GEN_TEST_ARG0 "dfd=%x0" 56 #define KPROBE_GEN_TEST_ARG0 "dfd=%r0" 63 #define KPROBE_GEN_TEST_ARG0 "dfd=%a0"
|
/openbmc/linux/arch/sparc/kernel/ |
H A D | systbls.h | 65 asmlinkage long compat_sys_fstatat64(unsigned int dfd, 98 asmlinkage long compat_sys_fstatat64(unsigned int dfd,
|
/openbmc/linux/tools/testing/selftests/exec/ |
H A D | execveat.c | 263 /* dfd + path */ in run_tests() 269 /* absolute path with nonsense dfd */ in run_tests() 296 /* dfd + path */ in run_tests() 307 /* dfd + path */ in run_tests() 321 /* dfd + path */ in run_tests()
|