Skip to contentSkip to conversation

mptcp: use nlmsg_free instead of kfree_skb

PATCH In review Geliang Tang 3 participants 5 messages Dec 2, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mptcp: use nlmsg_free instead of kfree_skb

Use nlmsg_free() instead of kfree_skb() in pm_netlink.c.

---
 net/mptcp/pm_netlink.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
net/mptcp/pm_netlink.c +4 -4
index 93ae0fc892df..39b0f054f39f 100644
@@ -2091,7 +2091,7 @@ void mptcp_event_addr_removed(const struct mptcp_sock *msk, uint8_t id)
 	return;
 
 nla_put_failure:
-	kfree_skb(skb);
+	nlmsg_free(skb);
 }
 
 void mptcp_event_addr_announced(const struct sock *ssk,
@@ -2148,7 +2148,7 @@ void mptcp_event_addr_announced(const struct sock *ssk,
 	return;
 
 nla_put_failure:
-	kfree_skb(skb);
+	nlmsg_free(skb);
 }
 
 void mptcp_event_pm_listener(const struct sock *ssk,
@@ -2200,7 +2200,7 @@ void mptcp_event_pm_listener(const struct sock *ssk,
 	return;
 
 nla_put_failure:
-	kfree_skb(skb);
+	nlmsg_free(skb);
 }
 
 void mptcp_event(enum mptcp_event_type type, const struct mptcp_sock *msk,
@@ -2258,7 +2258,7 @@ void mptcp_event(enum mptcp_event_type type, const struct mptcp_sock *msk,
 	return;
 
 nla_put_failure:
-	kfree_skb(skb);
+	nlmsg_free(skb);
 }
 
 static const struct genl_small_ops mptcp_pm_ops[] = {
Signature · 1 line
2.35.3
#1 lore raw

Re: mptcp: use nlmsg_free instead of kfree_skb: Tests Results

Hi Geliang,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal (except:
- selftest_mptcp_join): Success! ✅:
- Task: https://cirrus-ci.com/task/6119246869561344
- Summary: https://api.cirrus-ci.com/v1/artifact/task/6119246869561344/summary/summary.txt

- KVM Validation: debug (except:
- selftest_mptcp_join): Success! ✅:
- Task: https://cirrus-ci.com/task/6682196822982656
- Summary: https://api.cirrus-ci.com/v1/artifact/task/6682196822982656/summary/summary.txt

- KVM Validation: debug (only:
- selftest_mptcp_join): Success! ✅:
- Task: https://cirrus-ci.com/task/4641503241830400
- Summary: https://api.cirrus-ci.com/v1/artifact/task/4641503241830400/summary/summary.txt

- KVM Validation: normal (only:
- selftest_mptcp_join): Success! ✅:
- Task: https://cirrus-ci.com/task/5556296916140032
- Summary: https://api.cirrus-ci.com/v1/artifact/task/5556296916140032/summary/summary.txt

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/041d29699a40

If there are some issues, you can reproduce them using the same environment as the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-debug

For more details:

https://github.com/multipath-tcp/mptcp-upstream-virtme-docker

Please note that despite all the efforts that have been already done to have a stable tests suite when executed on a public CI like here, it is possible some reported issues are not due to your modifications. Still, do not hesitate to help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (Tessares)

Reviewed-by on v1 1/1
#2 lore raw
In reply to Geliang Tang

Hi Geliang,

Quoted 1 line · Geliang Tang

Use nlmsg_free() instead of kfree_skb() in pm_netlink.c.

Thank you for the quick follow up!

I suggest to add a bit more text to have a clear explanation about why it is clean-up and not a fix, e.g.

The skb has been created by nlmsg_new(). The proper free should then be done with nlmsg_free().

For the moment, nlmsg_free() is simply calling kfree_skb() so we don't change the behaviour here.

I can modify the commit message when applying the patch, no need to send a v2 ;-)

Cheers,
Matt

Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
#3 lore raw
In reply to Geliang Tang

Hi Geliang,

Quoted 1 line · Geliang Tang

Use nlmsg_free() instead of kfree_skb() in pm_netlink.c.

Now applied in our tree (feat. for net-next) with my RvB and the commit message slightly modified as suggested before (we will still modify it if needed).

New patches for t/upstream:
- 32ad7937c18e: mptcp: use nlmsg_free instead of kfree_skb
- Results: a7affd41927a..7c308902a06c (export)

Tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20221202T110835

Cheers,
Matt

Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
#4 lore raw

Re: mptcp: use nlmsg_free instead of kfree_skb: Tests Results

In reply to Geliang Tang

Hi Geliang,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal (except selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/4858982737641472
- Summary: https://api.cirrus-ci.com/v1/artifact/task/4858982737641472/summary/summary.txt

- KVM Validation: debug (except selftest_mptcp_join):
- Critical: 1 Call Trace(s) ❌:
- Task: https://cirrus-ci.com/task/5421932691062784
- Summary: https://api.cirrus-ci.com/v1/artifact/task/5421932691062784/summary/summary.txt

- KVM Validation: debug (only selftest_mptcp_join):
- Unstable: 1 failed test(s): selftest_mptcp_join 🔴:
- Task: https://cirrus-ci.com/task/6547832597905408
- Summary: https://api.cirrus-ci.com/v1/artifact/task/6547832597905408/summary/summary.txt

- KVM Validation: normal (only selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/5984882644484096
- Summary: https://api.cirrus-ci.com/v1/artifact/task/5984882644484096/summary/summary.txt

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/43fbd526856d

If there are some issues, you can reproduce them using the same environment as the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-debug

For more details:

https://github.com/multipath-tcp/mptcp-upstream-virtme-docker

Please note that despite all the efforts that have been already done to have a stable tests suite when executed on a public CI like here, it is possible some reported issues are not due to your modifications. Still, do not hesitate to help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (Tessares)