All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Nick Terrell <nickrterrell@gmail.com>
Cc: linux-kernel@vger.kernel.org, Nick Terrell <terrelln@meta.com>,
	Kernel Team <Kernel-team@fb.com>, Nick Terrell <terrelln@fb.com>,
	syzbot+1f2eb3e8cd123ffce499@syzkaller.appspotmail.com,
	Eric Biggers <ebiggers@kernel.org>
Subject: Re: [PATCH] zstd: Fix array-index-out-of-bounds UBSAN warning
Date: Sat, 14 Oct 2023 19:31:37 -0700	[thread overview]
Message-ID: <202310141930.F1F809230@keescook> (raw)
In-Reply-To: <20231012213428.1390905-1-nickrterrell@gmail.com>

On Thu, Oct 12, 2023 at 02:34:28PM -0700, Nick Terrell wrote:
> From: Nick Terrell <terrelln@fb.com>
> 
> Zstd used an array of length 1 to mean a flexible array for C89
> compatibility. Switch to a C99 flexible array to fix the UBSAN warning.
> 
> Tested locally by booting the kernel and writing to and reading from a
> BtrFS filesystem with zstd compression enabled. I was unable to reproduce
> the issue before the fix, however it is a trivial change.
> 
> Reported-by: syzbot+1f2eb3e8cd123ffce499@syzkaller.appspotmail.com
> Reported-by: Eric Biggers <ebiggers@kernel.org>
> Reported-by: Kees Cook <keescook@chromium.org>
> Signed-off-by: Nick Terrell <terrelln@meta.com>

Thanks! This 1-element conversion doesn't appear to need any sizeof()
related changes, so AFAICT this header change is sufficient.

Reviewed-by: Kees Cook <keescook@chromium.org>


-- 
Kees Cook

      reply	other threads:[~2023-10-15  2:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-12 21:34 [PATCH] zstd: Fix array-index-out-of-bounds UBSAN warning Nick Terrell
2023-10-15  2:31 ` Kees Cook [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=202310141930.F1F809230@keescook \
    --to=keescook@chromium.org \
    --cc=Kernel-team@fb.com \
    --cc=ebiggers@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickrterrell@gmail.com \
    --cc=syzbot+1f2eb3e8cd123ffce499@syzkaller.appspotmail.com \
    --cc=terrelln@fb.com \
    --cc=terrelln@meta.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.