git: b27865547aea - stable/13 - linux: improve reporting for unsupported syscall flags
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 17 Jun 2022 19:31:59 UTC
The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=b27865547aeac03deacf3015f6033cd091b282c5 commit b27865547aeac03deacf3015f6033cd091b282c5 Author: Edward Tomasz Napierala <trasz@FreeBSD.org> AuthorDate: 2021-06-15 09:18:04 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2022-06-17 19:30:18 +0000 linux: improve reporting for unsupported syscall flags Filter out the flags we do support; previously we would print out the flag value verbatim. Reviewed By: dchagin Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D30693 (cherry picked from commit 9d167945e8409c739442a02e3fbacb3bcdcc3306) --- sys/compat/linux/linux_file.c | 7 ++++--- sys/compat/linux/linux_stats.c | 21 ++++++++++++--------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index a5ab3506767e..013c435756fb 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -1757,10 +1757,11 @@ int linux_fchownat(struct thread *td, struct linux_fchownat_args *args) { char *path; - int error, dfd, flag; + int error, dfd, flag, unsupported; - if (args->flag & ~(LINUX_AT_SYMLINK_NOFOLLOW | LINUX_AT_EMPTY_PATH)) { - linux_msg(td, "fchownat unsupported flag 0x%x", args->flag); + unsupported = args->flag & ~(LINUX_AT_SYMLINK_NOFOLLOW | LINUX_AT_EMPTY_PATH); + if (unsupported != 0) { + linux_msg(td, "fchownat unsupported flag 0x%x", unsupported); return (EINVAL); } diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c index 4e6304500a8b..97bace941943 100644 --- a/sys/compat/linux/linux_stats.c +++ b/sys/compat/linux/linux_stats.c @@ -663,11 +663,12 @@ int linux_fstatat64(struct thread *td, struct linux_fstatat64_args *args) { char *path; - int error, dfd, flag; + int error, dfd, flag, unsupported; struct stat buf; - if (args->flag & ~(LINUX_AT_SYMLINK_NOFOLLOW | LINUX_AT_EMPTY_PATH)) { - linux_msg(td, "fstatat64 unsupported flag 0x%x", args->flag); + unsupported = args->flag & ~(LINUX_AT_SYMLINK_NOFOLLOW | LINUX_AT_EMPTY_PATH); + if (unsupported != 0) { + linux_msg(td, "fstatat64 unsupported flag 0x%x", unsupported); return (EINVAL); } flag = (args->flag & LINUX_AT_SYMLINK_NOFOLLOW) ? @@ -696,11 +697,12 @@ int linux_newfstatat(struct thread *td, struct linux_newfstatat_args *args) { char *path; - int error, dfd, flag; + int error, dfd, flag, unsupported; struct stat buf; - if (args->flag & ~(LINUX_AT_SYMLINK_NOFOLLOW | LINUX_AT_EMPTY_PATH)) { - linux_msg(td, "fstatat unsupported flag 0x%x", args->flag); + unsupported = args->flag & ~(LINUX_AT_SYMLINK_NOFOLLOW | LINUX_AT_EMPTY_PATH); + if (unsupported != 0) { + linux_msg(td, "fstatat unsupported flag 0x%x", unsupported); return (EINVAL); } @@ -769,11 +771,12 @@ int linux_statx(struct thread *td, struct linux_statx_args *args) { char *path; - int error, dirfd, flags; + int error, dirfd, flags, unsupported; struct stat buf; - if (args->flags & ~(LINUX_AT_SYMLINK_NOFOLLOW | LINUX_AT_EMPTY_PATH)) { - linux_msg(td, "statx unsupported flags 0x%x", args->flags); + unsupported = args->flags & ~(LINUX_AT_SYMLINK_NOFOLLOW | LINUX_AT_EMPTY_PATH); + if (unsupported != 0) { + linux_msg(td, "statx unsupported flags 0x%x", unsupported); return (EINVAL); }