From: "Sven Peter" <sven@svenpeter.dev>
To: "Harshit Mogalapalli" <harshit.m.mogalapalli@oracle.com>,
"Alyssa Rosenzweig" <alyssa@rosenzweig.io>,
"Janne Grunau" <j@jannau.net>, "Asahi Lina" <lina@asahilina.net>,
"Jens Axboe" <axboe@kernel.dk>,
asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: dan.carpenter@linaro.org, kernel-janitors@vger.kernel.org,
"Dan Carpenter" <error27@gmail.com>
Subject: Re: [PATCH] soc: apple: rtkit: Fix use-after-free in apple_rtkit_crashlog_rx()
Date: Tue, 18 Feb 2025 18:02:50 +0100 [thread overview]
Message-ID: <312a397a-ab54-4128-8f90-184ed719a9ac@app.fastmail.com> (raw)
In-Reply-To: <6c965dbc-9f01-414a-b218-2fa88155eb52@oracle.com>
Hi,
On Tue, Feb 18, 2025, at 17:01, Harshit Mogalapalli wrote:
> Hi,
>
> On 18/02/25 21:04, Sven Peter wrote:
>> Hi,
>>
>>
>> On Wed, Feb 12, 2025, at 09:58, Harshit Mogalapalli wrote:
>>> This code calls kfree(bfr); and then passes "bfr" to rtk->ops->crashed()
>>> which is a use after free. The ->crashed function pointer is implemented
>>> by apple_nvme_rtkit_crashed() and it doesn't use the "bfr" pointer so
>>> this doesn't cause a problem. But it still looks sketchy as can be.
>>>
>>> Fix this by moving kfree() after the last usage of bfr.
>>>
>>> Fixes: c559645f343a ("soc: apple: rtkit: Pass the crashlog to the
>>> crashed() callback")
>>
>> This commit isn't upstream yet afaict, did you mean to post a review comment
>> to [1] instead?
>>
>
> I made the patch based on linux-next, linux-next has the patch merged.
Whoops, I guess we accidentally already pushed that one to for-next without merging it.
I'll merge both and adjust the commit hash in your Fixes tag.
Thanks,
Sven
next prev parent reply other threads:[~2025-02-18 17:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-12 8:58 [PATCH] soc: apple: rtkit: Fix use-after-free in apple_rtkit_crashlog_rx() Harshit Mogalapalli
2025-02-12 10:00 ` Eric Curtin
2025-02-18 15:34 ` Sven Peter
2025-02-18 16:01 ` Harshit Mogalapalli
2025-02-18 17:02 ` Sven Peter [this message]
2025-02-18 17:05 ` Sven Peter
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=312a397a-ab54-4128-8f90-184ed719a9ac@app.fastmail.com \
--to=sven@svenpeter.dev \
--cc=alyssa@rosenzweig.io \
--cc=asahi@lists.linux.dev \
--cc=axboe@kernel.dk \
--cc=dan.carpenter@linaro.org \
--cc=error27@gmail.com \
--cc=harshit.m.mogalapalli@oracle.com \
--cc=j@jannau.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=lina@asahilina.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@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