Re: ipc/mqueue: release spinlock before freeing node_cache in mqueue_evict_inode()

From: Al Viro
Date: Thu Jul 03 2025 - 04:11:15 EST


On Thu, Jul 03, 2025 at 01:34:39PM +0530, ritu pal wrote:
> > That spinlock is inside the inode in question; what exactly is going to be
> > on the other side of contention? Note that none of the file methods
> > are going to run concurrent with that...
>
> Another thread that's waiting to acquire the spinlock to process the
> next item in the mqueue.
> This change reduces the hold time of "info->lock", since the kfree()
> of the node_cache does not require a spinlock to be held.

Describe the call chain in that other thread, please. If there is one,
you've got a UAF scenario.