From: Frank Rowand <frowand.list@gmail.com>
To: Rob Herring <robh+dt@kernel.org>, Yin Xiujiang <yinxiujiang@kylinos.cn>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] of: unittest: Fix out of bounds array access when id < 0
Date: Wed, 22 Dec 2021 12:06:44 -0600 [thread overview]
Message-ID: <cadd5cd5-d2d7-ccbd-50af-deca7b6afd80@gmail.com> (raw)
In-Reply-To: <CAL_JsqLtQanbiC4egB8d5quQRZNq0V6q2s+=qhBeypBqLH-pgA@mail.gmail.com>
On 12/21/21 6:20 AM, Rob Herring wrote:
> On Tue, Dec 21, 2021 at 5:34 AM Yin Xiujiang <yinxiujiang@kylinos.cn> wrote:
>>
>> In of_unittest_untrack_overlay if id is less than 0 then
>> overlay_id_bits will be out of bounds. And it is also mentioned
>> in bugzilla as a bug report:
>> https://bugzilla.kernel.org/show_bug.cgi?id=214867
>>
>> Fix this bug by tiggering WARN_ON()
>
> If id shouldn't be less than 0, can we make it unsigned instead as
> discussed here[1].
>
> Rob
>
> [1] https://lore.kernel.org/all/c474a371-b524-1da8-4a67-e72cf8f2b0f7@gmail.com/
>
There are problems with changing to unsigned (fixable, but more extensive
code changes).
I think that the implementation of id tracking in unittest.c is overly
fragile, and I would prefer to just re-implement it (see also my reply
to the proposed patch).
Let me take a look at whether I can create an alternate
implementation of id tracking.
-Frank
next prev parent reply other threads:[~2021-12-22 18:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20211221092830.680839-1-yinxiujiang@kylinos.cn>
2021-12-21 11:20 ` [PATCH] of: unittest: Fix out of bounds array access when id < 0 Rob Herring
2021-12-22 18:06 ` Frank Rowand [this message]
2021-12-22 18:06 ` Frank Rowand
2021-12-24 16:18 ` Frank Rowand
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=cadd5cd5-d2d7-ccbd-50af-deca7b6afd80@gmail.com \
--to=frowand.list@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=yinxiujiang@kylinos.cn \
/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;
as well as URLs for NNTP newsgroup(s).