Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH] tst_af_alg: Fix control buffer memory leak
@ 2026-09-11  7:53 Andrea Cervesato
  2026-09-11  8:42 ` [LTP] " linuxtestproject.agent
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrea Cervesato @ 2026-09-11  7:53 UTC (permalink / raw)
  To: Linux Test Project

From: Andrea Cervesato <andrea.cervesato@suse.com>

The ancillary control buffer allocated in tst_alg_sendmsg() is never
freed after sendmsg(), leaking memory on repeated calls in the same
process.

Free the buffer once sendmsg() completes.

Fixes: 3cbb963abb9e ("lib/tst_af_alg: add tst_alg_sendmsg()")
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
 lib/tst_af_alg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/tst_af_alg.c b/lib/tst_af_alg.c
index 93757278f..10fb42da5 100644
--- a/lib/tst_af_alg.c
+++ b/lib/tst_af_alg.c
@@ -249,4 +249,6 @@ void tst_alg_sendmsg(int reqfd, const void *data, size_t datalen,
 	}
 
 	SAFE_SENDMSG(datalen, reqfd, &msg, params->msg_flags);
+
+	free(control);
 }

---
base-commit: b8f93f82fd94a598d632ee3785cf664efd97afae
change-id: 20260911-fix_core_leak_astra-e268a19d4658

Best regards,
--  
Andrea Cervesato <andrea.cervesato@suse.com>


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] tst_af_alg: Fix control buffer memory leak
  2026-09-11  7:53 [LTP] [PATCH] tst_af_alg: Fix control buffer memory leak Andrea Cervesato
@ 2026-09-11  8:42 ` linuxtestproject.agent
  2026-09-11  9:43 ` [LTP] [PATCH] " Petr Vorel
  2026-09-11 10:09 ` Andrea Cervesato via ltp
  2 siblings, 0 replies; 4+ messages in thread
From: linuxtestproject.agent @ 2026-09-11  8:42 UTC (permalink / raw)
  To: Andrea Cervesato; +Cc: ltp

Hi Andrea,

On Fri Sep 11 09:53:40 2026 +0200, Andrea Cervesato wrote:
> tst_af_alg: Fix control buffer memory leak

Verdict - Reviewed

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH] tst_af_alg: Fix control buffer memory leak
  2026-09-11  7:53 [LTP] [PATCH] tst_af_alg: Fix control buffer memory leak Andrea Cervesato
  2026-09-11  8:42 ` [LTP] " linuxtestproject.agent
@ 2026-09-11  9:43 ` Petr Vorel
  2026-09-11 10:09 ` Andrea Cervesato via ltp
  2 siblings, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2026-09-11  9:43 UTC (permalink / raw)
  To: Andrea Cervesato; +Cc: Linux Test Project, Eric Biggers

Hi Andrea,

> The ancillary control buffer allocated in tst_alg_sendmsg() is never
> freed after sendmsg(), leaking memory on repeated calls in the same
> process.

> Free the buffer once sendmsg() completes.

Good catch, thanks!

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

> Fixes: 3cbb963abb9e ("lib/tst_af_alg: add tst_alg_sendmsg()")
> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
> ---
>  lib/tst_af_alg.c | 2 ++
>  1 file changed, 2 insertions(+)

> diff --git a/lib/tst_af_alg.c b/lib/tst_af_alg.c
> index 93757278f..10fb42da5 100644
> --- a/lib/tst_af_alg.c
> +++ b/lib/tst_af_alg.c
> @@ -249,4 +249,6 @@ void tst_alg_sendmsg(int reqfd, const void *data, size_t datalen,
>  	}

>  	SAFE_SENDMSG(datalen, reqfd, &msg, params->msg_flags);
> +
> +	free(control);
>  }

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH] tst_af_alg: Fix control buffer memory leak
  2026-09-11  7:53 [LTP] [PATCH] tst_af_alg: Fix control buffer memory leak Andrea Cervesato
  2026-09-11  8:42 ` [LTP] " linuxtestproject.agent
  2026-09-11  9:43 ` [LTP] [PATCH] " Petr Vorel
@ 2026-09-11 10:09 ` Andrea Cervesato via ltp
  2 siblings, 0 replies; 4+ messages in thread
From: Andrea Cervesato via ltp @ 2026-09-11 10:09 UTC (permalink / raw)
  To: Andrea Cervesato; +Cc: Linux Test Project

Merged, Thanks!

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2026-09-11 10:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-11  7:53 [LTP] [PATCH] tst_af_alg: Fix control buffer memory leak Andrea Cervesato
2026-09-11  8:42 ` [LTP] " linuxtestproject.agent
2026-09-11  9:43 ` [LTP] [PATCH] " Petr Vorel
2026-09-11 10:09 ` Andrea Cervesato via ltp

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