Linux Test Project
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: Linux Test Project <ltp@lists.linux.it>,
	Eric Biggers <ebiggers@google.com>
Subject: Re: [LTP] [PATCH] tst_af_alg: Fix control buffer memory leak
Date: Fri, 11 Sep 2026 11:43:45 +0200	[thread overview]
Message-ID: <20260911094345.GC1435339@pevik> (raw)
In-Reply-To: <20260911-fix_core_leak_astra-v1-1-bc5cb35a182a@suse.com>

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

  parent reply	other threads:[~2026-09-11  9:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2026-09-11 10:09 ` [LTP] [PATCH] " Andrea Cervesato via ltp

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=20260911094345.GC1435339@pevik \
    --to=pvorel@suse.cz \
    --cc=andrea.cervesato@suse.de \
    --cc=ebiggers@google.com \
    --cc=ltp@lists.linux.it \
    /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