mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Lucas Jeffrey <luquijeffrey@gmail.com>
Cc: gregkh@linuxfoundation.org, ovidiu.panait.oss@gmail.com,
	gustavopiazdasilva2102@gmail.com, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] axis-fifo: use size_t for write size calculations
Date: Fri, 31 Jul 2026 14:10:37 +0300	[thread overview]
Message-ID: <amyCrccsFE9aWGxn@stanley.mountain> (raw)
In-Reply-To: <20260731034307.327377-1-luquijeffrey@gmail.com>

On Fri, Jul 31, 2026 at 12:43:07AM -0300, Lucas Jeffrey wrote:
> The write length is provided as size_t, but words_to_write and the
> return value storage used narrower types. Use size_t for the word count
> and ssize_t for the return value to keep the types consistent with the
> write interface.
> 
> This avoids relying on implicit size limits when handling write sizes.
> 
> Signed-off-by: Lucas Jeffrey <luquijeffrey@gmail.com>
> ---

This doesn't affect real life because len is capped in rw_verify_area().

The commit message needs to make it clear that this is just a clean up
and not a fix.  If we pretended that the len value in read/write
functions was an range from 0-ULONG_MAX then we would have a ton of
integer overflow bugs etc.

regards,
dan carpenter


  reply	other threads:[~2026-07-31 11:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-31  3:43 Lucas Jeffrey
2026-07-31 11:10 ` Dan Carpenter [this message]
2026-08-01 17:36 ` [PATCH v2] staging: " Lucas Jeffrey

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=amyCrccsFE9aWGxn@stanley.mountain \
    --to=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavopiazdasilva2102@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=luquijeffrey@gmail.com \
    --cc=ovidiu.panait.oss@gmail.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 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®