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-next>] [day] [month] [year] [list]
Message-Id: <1529651480-1734-1-git-send-email-jianchao.w.wang@oracle.com>
Date:   Fri, 22 Jun 2018 15:11:17 +0800
From:   Jianchao Wang <jianchao.w.wang@...cle.com>
To:     axboe@...nel.dk
Cc:     bart.vanassche@....com, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH 0/3] block: fix the lock inversion caused by kobject_del under sysfs_lock

Hi Jens

Currently, the kobject_del for sysfs mq and hctx entry is invoked
under q->sysfs_lock. lock inversion will came up when someone try
to access the sysfs entries concurrently. The scenario is as below:
  hold q->sysfs_lock    access mq,hctx sysfs entries
  kobject_del
  __kernfs_remove          kernfs_get_active
    kernfs_drain
     wait kn->active       require q->sysfs_lock

To avoid this issue, kobject_del for mq and hctx sysfs entries
mustn't be inovked under sysfs_lock. These patch set is to achieve this.

1st patch introduces blk_queue_registered to test QUEUE_FLAG_REGISTERED
2nd patch remove blk_mq_register_dev which is usesless.
3rd patch fix the issue by changing the sync method, please refer to the
comment.

Jianchao Wang (3)
block: add helper interface blk_queue_registered
blk-mq: cleanup blk_mq_register_dev
block: fix the lock inversion caused by kobject_del under sysfs_lock


 block/blk-mq-sysfs.c   | 80 +++++++++++++++++++++++++++++++-------------------
 block/blk-mq.h         |  3 ++
 block/blk-sysfs.c      | 43 ++++++++++++++-------------
 block/blk-wbt.c        |  4 ---
 block/elevator.c       |  5 ++--
 include/linux/blk-mq.h |  3 --
 include/linux/blkdev.h |  4 ++-
 7 files changed, 82 insertions(+), 60 deletions(-)

Thanks
Jianchao

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ