mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Kees Cook <kees@kernel.org>, linux-hardening@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fortify: Fix incorrect reporting of read buffer size
Date: Tue, 29 Jul 2025 17:46:30 -0600	[thread overview]
Message-ID: <93ffea26-ab8e-4fc6-9aa9-9850a34d08d7@embeddedor.com> (raw)
In-Reply-To: <20250729231817.work.023-kees@kernel.org>



On 29/07/25 17:18, Kees Cook wrote:
> When FORTIFY_SOURCE reports about a run-time buffer overread, the wrong
> buffer size was being shown in the error message. (The bounds checking
> was correct.)
> 
> Fixes: 3d965b33e40d ("fortify: Improve buffer overflow reporting")
> Signed-off-by: Kees Cook <kees@kernel.org>

Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>

Thanks!
-Gustavo

> ---
> Cc: <linux-hardening@vger.kernel.org>
> ---
>   include/linux/fortify-string.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/fortify-string.h b/include/linux/fortify-string.h
> index e4ce1cae03bf..b3b53f8c1b28 100644
> --- a/include/linux/fortify-string.h
> +++ b/include/linux/fortify-string.h
> @@ -596,7 +596,7 @@ __FORTIFY_INLINE bool fortify_memcpy_chk(__kernel_size_t size,
>   	if (p_size != SIZE_MAX && p_size < size)
>   		fortify_panic(func, FORTIFY_WRITE, p_size, size, true);
>   	else if (q_size != SIZE_MAX && q_size < size)
> -		fortify_panic(func, FORTIFY_READ, p_size, size, true);
> +		fortify_panic(func, FORTIFY_READ, q_size, size, true);
>   
>   	/*
>   	 * Warn when writing beyond destination field size.


      reply	other threads:[~2025-07-29 23:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-29 23:18 Kees Cook
2025-07-29 23:46 ` Gustavo A. R. Silva [this message]

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=93ffea26-ab8e-4fc6-9aa9-9850a34d08d7@embeddedor.com \
    --to=gustavo@embeddedor.com \
    --cc=kees@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®