All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Knop, Ryszard" <ryszard.knop@intel.com>
To: "Kempczynski, Zbigniew" <zbigniew.kempczynski@intel.com>,
	"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Cc: "Sousa, Gustavo" <gustavo.sousa@intel.com>
Subject: Re: [PATCH i-g-t] lib/igt_hook: Fix realloc size to avoid memory overwriting
Date: Mon, 29 Jun 2026 11:59:50 +0000	[thread overview]
Message-ID: <d328c5bf13290b9747f9b51f4e5d423967413b94.camel@intel.com> (raw)
In-Reply-To: <20260629115408.158220-2-zbigniew.kempczynski@intel.com>

Reviewed-by: Ryszard Knop <ryszard.knop@intel.com>

On Mon, 2026-06-29 at 13:54 +0200, Zbigniew Kempczyński wrote:
> Doubling test name size might be not enough for realloc if target name
> length is larger than test/subtest name size.
> 
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Gustavo Sousa <gustavo.sousa@intel.com>
> Cc: Ryszard Knop <ryszard.knop@intel.com>
> ---
>  lib/igt_hook.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/igt_hook.c b/lib/igt_hook.c
> index b8f25b6c7a..a44b852da1 100644
> --- a/lib/igt_hook.c
> +++ b/lib/igt_hook.c
> @@ -300,7 +300,7 @@ static void igt_hook_update_test_name_pre_call(struct igt_hook *igt_hook, struct
>  	if (len + 1 > *size_ptr) {
>  		size_t fullname_size;
>  
> -		*size_ptr *= 2;
> +		*size_ptr += len + 1;
>  		*name_ptr = realloc(*name_ptr, *size_ptr);
>  
>  		fullname_size = igt_hook_calc_test_fullname_size(igt_hook);

  reply	other threads:[~2026-06-29 12:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29 11:54 [PATCH i-g-t] lib/igt_hook: Fix realloc size to avoid memory overwriting Zbigniew Kempczyński
2026-06-29 11:59 ` Knop, Ryszard [this message]
2026-06-29 12:17 ` Gustavo Sousa
2026-06-29 15:38   ` Zbigniew Kempczyński
2026-06-29 16:32   ` Zbigniew Kempczyński
2026-06-29 22:33     ` Gustavo Sousa
2026-06-29 12:37 ` Jani Nikula
2026-06-29 12:37   ` Jani Nikula
2026-06-29 15:40     ` Zbigniew Kempczyński
2026-06-29 22:50 ` ✗ Fi.CI.BAT: failure for " Patchwork

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=d328c5bf13290b9747f9b51f4e5d423967413b94.camel@intel.com \
    --to=ryszard.knop@intel.com \
    --cc=gustavo.sousa@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=zbigniew.kempczynski@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.