Skip to content

Commit 1200385

Browse files
committed
Add support for file_getattr and file_setattr syscalls
The file_getattr()/file_setattr() are used to set extended file attributes. These syscalls take dirfd in conjunction with the pathname argument. The syscall then operates on inode opened according to openat(2) semantics. This is an alternative to FS_IOC_FSGETXATTR/FS_IOC_FSSETXATTR ioctl with a difference that file don't need to be open as file can be referenced with a path instead of fd. Source: https://lwn.net/Articles/1027795/
1 parent 002a620 commit 1200385

File tree

11 files changed

+23
-0
lines changed

11 files changed

+23
-0
lines changed

auparse/interpret.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2567,6 +2567,10 @@ static const char* print_a0(auparse_state_t *au, const char* val,
25672567
return print_dirfd(val);
25682568
else if (strcmp(sys, "futimensat") == 0)
25692569
return print_dirfd(val);
2570+
else if (strcmp(sys, "file_getattr") == 0)
2571+
return print_dirfd(val);
2572+
else if (strcmp(sys, "file_setattr") == 0)
2573+
return print_dirfd(val);
25702574
}
25712575
else if (*sys == 'u') {
25722576
if (strcmp(sys, "unshare") == 0)

auparse/normalize_syscall_map.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ _S(NORM_FILE_CHATTR, "setxattrat")
4343
_S(NORM_FILE_CHATTR, "fsetxattr")
4444
_S(NORM_FILE_CHATTR, "lsetxattr")
4545
_S(NORM_FILE_CHATTR, "mount_setattr")
46+
_S(NORM_FILE_CHATTR, "file_setattr")
4647
_S(NORM_FILE_DIR, "mkdir")
4748
_S(NORM_FILE_DIR, "mkdirat")
4849
_S(NORM_FILE_MOUNT, "fsconfig")

lib/aarch64_table.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,3 +343,5 @@ _S(464, "getxattrat")
343343
_S(465, "listxattrat")
344344
_S(466, "removexattrat")
345345
_S(467, "open_tree_attr")
346+
_S(468, "file_getattr")
347+
_S(469, "file_setattr")

lib/arm_table.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,3 +453,5 @@ _S(464, "getxattrat")
453453
_S(465, "listxattrat")
454454
_S(466, "removexattrat")
455455
_S(467, "open_tree_attr")
456+
_S(468, "file_getattr")
457+
_S(469, "file_setattr")

lib/i386_table.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,3 +479,5 @@ _S(464, "getxattrat")
479479
_S(465, "listxattrat")
480480
_S(466, "removexattrat")
481481
_S(467, "open_tree_attr")
482+
_S(468, "file_getattr")
483+
_S(469, "file_setattr")

lib/ppc_table.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,3 +471,5 @@ _S(464, "getxattrat")
471471
_S(465, "listxattrat")
472472
_S(466, "removexattrat")
473473
_S(467, "open_tree_attr")
474+
_S(468, "file_getattr")
475+
_S(469, "file_setattr")

lib/riscv32_table.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,3 +334,5 @@ _S(464, "getxattrat")
334334
_S(465, "listxattrat")
335335
_S(466, "removexattrat")
336336
_S(467, "open_tree_attr")
337+
_S(468, "file_getattr")
338+
_S(469, "file_setattr")

lib/riscv64_table.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,3 +344,5 @@ _S(464, "getxattrat")
344344
_S(465, "listxattrat")
345345
_S(466, "removexattrat")
346346
_S(467, "open_tree_attr")
347+
_S(468, "file_getattr")
348+
_S(469, "file_setattr")

lib/s390_table.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,3 +460,5 @@ _S(464, "getxattrat")
460460
_S(465, "listxattrat")
461461
_S(466, "removexattrat")
462462
_S(467, "open_tree_attr")
463+
_S(468, "file_getattr")
464+
_S(469, "file_setattr")

lib/s390x_table.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,3 +406,5 @@ _S(464, "getxattrat")
406406
_S(465, "listxattrat")
407407
_S(466, "removexattrat")
408408
_S(467, "open_tree_attr")
409+
_S(468, "file_getattr")
410+
_S(469, "file_setattr")

0 commit comments

Comments
 (0)