Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: free the ECDH tfm when a sample fails
@ 2026-11-04  2:53 Wentao Liang
  2026-11-04  7:11 ` Krzysztof Kozlowski
  2026-11-04  8:43 ` bluez.test.bot
  0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2026-11-04  2:53 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz; +Cc: linux-bluetooth

test_ecdh() allocates a KPP transform, then runs three samples. If a
sample fails, the function jumps to the done label, which only fills the
debugfs buffer. The transform is freed only on the success path, so any
sample failure leaks it.

Add a label that frees the transform and use it from the three sample
failure paths.

Fixes: 47eb2ac80918 ("Bluetooth: move ecdh allocation outside of ecdh_helper")
Cc: stable@vger.kernel.org
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 net/bluetooth/selftest.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/net/bluetooth/selftest.c b/net/bluetooth/selftest.c
index cdfc40e0016b..b91f7559d8fd 100644
--- a/net/bluetooth/selftest.c
+++ b/net/bluetooth/selftest.c
@@ -214,31 +214,32 @@ static int __init test_ecdh(void)
 			       dhkey_1);
 	if (err) {
 		BT_ERR("ECDH sample 1 failed");
-		goto done;
+		goto free_tfm;
 	}
 
 	err = test_ecdh_sample(tfm, priv_a_2, priv_b_2, pub_a_2, pub_b_2,
 			       dhkey_2);
 	if (err) {
 		BT_ERR("ECDH sample 2 failed");
-		goto done;
+		goto free_tfm;
 	}
 
 	err = test_ecdh_sample(tfm, priv_a_3, priv_a_3, pub_a_3, pub_a_3,
 			       dhkey_3);
 	if (err) {
 		BT_ERR("ECDH sample 3 failed");
-		goto done;
+		goto free_tfm;
 	}
 
-	crypto_free_kpp(tfm);
-
 	rettime = ktime_get();
 	delta = ktime_sub(rettime, calltime);
 	duration = (unsigned long long) ktime_to_ns(delta) >> 10;
 
 	BT_INFO("ECDH test passed in %llu usecs", duration);
 
+free_tfm:
+	crypto_free_kpp(tfm);
+
 done:
 	if (!err)
 		snprintf(test_ecdh_buffer, sizeof(test_ecdh_buffer),
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Bluetooth: free the ECDH tfm when a sample fails
  2026-11-04  2:53 [PATCH] Bluetooth: free the ECDH tfm when a sample fails Wentao Liang
@ 2026-11-04  7:11 ` Krzysztof Kozlowski
  2026-11-04  8:43 ` bluez.test.bot
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2026-11-04  7:11 UTC (permalink / raw)
  To: Wentao Liang; +Cc: Marcel Holtmann, linux-bluetooth, Luiz Augusto von Dentz


On Wed, 04 Nov 2026 02:53:36 +0000, Wentao Liang wrote:
> test_ecdh() allocates a KPP transform, then runs three samples. If a
> sample fails, the function jumps to the done label, which only fills the
> debugfs buffer. The transform is freed only on the success path, so any
> sample failure leaks it.
> 
> Add a label that frees the transform and use it from the three sample
> failure paths.
> 
> Fixes: 47eb2ac80918 ("Bluetooth: move ecdh allocation outside of ecdh_helper")
> Cc: stable@vger.kernel.org
> Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
>  net/bluetooth/selftest.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 

Multiple things here:
1. Your team ignored completely previous feedback. Multiple times.

2. You use multiple identities with this email address, thus I doubt that we
   speak with an actual person.

3. Your bot does not even bother running checkpatch, right?

4. Nothing of this was reproduced nor tested.

5. Finally, the same feedback:
You sent multiple independent patches, to multiple independent
subsystems. The amount of these patches clearly suggest this was
AI generated and most likely not tested.

More importantly, you sent all this work without properly organizing
relevant patches into patchsets. This makes reviewing difficult
and might cause multiple reviewers to address the same issue.
Replying to the entire set is impossible and requires handling each
patch independently, instead of applying or discarding the set.
Maintainers also won't see the bigger picture of your work. Quite
worrying.

This is on the verge of hostile patch: bomb us with so many
contributions, we won't be able to handle them in efficient manner,
like responding ONCE to ask you to slow down.  Considering all this
is untested and LLM generated, I have even more doubts whether this
should be considered for review.

Please read kernel documentation BEFORE posting more work. It will
explain you how to identify subsystems, how to organize your work per
subsystem (so a patchset grouping multiple patches with a short cover
letter), how to document the issue discovery method and what was
or was not tested.

Best regards,
Krzysztof





^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: Bluetooth: free the ECDH tfm when a sample fails
  2026-11-04  2:53 [PATCH] Bluetooth: free the ECDH tfm when a sample fails Wentao Liang
  2026-11-04  7:11 ` Krzysztof Kozlowski
@ 2026-11-04  8:43 ` bluez.test.bot
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2026-11-04  8:43 UTC (permalink / raw)
  To: linux-bluetooth, vulab

[-- Attachment #1: Type: text/plain, Size: 1942 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1201243/

---Test result---

Test Summary:
CheckPatch                    FAIL      0.71 seconds
VerifyFixes                   PASS      0.11 seconds
VerifySignedoff               PASS      0.11 seconds
GitLint                       PASS      0.30 seconds
SubjectPrefix                 PASS      0.11 seconds
BuildKernel                   PASS      30.44 seconds
CheckAllWarning               PASS      34.64 seconds
CheckSparse                   PASS      37.27 seconds
BuildKernel32                 PASS      30.29 seconds
CheckKernelLLVM               PASS      32.11 seconds
TestRunnerSetup               PASS      733.77 seconds
TestRunner_smp-tester         PASS      5.51 seconds
IncrementalBuild              PASS      28.10 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
Bluetooth: free the ECDH tfm when a sample fails
WARNING: Non-standard signature: Assisted-by:
#91: 
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex

ERROR: Unrecognized email address: 'DeepSeek-V4.1-Flash and OpenAI Codex'
#91: 
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex

total: 1 errors, 1 warnings, 0 checks, 37 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

/home/runner/work/bluetooth-next/bluetooth-next/src/patch/14942805.patch has style problems, please review.

NOTE: Ignored message types: UNKNOWN_COMMIT_ID

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.




https://github.com/bluez/bluetooth-next/pull/1059

---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-04  8:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04  2:53 [PATCH] Bluetooth: free the ECDH tfm when a sample fails Wentao Liang
2026-11-04  7:11 ` Krzysztof Kozlowski
2026-11-04  8:43 ` bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox