[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250214152128.61a1054b90d1a53eff9cf16b@linux-foundation.org>
Date: Fri, 14 Feb 2025 15:21:28 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Jeongjun Park <aha310510@...il.com>
Cc: Liam.Howlett@...cle.com, brauner@...nel.org, lorenzo.stoakes@...cle.com,
willy@...radead.org, davidlohr.bueso@...com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ipc: fix to protect IPCS lookups using RCU instead of
semaphore
On Sat, 15 Feb 2025 03:01:57 +0900 Jeongjun Park <aha310510@...il.com> wrote:
> In shm_destroy_orphaned(), we are not performing updates to the IPCS and are
> only calling idr_for_each(), which can be protected by the RCU read-critical
> section.
>
> And if idr_for_each() is not protected by the RCU read-critical section,
> then when radix_tree_node_free() is called to free the struct radix_tree_node
> through call_rcu(), the node will be freed immediately, and when reading the
> next node in radix_tree_for_each_slot(), the memory that has already been
> freed may be read.
A use-after-free?
Is there any report of this occurring, or was this change a result of
code inspection? If the former, please share details (Link:,
Reported-by:, Closes:, etc).
> Therefore, I think it is appropriate to use RCU instead of semaphore to
> protect it.
Powered by blists - more mailing lists