All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "Alistair Popple" <apopple@nvidia.com>,
	"Alexandre Courbot" <acourbot@nvidia.com>
Cc: "Danilo Krummrich" <dakr@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Joel Fernandes" <joelagnelf@nvidia.com>,
	nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org
Subject: Re: [PATCH v3 2/4] gpu: nova-core: gsp: fix length of received messages
Date: Tue, 16 Dec 2025 16:57:40 +0900	[thread overview]
Message-ID: <DEZHBXNOIVH4.2WIQRYI9W8P6P@nvidia.com> (raw)
In-Reply-To: <hbo3azmt6mpaq7dyn4mnitrg3iouk3eeijjqinpl4grlufrvqr@6ieka4obgszr>

On Tue Dec 16, 2025 at 3:14 PM JST, Alistair Popple wrote:
> On 2025-12-16 at 13:57 +1100, Alexandre Courbot <acourbot@nvidia.com> wrote...
>> The size of messages' payload is miscalculated, leading to extra data
>> passed to the message handler. While this is not a problem with our
>> current set of commands, others with a variable-length payload may
>> misbehave. Fix this by introducing a method returning the payload size
>> and using it.
>
> The whole inconsistency of the message element struct not including it's header
> fields in the size whilst the rpc struct does has caused endless confusion, this
> looks much better, thanks for fixing!

Indeed. It would be so much simpler if the RPC header just included the
size of its *payload* - because if we have the header to begin with, of
course it is part of the message!

Instead we have to deal with the possibility of a nonsensical length
value if it is shorter than that of the header. Thankfully a saturating
sub always yields a correct behavior, else we would have to return a
`Result`. :/

>
> Reviewed-by: Alistair Popple <apopple@nvidia.com>

Thanks!


  reply	other threads:[~2025-12-16 12:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-16  2:57 [PATCH v3 0/4] gpu: nova-core: fixups for GSP message queue and bindings Alexandre Courbot
2025-12-16  2:57 ` Alexandre Courbot
2025-12-16  2:57 ` [PATCH v3 1/4] gpu: nova-core: bindings: add missing explicit padding Alexandre Courbot
2025-12-16  2:57   ` Alexandre Courbot
2025-12-16  2:57 ` [PATCH v3 2/4] gpu: nova-core: gsp: fix length of received messages Alexandre Courbot
2025-12-16  2:57   ` Alexandre Courbot
2025-12-16  6:14   ` Alistair Popple
2025-12-16  6:14     ` Alistair Popple
2025-12-16  7:57     ` Alexandre Courbot [this message]
2025-12-16  9:21   ` Joel Fernandes
2025-12-16  9:21     ` Joel Fernandes
2025-12-16 13:02     ` Alexandre Courbot
2025-12-16  2:57 ` [PATCH v3 3/4] gpu: nova-core: bindings: derive `MaybeZeroable` Alexandre Courbot
2025-12-16  2:57   ` Alexandre Courbot
2025-12-16  2:57 ` [PATCH v3 4/4] gpu: nova-core: gsp: replace firmware version with "bindings" alias Alexandre Courbot
2025-12-16  2:57   ` Alexandre Courbot
2025-12-16  9:21 ` [PATCH v3 0/4] gpu: nova-core: fixups for GSP message queue and bindings Joel Fernandes
2025-12-16  9:21   ` Joel Fernandes
2025-12-16 14:31 ` Alexandre Courbot
2025-12-16 14:31   ` Alexandre Courbot

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=DEZHBXNOIVH4.2WIQRYI9W8P6P@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=apopple@nvidia.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=joelagnelf@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tmgross@umich.edu \
    /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.