public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 0/5] Add fchmodat2 testing suite
@ 2024-05-21  6:15 Andrea Cervesato
  2024-05-21  6:15 ` [LTP] [PATCH 1/5] Add SAFE_SYMLINKAT macro Andrea Cervesato
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Andrea Cervesato @ 2024-05-21  6:15 UTC (permalink / raw)
  To: ltp

This is a patch-set that implements fchmodat2() syscall coverage.
fchmodat2() has been added in kernel 6.6 in order to support
AT_SYMLINK_NOFOLLOW and AT_EMPTY_PATH in fchmodat().

- fchmodat2_01 tests AT_SYMLINK_NOFOLLOW on regular file
- fchmodat2_02 tests AT_SYMLINK_NOFOLLOW on symbolic file
- fchmodat2_03 tests AT_EMPTY_PATH

There's no man pages yet, so please take the following links as
main documentation along with kernel source code:

https://www.phoronix.com/news/fchmodat2-For-Linux-6.6
https://lore.kernel.org/lkml/20230824-frohlocken-vorabend-725f6fdaad50@brauner/

***********
* WARNING *
***********

fchmodat2_02 fails with EOPNOTSUPP because of missing feature.
According to documentation, the feature has been implemented in
kernel 6.6, but __in reality__ AT_SYMLINK_NOFOLLOW is not working
on symbolic files. Also kselftests, which are meant to test the
functionality, are not working and they are treating fchmodat2()
syscall failure as SKIP. Please take a look at the following code
before reviewing:

https://github.com/torvalds/linux/blob/8f6a15f095a63a83b096d9b29aaff4f0fbe6f6e6/tools/testing/selftests/fchmodat2/fchmodat2_test.c#L123

Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
Andrea Cervesato (5):
      Add SAFE_SYMLINKAT macro
      Add fchmodat2 syscall definitions
      Add fchmodat2_01 test
      Add fchmodat2_02 test
      Add fchmodat2_03 test

 include/lapi/syscalls/aarch64.in                   |  1 +
 include/lapi/syscalls/arc.in                       |  1 +
 include/lapi/syscalls/arm.in                       |  1 +
 include/lapi/syscalls/hppa.in                      |  1 +
 include/lapi/syscalls/i386.in                      |  1 +
 include/lapi/syscalls/ia64.in                      |  1 +
 include/lapi/syscalls/loongarch.in                 |  1 +
 include/lapi/syscalls/mips_n32.in                  |  1 +
 include/lapi/syscalls/mips_n64.in                  |  1 +
 include/lapi/syscalls/mips_o32.in                  |  1 +
 include/lapi/syscalls/powerpc.in                   |  1 +
 include/lapi/syscalls/powerpc64.in                 |  1 +
 include/lapi/syscalls/s390.in                      |  1 +
 include/lapi/syscalls/s390x.in                     |  1 +
 include/lapi/syscalls/sh.in                        |  1 +
 include/lapi/syscalls/sparc.in                     |  1 +
 include/lapi/syscalls/sparc64.in                   |  1 +
 include/lapi/syscalls/x86_64.in                    |  1 +
 include/safe_macros_fn.h                           |  4 ++
 include/tst_safe_macros.h                          |  3 ++
 lib/safe_macros.c                                  | 20 +++++++
 runtest/syscalls                                   |  4 ++
 testcases/kernel/syscalls/fchmodat2/.gitignore     |  3 ++
 testcases/kernel/syscalls/fchmodat2/Makefile       |  7 +++
 testcases/kernel/syscalls/fchmodat2/fchmodat2.h    | 32 +++++++++++
 testcases/kernel/syscalls/fchmodat2/fchmodat2_01.c | 54 +++++++++++++++++++
 testcases/kernel/syscalls/fchmodat2/fchmodat2_02.c | 63 ++++++++++++++++++++++
 testcases/kernel/syscalls/fchmodat2/fchmodat2_03.c | 46 ++++++++++++++++
 28 files changed, 254 insertions(+)
---
base-commit: e644691d30c3948a9788b735c51e09ca849ea47f
change-id: 20240517-fchmodat2-5b82867d71fc

Best regards,
-- 
Andrea Cervesato <andrea.cervesato@suse.com>


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-07-11 12:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-21  6:15 [LTP] [PATCH 0/5] Add fchmodat2 testing suite Andrea Cervesato
2024-05-21  6:15 ` [LTP] [PATCH 1/5] Add SAFE_SYMLINKAT macro Andrea Cervesato
2024-05-21  6:15 ` [LTP] [PATCH 2/5] Add fchmodat2 syscall definitions Andrea Cervesato
2024-05-21  6:15 ` [LTP] [PATCH 3/5] Add fchmodat2_01 test Andrea Cervesato
2024-07-11 12:12   ` Cyril Hrubis
2024-05-21  6:15 ` [LTP] [PATCH 4/5] Add fchmodat2_02 test Andrea Cervesato
2024-07-11 12:16   ` Cyril Hrubis
2024-05-21  6:15 ` [LTP] [PATCH 5/5] Add fchmodat2_03 test Andrea Cervesato
2024-07-11 12:18   ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox