All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Danilo Krummrich" <dakr@kernel.org>
To: "Brendan Shephard" <bshephar@bne-home.net>
Cc: <acourbot@nvidia.com>, <aliceryhl@google.com>,
	<miguel.ojeda.sandonis@gmail.com>, <daniel.almeida@collabora.com>,
	<rust-for-linux@vger.kernel.org>
Subject: Re: [PATCH v8] rust: Return Option from page_align and ensure no usize overflow
Date: Mon, 29 Dec 2025 15:46:09 +0100	[thread overview]
Message-ID: <DFAS5RWFNUCZ.3L6IQ6BB4NEQY@kernel.org> (raw)
In-Reply-To: <20251223055647.9761-1-bshephar@bne-home.net>

On Tue Dec 23, 2025 at 6:56 AM CET, Brendan Shephard wrote:
> Change `page_align()` to return `Option<usize>` to allow validation
> of the provided `addr` value. This ensures that any value that is
> within one `PAGE_SIZE` of `usize::MAX` will not panic, and instead
> returns `None` to indicate overflow.
>
> Signed-off-by: Brendan Shephard <bshephar@bne-home.net>
> Reviewed-by: Alice Ryhl <aliceryhl@google.com>
> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
> Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>

Applied to drm-rust-next, thanks!

    [ Use kernel vertical style for imports; use markdown in comments.
      - Danilo ]

Brendan, can you please send a follow-up patch addressing [1] and [2]?

[1] https://lore.kernel.org/all/CANiq72kcMLXz=xyZeKC0=j_e0BzJEY3wGpBTTxfJsc6EZhCnXA@mail.gmail.com/
[2] https://lore.kernel.org/rust-for-linux/CANiq72mLPvB_6Ow3bW5-V4-km=RyA59chQ1g1x9qUt2P-zZweg@mail.gmail.com/

  parent reply	other threads:[~2025-12-29 14:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-23  5:56 [PATCH v8] rust: Return Option from page_align and ensure no usize overflow Brendan Shephard
2025-12-23 20:14 ` Danilo Krummrich
2025-12-29 14:11   ` Alice Ryhl
2025-12-29 14:22 ` Miguel Ojeda
2025-12-29 14:46 ` Danilo Krummrich [this message]
2025-12-30  8:14   ` Brendan Shephard

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=DFAS5RWFNUCZ.3L6IQ6BB4NEQY@kernel.org \
    --to=dakr@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=bshephar@bne-home.net \
    --cc=daniel.almeida@collabora.com \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=rust-for-linux@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 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.