All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: opensbi@lists.infradead.org
Subject: [PATCH 1/1] platform: generic: allwinner: avoid buffer overrun
Date: Tue, 27 Dec 2022 14:36:26 +0100	[thread overview]
Message-ID: <878ritdl45.fsf@igel.home> (raw)
In-Reply-To: <CAEUhbmXcQiGH6WQ3pN_C+mv_qRn0mF2Pb2vq_dxeXxMsygNwdw@mail.gmail.com> (Bin Meng's message of "Tue, 27 Dec 2022 21:13:11 +0800")

On Dez 27 2022, Bin Meng wrote:

> On Tue, Dec 27, 2022 at 9:04 PM Andreas Schwab <schwab@linux-m68k.org> wrote:
>>
>> On Dez 27 2022, Bin Meng wrote:
>>
>> > Changing the array size to PLIC_SOURCES + 1 does not make sense. The
>> > PLIC_SOURCES should be 176 which is correct as it includes source 0 on
>> > the Allwinner SoC. The "riscv,ndev" [1] should not be 176 otherwise it
>> > will create a buffer overrun.
>>
>> The range check will always allow that overrrun.
>>
>
> Well, with a correct dtb it doesn't.

You cannot argue with the dtb, since this is externally controlled.

> Strictly speaking, your proposed fix allows that overrun too

How?

-- 
Andreas Schwab, schwab at linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


  reply	other threads:[~2022-12-27 13:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-27 11:01 [PATCH 1/1] platform: generic: allwinner: avoid buffer overrun Heinrich Schuchardt
2022-12-27 11:46 ` Bin Meng
2022-12-27 12:01   ` Heinrich Schuchardt
2022-12-27 12:07     ` Bin Meng
2022-12-27 13:03       ` Andreas Schwab
2022-12-27 13:13         ` Bin Meng
2022-12-27 13:36           ` Andreas Schwab [this message]
2022-12-27 13:49             ` Bin Meng
2022-12-27 14:06               ` Andreas Schwab
2022-12-27 18:22           ` Samuel Holland
2022-12-27 18:39             ` Andreas Schwab
2022-12-27 18:49               ` Samuel Holland
2022-12-27 18:52                 ` Andreas Schwab
2022-12-27 19:12                   ` Samuel Holland
2022-12-27 19:31                     ` Andreas Schwab
2022-12-27 12:05 ` Andreas Schwab
2022-12-27 12:28   ` Heinrich Schuchardt
2022-12-27 12:41     ` Bin Meng
2023-01-13 12:04 ` Anup Patel

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=878ritdl45.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=opensbi@lists.infradead.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.