mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jassi Brar <jassisinghbrar@gmail.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Magnus Damm <magnus.damm@gmail.com>
Subject: Re: [PATCH 2/3] soc: renesas: Add Renesas R-Car MFIS driver
Date: Mon, 23 Mar 2026 10:29:21 +0100	[thread overview]
Message-ID: <acEH8ZKis36cgxT-@shikoro> (raw)
In-Reply-To: <CAMuHMdV_AFhOEi3fimZF467EWpupmcOQTW4SpdUffjzskBrNmA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1094 bytes --]


> > > > +       if (priv->info->mb_reg_comes_from_dt) {
> > > > +               tx_uses_eicr = chan_flags & MFIS_CHANNEL_EICR;
> > > > +               if (tx_uses_eicr)
> > > > +                       chan += mbox->num_chans / 2;
> > > > +       } else {
> > > > +               tx_uses_eicr = priv->info->mb_tx_uses_eicr;
> > > > +       }
> > >
> > > "chan - mbox->chans" is the logical channel number, and should be
> > > validated against mbox_num_chans, to avoid out-of-bound accesses.
> >
> > "chan - ..."? You mean "chan + ..."?
> 
> No, I did mean "-": you do have a pointer "chan" to the channel,
> instead of an index into the mbox->chans[] array.
> Using a  index would  make validation easier to read, though.

Sorry, I still don't get it: If 'chan_num' has been sanitized above to
be in the range of 0..priv->info->mb_num_channels - 1, then how can a
OOB happen here? "chan += mbox->num_chans / 2" only happens when
'mb_reg_comes_from_dt' is set. But when it is set, the array of chans is
also always doubled to have the "<n> IICR, then <n> EICR" layout.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-03-23  9:29 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-17 13:06 [PATCH 0/3] soc: renesas: add " Wolfram Sang
2026-03-17 13:06 ` [PATCH 1/3] dt-bindings: soc: renesas: add MFIS binding documentation Wolfram Sang
2026-03-18  9:17   ` Krzysztof Kozlowski
2026-03-18  9:19     ` Krzysztof Kozlowski
2026-03-19  8:54     ` Geert Uytterhoeven
2026-03-19  8:58       ` Krzysztof Kozlowski
2026-03-31  7:10         ` Wolfram Sang
2026-03-31  7:14           ` Krzysztof Kozlowski
2026-03-31  7:40             ` Wolfram Sang
2026-03-31  7:52               ` Krzysztof Kozlowski
2026-03-31  7:18           ` Krzysztof Kozlowski
2026-03-31  7:33             ` Wolfram Sang
2026-03-19  9:15     ` Wolfram Sang
2026-03-18  9:17   ` Krzysztof Kozlowski
2026-03-19  8:58   ` Geert Uytterhoeven
2026-03-17 13:06 ` [PATCH 2/3] soc: renesas: Add Renesas R-Car MFIS driver Wolfram Sang
2026-03-19 12:58   ` Geert Uytterhoeven
2026-03-22 19:58     ` Wolfram Sang
2026-03-23  8:12       ` Geert Uytterhoeven
2026-03-23  9:29         ` Wolfram Sang [this message]
2026-03-23 10:06           ` Geert Uytterhoeven
2026-03-22  8:59   ` Sashiko review feedback (was Re: [PATCH 2/3] soc: renesas: Add Renesas R-Car MFIS driver) Wolfram Sang
2026-03-23 10:02     ` Geert Uytterhoeven
2026-03-23 10:58       ` Wolfram Sang
2026-03-24  2:21     ` Roman Gushchin
2026-03-24  6:18       ` Wolfram Sang
2026-03-24 14:54         ` Roman Gushchin
2026-03-30  8:57           ` Wolfram Sang
2026-03-30 13:50             ` Theodore Tso
2026-03-31  7:18               ` Wolfram Sang
2026-03-31  7:44                 ` Geert Uytterhoeven
2026-03-31  7:53                   ` Wolfram Sang
2026-03-29 17:05   ` [PATCH 2/3] soc: renesas: Add Renesas R-Car MFIS driver Jassi Brar
2026-03-31  9:03     ` Wolfram Sang
2026-03-17 13:06 ` [PATCH 3/3] soc: renesas: add X5H PRR support Wolfram Sang
2026-03-19  9:04   ` Geert Uytterhoeven

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=acEH8ZKis36cgxT-@shikoro \
    --to=wsa+renesas@sang-engineering.com \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=jassisinghbrar@gmail.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@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