From: ShifengLi <lishifeng1992@126.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: mustafa.ismail@intel.com, shiraz.saleem@intel.com, jgg@ziepe.ca,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
dinghui@sangfor.com.cn
Subject: Re: [PATCH] RDMA/irdma: Fix UAF in irdma_sc_ccq_get_cqe_info()
Date: Mon, 20 Nov 2023 10:58:16 +0800 [thread overview]
Message-ID: <4ac9c810-bb0b-4f46-8fec-d0a80b6ce3f6@126.com> (raw)
In-Reply-To: <20231119131302.GB15293@unreal>
在 2023/11/19 21:13, Leon Romanovsky 写道:
> On Thu, Nov 16, 2023 at 10:50:43PM -0800, Shifeng Li wrote:
>> When removing the irdma driver or unplugging its aux device, the ccq
>> queue is released before destorying the cqp_cmpl_wq queue.
>> But in the window, there may still be completion events for wqes. That
>> will cause a UAF in irdma_sc_ccq_get_cqe_info().
>>
>> [34693.333191] BUG: KASAN: use-after-free in irdma_sc_ccq_get_cqe_info+0x82f/0x8c0 [irdma]
>> [34693.333194] Read of size 8 at addr ffff889097f80818 by task kworker/u67:1/26327
>> [34693.333194]
>> [34693.333199] CPU: 9 PID: 26327 Comm: kworker/u67:1 Kdump: loaded Tainted: G O --------- -t - 4.18.0 #1
>> [34693.333200] Hardware name: SANGFOR Inspur/NULL, BIOS 4.1.13 08/01/2016
>> [34693.333211] Workqueue: cqp_cmpl_wq cqp_compl_worker [irdma]
>> [34693.333213] Call Trace:
>> [34693.333220] dump_stack+0x71/0xab
>> [34693.333226] print_address_description+0x6b/0x290
>> [34693.333238] ? irdma_sc_ccq_get_cqe_info+0x82f/0x8c0 [irdma]
>> [34693.333240] kasan_report+0x14a/0x2b0
>> [34693.333251] irdma_sc_ccq_get_cqe_info+0x82f/0x8c0 [irdma]
>> [34693.333264] ? irdma_free_cqp_request+0x151/0x1e0 [irdma]
>> [34693.333274] irdma_cqp_ce_handler+0x1fb/0x3b0 [irdma]
>> [34693.333285] ? irdma_ctrl_init_hw+0x2c20/0x2c20 [irdma]
>> [34693.333290] ? __schedule+0x836/0x1570
>> [34693.333293] ? strscpy+0x83/0x180
>> [34693.333296] process_one_work+0x56a/0x11f0
>> [34693.333298] worker_thread+0x8f/0xf40
>> [34693.333301] ? __kthread_parkme+0x78/0xf0
>> [34693.333303] ? rescuer_thread+0xc50/0xc50
>> [34693.333305] kthread+0x2a0/0x390
>> [34693.333308] ? kthread_destroy_worker+0x90/0x90
>> [34693.333310] ret_from_fork+0x1f/0x40
>>
>> Signed-off-by: Shifeng Li <lishifeng1992@126.com>
>> ---
>> drivers/infiniband/hw/irdma/hw.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> Please add Fixes line and resubmit together with Shiraz's Acked-by,
>
I have sent the v2 patch,
Thanks
> Thanks
prev parent reply other threads:[~2023-11-20 2:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-17 6:50 [PATCH] RDMA/irdma: Fix UAF in irdma_sc_ccq_get_cqe_info() Shifeng Li
2023-11-17 17:37 ` Saleem, Shiraz
2023-11-19 13:13 ` Leon Romanovsky
2023-11-20 2:58 ` ShifengLi [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=4ac9c810-bb0b-4f46-8fec-d0a80b6ce3f6@126.com \
--to=lishifeng1992@126.com \
--cc=dinghui@sangfor.com.cn \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mustafa.ismail@intel.com \
--cc=shiraz.saleem@intel.com \
/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