lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6c9f3c40-9a41-442e-9254-d7b1e37cf78a@kernel.org>
Date: Fri, 30 Jan 2026 11:05:51 +0100
From: Matthieu Baerts <matttbe@...nel.org>
To: Mat Martineau <martineau@...nel.org>, Geliang Tang <geliang@...nel.org>,
 "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 Simon Horman <horms@...nel.org>, Neal Cardwell <ncardwell@...gle.com>,
 Kuniyuki Iwashima <kuniyu@...gle.com>, David Ahern <dsahern@...nel.org>,
 Shuah Khan <shuah@...nel.org>
Cc: netdev@...r.kernel.org, mptcp@...ts.linux.dev,
 linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH net-next 5/6] selftests: mptcp: add splice io mode

Hello,

On 29/01/2026 20:23, Matthieu Baerts (NGI0) wrote:
> From: Geliang Tang <tanggeliang@...inos.cn>
> 
> This patch adds a new 'splice' io mode for mptcp_connect to test
> the newly added read_sock() and splice_read() functions of MPTCP.
> 
> do_splice() efficiently transfers data directly between two file
> descriptors (infd and outfd) without copying to userspace, using
> Linux's splice() system call.
> 
> Usage:
> 	./mptcp_connect.sh -m splice

(...)

> diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/testing/selftests/net/mptcp/mptcp_connect.c
> index 10f6f99cfd4e..1c4fe60089a2 100644
> --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c
> +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c

(...)

> @@ -935,6 +936,55 @@ static int copyfd_io_sendfile(int infd, int peerfd, int outfd,
>  	return err;
>  }
>  
> +static int do_splice(const int infd, const int outfd, const size_t len,
> +		     struct wstate *winfo)
> +{
> +	int pipefd[2];
> +	ssize_t bytes;
> +	int err;
> +
> +	err = pipe(pipefd);
> +	if (err)
> +		return err;
> +
> +	while ((bytes = splice(infd, NULL, pipefd[1], NULL,
> +			       len - winfo->total_len,
> +			       SPLICE_F_MOVE | SPLICE_F_MORE)) > 0) {
> +		splice(pipefd[0], NULL, outfd, NULL, bytes,
> +		       SPLICE_F_MOVE | SPLICE_F_MORE);

The review assistant rightly spotted errors with splice() are simply...
ignored! Technically, the script launching this tool will check the
integrity of the transfer, but still, that's clearly not a good practice!

Sorry for the noise, I didn't spot that when sending these patches. I
will fix the issues and send a v2 later.

pw-bot: cr

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ