[LTP] [PATCH 1/3] Update statmount fallback definitions

Cyril Hrubis chrubis@suse.cz
Fri Jul 25 15:47:16 CEST 2025


Hi!
> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
> ---
>  include/lapi/mount.h | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/include/lapi/mount.h b/include/lapi/mount.h
> index aea6bca77ac0c52cbccb892cbd0a205994ab19be..0f7bb5e4327f64e2b0c96511845e86a6c6af8221 100644
> --- a/include/lapi/mount.h
> +++ b/include/lapi/mount.h
> @@ -51,6 +51,7 @@ struct mnt_id_req {
>  	uint32_t spare;
>  	uint64_t mnt_id;
>  	uint64_t param;
> +	uint64_t mnt_ns_id;
>  };
>  #endif

This change does not seem to be needed.

Actually when I was looking at the listmount04 test, we pass
MNT_ID_REQ_SIZE_VER0 to the syscall but use sizeof(struct mnt_id_req)
which may mean that we would allocate more bytes than strictly required
and we may not be able to catch write access after the buffer. I suppose
that regardless of this addtion we should do:

diff --git a/testcases/kernel/syscalls/listmount/listmount04.c b/testcases/kernel/syscalls/listmount/listmount04.c
index 503346de8..a52bad064 100644
--- a/testcases/kernel/syscalls/listmount/listmount04.c
+++ b/testcases/kernel/syscalls/listmount/listmount04.c
@@ -135,7 +135,7 @@ static struct tst_test test = {
        .tcnt = ARRAY_SIZE(tcases),
        .min_kver = "6.8",
        .bufs = (struct tst_buffers []) {
-               { &request, .size = sizeof(struct mnt_id_req) },
+               { &request, .size = MNT_ID_REQ_SIZE_VER0 },
                {},
        },
 };


Apart from that the patchset looks good to me:

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list