All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Oded Gabbay <ogabbay@kernel.org>,
	Dani Liberman <dliberman@habana.ai>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] accel/habanalabs/gaudi2: Fix incorrect string length computation in gaudi2_psoc_razwi_get_engines()
Date: Tue, 5 Sep 2023 14:28:27 +0200	[thread overview]
Message-ID: <20230905122827.GD184247@linux.intel.com> (raw)
In-Reply-To: <d38582083ece76155dabdfd9a29d5a9dd0d6bce7.1693855091.git.christophe.jaillet@wanadoo.fr>

On Mon, Sep 04, 2023 at 09:18:36PM +0200, Christophe JAILLET wrote:
> snprintf() returns the "number of characters which *would* be generated for
> the given input", not the size *really* generated.
> 
> In order to avoid too large values for 'str_size' (and potential negative
> values for "PSOC_RAZWI_ENG_STR_SIZE - str_size") use scnprintf()
> instead of snprintf().
> 
> Fixes: c0e6df916050 ("accel/habanalabs: fix address decode RAZWI handling")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>

WARNING: multiple messages have this Message-ID (diff)
From: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: kernel-janitors@vger.kernel.org, Oded Gabbay <ogabbay@kernel.org>,
	Dani Liberman <dliberman@habana.ai>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] accel/habanalabs/gaudi2: Fix incorrect string length computation in gaudi2_psoc_razwi_get_engines()
Date: Tue, 5 Sep 2023 14:28:27 +0200	[thread overview]
Message-ID: <20230905122827.GD184247@linux.intel.com> (raw)
In-Reply-To: <d38582083ece76155dabdfd9a29d5a9dd0d6bce7.1693855091.git.christophe.jaillet@wanadoo.fr>

On Mon, Sep 04, 2023 at 09:18:36PM +0200, Christophe JAILLET wrote:
> snprintf() returns the "number of characters which *would* be generated for
> the given input", not the size *really* generated.
> 
> In order to avoid too large values for 'str_size' (and potential negative
> values for "PSOC_RAZWI_ENG_STR_SIZE - str_size") use scnprintf()
> instead of snprintf().
> 
> Fixes: c0e6df916050 ("accel/habanalabs: fix address decode RAZWI handling")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>

  reply	other threads:[~2023-09-05 16:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-04 19:18 [PATCH] accel/habanalabs/gaudi2: Fix incorrect string length computation in gaudi2_psoc_razwi_get_engines() Christophe JAILLET
2023-09-04 19:18 ` Christophe JAILLET
2023-09-05 12:28 ` Stanislaw Gruszka [this message]
2023-09-05 12:28   ` Stanislaw Gruszka
2023-09-13 11:25   ` Oded Gabbay
2023-09-13 11:25     ` Oded Gabbay

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=20230905122827.GD184247@linux.intel.com \
    --to=stanislaw.gruszka@linux.intel.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dliberman@habana.ai \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ogabbay@kernel.org \
    /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.