lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 29 Jun 2021 10:25:42 +0200
From:   Daniel Wagner <dwagner@...e.de>
To:     Ming Lei <ming.lei@...hat.com>
Cc:     Wen Xiong <wenxiong@...ibm.com>, james.smart@...adcom.com,
        linux-kernel@...r.kernel.org, sagi@...mberg.me,
        wenxiong@...ux.vnet.ibm.com
Subject: Re: [PATCH 1/1] block: System crashes when cpu hotplug + bouncing
 port

On Tue, Jun 29, 2021 at 11:47:55AM +0800, Ming Lei wrote:
> >    >>data.ctx = __blk_mq_get_ctx(q, cpu);
> >    cpu=2048 if hctx_idx = 4
> 
> Yeah, that is the issue I mentioned, any CPU in hctx->cpumask becomes
> offline, please try the following patch and see if it makes a
> difference:

Given that cpumask_first_and() will return nr_cpu_ids in this case,
can't we just bail out here and have to caller handle the error? I am
able to reproduce the crash you reported in [1] and the fix [2] here
works for me:

--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -469,6 +469,8 @@ struct request *blk_mq_alloc_request_hctx(struct request_queue *q,
        if (!blk_mq_hw_queue_mapped(data.hctx))
                goto out_queue_exit;
        cpu = cpumask_first_and(data.hctx->cpumask, cpu_online_mask);
+       if (cpu >= nr_cpu_ids)
+               goto out_queue_exit;
        data.ctx = __blk_mq_get_ctx(q, cpu);
 
        if (!q->elevator)

[1] https://lore.kernel.org/linux-block/20191117041233.GA30615@ming.t460p/
[2] https://lore.kernel.org/linux-block/20210608183339.70609-1-dwagner@suse.de/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ