From: Xiaomeng Tong <xiam0nd.tong@gmail.com>
To: sj@kernel.org
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, stable@vger.kernel.org,
xiam0nd.tong@gmail.com
Subject: Re: [PATCH] damon: vaddr-test: fix a missing check on list iterator
Date: Mon, 28 Mar 2022 19:36:04 +0800 [thread overview]
Message-ID: <20220328113604.31373-1-xiam0nd.tong@gmail.com> (raw)
In-Reply-To: <20220328075104.31125-1-sj@kernel.org>
On Mon, 28 Mar 2022 07:51:04 +0000, SJ wrote:
> On Sun, 27 Mar 2022 16:03:45 +0800 Xiaomeng Tong <xiam0nd.tong@gmail.com> wrote:
>
> > The bug is here:
> > KUNIT_EXPECT_EQ(test, r->ar.start, start + i * expected_width);
> > KUNIT_EXPECT_EQ(test, r->ar.end, end);
> >
> > For the damon_for_each_region(), just like list_for_each_entry(),
> > the list iterator 'drm_crtc' will point to a bogus position
> > containing HEAD if the list is empty or no element is found.
> > This case must be checked before any use of the iterator,
> > otherwise it will lead to a invalid memory access.
>
> We ensure 'damon_va_evenly_split_region()' successes before executing the loop,
> so the issue cannot occur. That said, I think this patch makes code better to
> read. Could you please resend this patch after fixing the commit message?
Yes, you should be right. I have resend this patch with the commit message changed.
Please check it, thank you.
--
Xiaomeng Tong
prev parent reply other threads:[~2022-03-28 11:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-27 8:03 Xiaomeng Tong
2022-03-28 7:51 ` sj
2022-03-28 11:36 ` Xiaomeng Tong [this message]
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=20220328113604.31373-1-xiam0nd.tong@gmail.com \
--to=xiam0nd.tong@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sj@kernel.org \
--cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox