All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v5 0/5] Add fchmodat2 testing suite
@ 2024-08-02  8:23 Andrea Cervesato
  2024-08-02  8:23 ` [LTP] [PATCH v5 1/5] Add SAFE_SYMLINKAT macro Andrea Cervesato
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Andrea Cervesato @ 2024-08-02  8:23 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().
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>
---
Changes in v5:
- fchmodat2_01: check for EOPNOTSUPP, added tag and removed kernel
  version in order to let backported feature to be available for testing
- Link to v4: https://lore.kernel.org/r/20240801-fchmodat2-v4-0-7f2f11a53a09@suse.com

Changes in v4:
- add SAFE_FCHMODAT2
- Link to v3: https://lore.kernel.org/r/20240724-fchmodat2-v3-0-1dc7cfc634b8@suse.com

Changes in v3:
- removed fchmodat2.h
- Link to v2: https://lore.kernel.org/r/20240723-fchmodat2-v2-0-e658a98b113e@suse.com

Changes in v2:
- merge first 3 tests into a unique one
- move fchmodat2 in lapi/stat.h
- add test for error checking
- Link to v1: https://lore.kernel.org/r/20240521-fchmodat2-v1-0-191b4a986202@suse.com

---
Andrea Cervesato (5):
      Add SAFE_SYMLINKAT macro
      Add fchmodat2 syscalls definitions
      Add fchmodat2 fallback definition
      Add fchmodat2_01 test
      Add fchmodat2_02 test

 include/lapi/stat.h                                |  16 +++
 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                                   |   3 +
 testcases/kernel/syscalls/fchmodat2/.gitignore     |   2 +
 testcases/kernel/syscalls/fchmodat2/Makefile       |   7 ++
 testcases/kernel/syscalls/fchmodat2/fchmodat2_01.c | 123 +++++++++++++++++++++
 testcases/kernel/syscalls/fchmodat2/fchmodat2_02.c |  68 ++++++++++++
 27 files changed, 264 insertions(+)
---
base-commit: 8422d4680b21e6576da63c677b5d49f46b477df0
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] 17+ messages in thread

end of thread, other threads:[~2024-08-02 10:57 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-02  8:23 [LTP] [PATCH v5 0/5] Add fchmodat2 testing suite Andrea Cervesato
2024-08-02  8:23 ` [LTP] [PATCH v5 1/5] Add SAFE_SYMLINKAT macro Andrea Cervesato
2024-08-02  9:47   ` Petr Vorel
2024-08-02  9:48     ` Cyril Hrubis
2024-08-02 10:02       ` Petr Vorel
2024-08-02 10:39       ` Andrea Cervesato via ltp
2024-08-02  8:23 ` [LTP] [PATCH v5 2/5] Add fchmodat2 syscalls definitions Andrea Cervesato
2024-08-02  9:49   ` Petr Vorel
2024-08-02  8:23 ` [LTP] [PATCH v5 3/5] Add fchmodat2 fallback definition Andrea Cervesato
2024-08-02  9:55   ` Petr Vorel
2024-08-02 10:38     ` Andrea Cervesato via ltp
2024-08-02 10:57       ` Petr Vorel
2024-08-02  8:23 ` [LTP] [PATCH v5 4/5] Add fchmodat2_01 test Andrea Cervesato
2024-08-02  8:47   ` Petr Vorel
2024-08-02  8:23 ` [LTP] [PATCH v5 5/5] Add fchmodat2_02 test Andrea Cervesato
2024-08-02 10:33   ` Petr Vorel
2024-08-02  9:58 ` [LTP] [PATCH v5 0/5] Add fchmodat2 testing suite Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.