MPTCP Linux Development
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Geliang Tang <geliang@kernel.org>, mptcp@lists.linux.dev
Cc: Geliang Tang <tanggeliang@kylinos.cn>
Subject: Re: [PATCH mptcp-net v2 2/3] selftests: mptcp: close IPC descriptor on server side
Date: Wed, 3 Sep 2025 13:57:14 +0200	[thread overview]
Message-ID: <d512f8fc-a0ac-4c23-9a13-0b5c4e1ed20f@kernel.org> (raw)
In-Reply-To: <64f5ec5170dd363b19af13fd127a77baa8288104.1756872050.git.geliang@kernel.org>

Hi Geliang,

On 03/09/2025 06:08, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> The client-side function 'connect_one_server()' correctly closes the IPC
> descriptor (a pipe or UNIX socket) after use. However, the server-side
> functions 'process_one_client()' in both 'mptcp_sockopt.c' and 'mptcp_inq.c'
> were missing the corresponding 'close()' call for their IPC descriptors.
> 
> This omission could lead to resource leaks (file descriptors) in the test
> server processes over time.
> 
> This patch adds the missing 'close(pipefd)' and 'close(unixfd)' calls in the
> server-side code, ensuring symmetric and correct resource cleanup.

I don't know if we need such patch. I mean: yes, that's better to close
such FD before closing the application, but then:

- it is strange to close it in the middle of a function
(process_one_client()), and not where it has been created (main())

- if I'm not mistaken, unixfds[0] / pipefds[0] are not closed in the
server process.

So if you really want to fix that, I think it would be better to close
all these unix FD in the 'main()' function, no?

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


  reply	other threads:[~2025-09-03 11:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-03  4:08 [PATCH mptcp-net v2 0/3] misc fixes for sockopt selftests Geliang Tang
2025-09-03  4:08 ` [PATCH mptcp-net v2 1/3] selftests: mptcp: close server file descriptor Geliang Tang
2025-09-03  4:08 ` [PATCH mptcp-net v2 2/3] selftests: mptcp: close IPC descriptor on server side Geliang Tang
2025-09-03 11:57   ` Matthieu Baerts [this message]
2025-09-03 14:48     ` Matthieu Baerts
2025-09-04  8:26     ` Geliang Tang
2025-09-10 17:00       ` Matthieu Baerts
2025-09-11  9:13         ` Geliang Tang
2025-09-11  9:43           ` Matthieu Baerts
2025-09-03  4:08 ` [PATCH mptcp-net v2 3/3] selftests: mptcp: sockopt: fix error messages Geliang Tang
2025-09-03 15:25   ` Matthieu Baerts
2025-09-03  6:10 ` [PATCH mptcp-net v2 0/3] misc fixes for sockopt selftests MPTCP CI

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d512f8fc-a0ac-4c23-9a13-0b5c4e1ed20f@kernel.org \
    --to=matttbe@kernel.org \
    --cc=geliang@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=tanggeliang@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox