Hi Miao,
On Sat, 2024-08-24 at 03:07 +0800, Miao Wang via B4 Relay via Valgrind-
developers wrote:
> From: Miao Wang <sha...@gm...>
>
> statx(fd, NULL, AT_EMPTY_PATH) is supported since Linux 6.11 and this
> patch addes the support to valgrind, so that it won't complain when
> NULL is used as |filename| and |flags| includes AT_EMPTY_PATH.
>
> Ref: commit 0ef625bba6fb ("vfs: support statx(..., NULL, AT_EMPTY_PATH, ...)")
Thanks for also creating a bug for this:
https://bugs.kde.org/show_bug.cgi?id=433641
I reviewed pushed it (with one small commit message change
addes -> adds.
Cheers,
Mark
> Signed-off-by: Miao Wang <sha...@gm...>
> ---
> coregrind/m_syswrap/syswrap-linux.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
> index 9f3c51c17..453385599 100644
> --- a/coregrind/m_syswrap/syswrap-linux.c
> +++ b/coregrind/m_syswrap/syswrap-linux.c
> @@ -4209,8 +4209,12 @@ PRE(sys_statx)
> // in which it passes NULL for both filename and buf, and then looks at the
> // return value, so as to determine whether or not this syscall is supported.
> Bool both_filename_and_buf_are_null = ARG2 == 0 && ARG5 == 0;
> + Bool statx_null_path = (ARG2 == 0) && (ARG3 & VKI_AT_EMPTY_PATH);
> if (!both_filename_and_buf_are_null) {
> - PRE_MEM_RASCIIZ( "statx(filename)", ARG2 );
> + // Since Linux 6.11, the kernel allows passing a NULL filename when
> + // the AT_EMPTY_PATH flag is set.
> + if (!statx_null_path)
> + PRE_MEM_RASCIIZ( "statx(filename)", ARG2 );
> PRE_MEM_WRITE( "statx(buf)", ARG5, sizeof(struct vki_statx) );
> }
> }
>
> ---
> base-commit: 61e44a4aef8775b925a7a91f403ebd7f4f6670a4
> change-id: 20240824-statx-null-path-8eec6e0da3bc
>
> Best regards,
|