All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: User <julianpoulainpro@gmail.com>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: axis-fifo: validate tx_fifo_depth in axis_fifo_parse_dt()
Date: Sat, 19 Sep 2026 11:26:37 +0100	[thread overview]
Message-ID: <2026091948-stack-dupe-e9aa@gregkh> (raw)
In-Reply-To: <20260919100511.16032-1-julianpoulainpro@gmail.com>

On Sat, Sep 19, 2026 at 12:05:11PM +0200, User wrote:
> tx_fifo_depth is read from the device tree as an unsigned int and
> later used in axis_fifo_write() as:
> 
>     words_to_write > (fifo->tx_fifo_depth - 4)
> 
> If tx_fifo_depth is <= 4, the unsigned subtraction wraps around to
> a very large value, making the bounds check ineffective. This can
> cause the calling process to block indefinitely waiting for a FIFO
> vacancy that will never be reached.
> 
> Add a validation check in axis_fifo_parse_dt() to reject invalid
> values at probe time with a clear error message.

Please tell your LLM script that device tree values are "trusted".

> 
> Compile-tested with:
>   make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \
>        drivers/staging/axis-fifo/axis-fifo.o
> 
> Signed-off-by: User <julianpoulainpro@gmail.com>

Not a valid name, sorry.

And again, don't use LLMs on drivers/staging/ without reading the email
archives first.

thanks,

greg k-h

      reply	other threads:[~2026-09-19 10:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-19 10:05 [PATCH] staging: axis-fifo: validate tx_fifo_depth in axis_fifo_parse_dt() User
2026-09-19 10:26 ` Greg KH [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=2026091948-stack-dupe-e9aa@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=julianpoulainpro@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /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.