[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <564afab7-a894-4da8-9980-7d68a0a1babc@kernel.dk>
Date: Thu, 25 Dec 2025 07:58:09 -0700
From: Jens Axboe <axboe@...nel.dk>
To: Prithvi Tambewagh <activprithvi@...il.com>
Cc: io-uring@...r.kernel.org, brauner@...nel.org, jack@...e.cz,
viro@...iv.linux.org.uk, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-kernel-mentees@...ts.linux.dev,
skhan@...uxfoundation.org, david.hunter.linux@...il.com, khalid@...nel.org,
syzbot+00e61c43eb5e4740438f@...kaller.appspotmail.com, stable@...r.kernel.org
Subject: Re: [PATCH v2] io_uring: fix filename leak in __io_openat_prep()
On 12/25/25 12:28 AM, Prithvi Tambewagh wrote:
> __io_openat_prep() allocates a struct filename using getname(). However,
> for the condition of the file being installed in the fixed file table as
> well as having O_CLOEXEC flag set, the function returns early. At that
> point, the request doesn't have REQ_F_NEED_CLEANUP flag set. Due to this,
> the memory for the newly allocated struct filename is not cleaned up,
> causing a memory leak.
>
> Fix this by setting the REQ_F_NEED_CLEANUP for the request just after the
> successful getname() call, so that when the request is torn down, the
> filename will be cleaned up, along with other resources needing cleanup.
>
> Reported-by: syzbot+00e61c43eb5e4740438f@...kaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=00e61c43eb5e4740438f
> Tested-by: syzbot+00e61c43eb5e4740438f@...kaller.appspotmail.com
> Cc: stable@...r.kernel.org
> Signed-off-by: Prithvi Tambewagh <activprithvi@...il.com>
Thanks, just missing a:
Fixes: b9445598d8c6 ("io_uring: openat directly into fixed fd table")
which I'll add when applying.
--
Jens Axboe
Powered by blists - more mailing lists