From: Matthieu Baerts <matttbe@kernel.org>
To: Mat Martineau <martineau@kernel.org>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-net 0/9] net: sysctl: avoid using current->nsproxy
Date: Wed, 8 Jan 2025 12:57:48 +0100 [thread overview]
Message-ID: <e0a09148-2b5a-43e3-941b-e9bc381a424c@kernel.org> (raw)
In-Reply-To: <d79d6baa-7215-a7f3-df35-c802fafb073e@kernel.org>
Hi Mat,
On 08/01/2025 02:49, Mat Martineau wrote:
> On Tue, 7 Jan 2025, Matthieu Baerts (NGI0) wrote:
>
>> As pointed out by Al Viro and Eric Dumazet in [1], using the 'net'
>> structure via 'current' is not recommended for different reasons:
>>
>> - Inconsistency: getting info from the reader's/writer's netns vs only
>> from the opener's netns.
>>
>> - current->nsproxy can be NULL in some cases, resulting in an 'Oops'
>> (null-ptr-deref), e.g. when the current task is exiting, as spotted by
>> syzbot [1] using acct(2).
>>
>> The 'net' or 'pernet' structure can be obtained from the table->data
>> using container_of().
>>
>> Note that table->data could also be used directly in more places, but
>> that would increase the size of this fix to replace all accesses via
>> 'net'.
>>
>> Patches 2-9 remove access of net via current->nsproxy in sysfs handlers
>> in MPTCP, SCTP and RDS. There are multiple patches to ease the
>> backports.
>>
>> Patch 1 is not directly linked to this, but it is a small fix for MPTCP
>> available_schedulers sysctl knob to explicitly mark it as read-only.
>>
>> Please note that this series does not address Al's comment [2]. In SCTP,
>> some sysctl knobs set other sysfs-exposed variables for the min/max: two
>> processes could then write two linked values at the same time, resulting
>> in new values being outside the new boundaries.
>
>
> Thanks Matthieu,
>
> The mptcp patches (1-3) LGTM:
>
> Reviewed-by: Mat Martineau <martineau@kernel.org>
>
>
> The sctp and rds patches look fine as well.
Thank you for this review!
Patches are now in our tree (fixes for -net) with your RvB tag on the 3
first ones. I will upstream them later on today.
New patches for t/upstream-net and t/upstream:
- 968e9bb5a4cd: mptcp: sysctl: avail sched: remove write access
- eda363130f80: mptcp: sysctl: sched: avoid using current->nsproxy
- c838529f87ee: mptcp: sysctl: blackhole timeout: avoid using
current->nsproxy
- fb1a7a8fb16c: sctp: sysctl: cookie_hmac_alg: avoid using current->nsproxy
- a18c9552dca0: sctp: sysctl: rto_min/max: avoid using current->nsproxy
- 8408f9182e52: sctp: sysctl: auth_enable: avoid using current->nsproxy
- c45cb99c9aa0: sctp: sysctl: udp_port: avoid using current->nsproxy
- 3df3f684ee7e: sctp: sysctl: plpmtud_probe_interval: avoid using
current->nsproxy
- a77b912deb35: rds: sysctl: rds_tcp_{rcv,snd}buf: avoid using
current->nsproxy
- Results: bd3d4b1ab1bc..d66993cd4a59 (export-net)
- Results: ebe8ebeee62e..f289bc80702c (export)
Tests are now in progress:
- export-net:
https://github.com/multipath-tcp/mptcp_net-next/commit/6c101bff7e1613c0087472d2ee78c986e221435e/checks
- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/0e96d0da96b041f087c5c0b46bc34978572ccffe/checks
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
prev parent reply other threads:[~2025-01-08 11:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 17:09 [PATCH mptcp-net 0/9] net: sysctl: avoid using current->nsproxy Matthieu Baerts (NGI0)
2025-01-07 17:09 ` [PATCH mptcp-net 1/9] mptcp: sysctl: avail sched: remove write access Matthieu Baerts (NGI0)
2025-01-07 17:09 ` [PATCH mptcp-net 2/9] mptcp: sysctl: sched: avoid using current->nsproxy Matthieu Baerts (NGI0)
2025-01-07 17:09 ` [PATCH mptcp-net 3/9] mptcp: sysctl: blackhole timeout: " Matthieu Baerts (NGI0)
2025-01-07 17:09 ` [PATCH mptcp-net 4/9] sctp: sysctl: cookie_hmac_alg: " Matthieu Baerts (NGI0)
2025-01-07 17:09 ` [PATCH mptcp-net 5/9] sctp: sysctl: rto_min/max: " Matthieu Baerts (NGI0)
2025-01-07 17:09 ` [PATCH mptcp-net 6/9] sctp: sysctl: auth_enable: " Matthieu Baerts (NGI0)
2025-01-07 17:09 ` [PATCH mptcp-net 7/9] sctp: sysctl: udp_port: " Matthieu Baerts (NGI0)
2025-01-07 17:09 ` [PATCH mptcp-net 8/9] sctp: sysctl: plpmtud_probe_interval: " Matthieu Baerts (NGI0)
2025-01-07 17:09 ` [PATCH mptcp-net 9/9] rds: sysctl: rds_tcp_{rcv,snd}buf: " Matthieu Baerts (NGI0)
2025-01-07 18:23 ` [PATCH mptcp-net 0/9] net: sysctl: " MPTCP CI
2025-01-08 1:49 ` Mat Martineau
2025-01-08 11:57 ` Matthieu Baerts [this message]
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=e0a09148-2b5a-43e3-941b-e9bc381a424c@kernel.org \
--to=matttbe@kernel.org \
--cc=martineau@kernel.org \
--cc=mptcp@lists.linux.dev \
/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