From: Wei Yang <richard.weiyang@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Wei Yang <richard.weiyang@gmail.com>,
Liam.Howlett@oracle.com, willy@infradead.org,
maple-tree@lists.infradead.org, linux-mm@kvack.org
Subject: Re: [Patch v3 0/3] maple_tree: Fix the replacement of a root leaf node
Date: Wed, 11 Jun 2025 06:15:37 +0000 [thread overview]
Message-ID: <20250611061537.5sphqxawrrhwz74h@master> (raw)
In-Reply-To: <20250610205539.75dc8db5fc245510228bcbf8@linux-foundation.org>
On Tue, Jun 10, 2025 at 08:55:39PM -0700, Andrew Morton wrote:
>On Wed, 11 Jun 2025 02:54:36 +0000 Wei Yang <richard.weiyang@gmail.com> wrote:
>
>> On Tue, Jun 10, 2025 at 06:37:27PM -0700, Andrew Morton wrote:
>> >On Wed, 11 Jun 2025 01:12:50 +0000 Wei Yang <richard.weiyang@gmail.com> wrote:
>> >
>> >> On destroy we should set each node dead. But current
>> >> code miss this when the maple tree has only the root node.
>> >>
>> >> The reason is mt_destroy_walk() leverage mte_destroy_descend() to set
>> >> node dead, but this is skipped since the only root node is a leaf.
>> >
>> >Thanks. You added cc:stable to two of the patches and that's great,
>> >thanks for remembering. But the changelogs didn't tell us why you made
>> >this choice.
>> >
>> >So, as always, please always describe the userspace-visible impact of a
>> >bug when fixing that bug!
>>
>> Thanks for reminding.
>>
>> Do you prefer to have a new version with the description in changelog?
>
>No, that's fine - please just send it in reply to this email.
Below is my understanding about the impact of the bug.
---
Without the fix, maple tree user may see old value after overwriting the whole
range [0, ULONG_MAX] on a tree containing just one leaf node. If it happens,
kernel may access some invalid data and be crashed.
Since we rarely overwrite the whole range of a maple tree, we don't expect it
to have userspace-visible impact in practise.
--
Wei Yang
Help you, Help me
prev parent reply other threads:[~2025-06-11 6:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-11 1:12 Wei Yang
2025-06-11 1:12 ` [Patch v3 1/3] maple_tree: Fix mt_destroy_walk() on " Wei Yang
2025-06-11 1:12 ` [Patch v3 2/3] maple_tree: restart walk on correct status Wei Yang
2025-06-11 1:12 ` [Patch v3 3/3] maple_tree: assert retrieving new value on a tree containing just a leaf node Wei Yang
2025-06-11 1:37 ` [Patch v3 0/3] maple_tree: Fix the replacement of a root " Andrew Morton
2025-06-11 2:54 ` Wei Yang
2025-06-11 3:55 ` Andrew Morton
2025-06-11 6:15 ` Wei Yang [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=20250611061537.5sphqxawrrhwz74h@master \
--to=richard.weiyang@gmail.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=maple-tree@lists.infradead.org \
--cc=willy@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox