Rakesh Pandit
75ba4ada82
ligtnvm: fix double blk_put_queue on same queue
...
On an error path in NVM_DEV_CREATE ioctl blk_put_queue is being called
twice: one via blk_cleanup_queue and another via put_disk. Straight fix
seems to remove queue pointer so that disk_release never ends up caling
blk_put_queue again.
[ 391.808827] WARNING: CPU: 1 PID: 1250 at lib/refcount.c:128 refcount_sub_and_test+0x70/0x80
[ 391.808830] refcount_t: underflow; use-after-free.
[ 391.808832] Modules linked in: nf_conntrack_netbios_ns............
[ 391.809052] CPU: 1 PID: 1250 Comm: nvme Not tainted.........
[ 391.809057] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
BIOS rel-1.7.5-0-ge51488c-20140602_164612-nilsson.home.kraxel.org 04/01/2014
[ 391.809060] Call Trace:
[ 391.809079] dump_stack+0x63/0x86
[ 391.809094] __warn+0xcb/0xf0
[ 391.809103] warn_slowpath_fmt+0x5f/0x80
[ 391.809118] refcount_sub_and_test+0x70/0x80
[ 391.809125] refcount_dec_and_test+0x11/0x20
[ 391.809136] kobject_put+0x1f/0x60
[ 391.809149] blk_put_queue+0x15/0x20
[ 391.809159] disk_release+0xae/0xf0
[ 391.809172] device_release+0x32/0x90
[ 391.809184] kobject_release+0x6a/0x170
[ 391.809196] kobject_put+0x2f/0x60
[ 391.809206] put_disk+0x17/0x20
[ 391.809219] nvm_ioctl_dev_create.isra.16+0x897/0xa30
[ 391.809236] nvm_ctl_ioctl+0x23c/0x4c0
[ 391.809248] do_vfs_ioctl+0xa3/0x5f0
[ 391.809258] SyS_ioctl+0x79/0x90
[ 391.809271] entry_SYSCALL_64_fastpath+0x1a/0xa9
[ 391.809280] RIP: 0033:0x7f5d3ef363c7
[ 391.809286] RSP: 002b:00007ffc72ed8d78 EFLAGS: 00000206 ORIG_RAX: 0000000000000010
[ 391.809296] RAX: ffffffffffffffda RBX: 00007ffc72edb552 RCX: 00007f5d3ef363c7
[ 391.809301] RDX: 00007ffc72ed8d90 RSI: 0000000040804c22 RDI: 0000000000000003
[ 391.809306] RBP: 0000000000000001 R08: 0000000000000020 R09: 0000000000000001
[ 391.809311] R10: 000000000000053f R11: 0000000000000206 R12: 0000000000000000
[ 391.809316] R13: 0000000000000000 R14: 00007ffc72edb58d R15: 00007ffc72edb581
Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
Reviewed-by: Matias Bjørling <matias@cnexlabs.com>
Fixes: 7d1ef2f408ab "lightnvm: fix cleanup order of disk on init error"
Signed-off-by: Jens Axboe <axboe@fb.com>
2017-04-20 08:17:47 -06:00
..
2017-03-26 11:03:42 -07:00
2017-03-02 08:42:29 +01:00
2017-03-09 11:55:23 -05:00
2017-03-02 08:42:32 +01:00
2017-03-16 16:59:55 +09:00
2017-03-16 16:56:19 -07:00
2017-04-19 17:38:31 -06:00
2017-03-22 19:22:04 -07:00
2017-02-23 15:57:04 -08:00
2017-02-17 14:08:19 -07:00
2017-03-26 11:15:54 -07:00
2017-03-23 16:08:46 -07:00
2017-03-17 13:13:35 -07:00
2017-03-24 00:43:26 +01:00
2017-03-21 22:26:37 +01:00
2017-03-24 14:11:36 -07:00
2017-03-10 19:56:56 -08:00
2017-02-27 18:43:47 -08:00
2017-03-02 08:42:40 +01:00
2017-03-02 08:42:32 +01:00
2017-03-26 09:36:28 +02:00
2017-03-22 18:29:48 +09:00
2017-02-28 20:29:41 -08:00
2017-03-07 14:25:48 -08:00
2017-02-10 15:20:44 +01:00
2017-02-10 15:19:48 +01:00
2017-03-17 09:20:28 +01:00
2017-03-24 11:05:06 +10:00
2017-03-21 13:07:18 -07:00
2017-03-02 08:42:32 +01:00
2017-03-16 16:42:33 +09:00
2017-03-23 12:01:57 -07:00
2017-03-15 14:55:18 +02:00
2017-03-09 16:41:48 +01:00
2017-03-02 08:42:36 +01:00
2017-03-02 17:41:27 -08:00
2017-03-19 10:44:42 +00:00
2017-03-24 22:44:29 -04:00
2017-03-23 19:51:06 -07:00
2017-03-22 23:59:56 +01:00
2017-03-09 12:06:41 +01:00
2017-03-14 21:31:23 -07:00
2017-03-02 08:42:27 +01:00
2017-03-02 08:42:32 +01:00
2017-04-20 08:17:47 -06:00
2017-03-10 14:17:23 +11:00
2017-03-02 08:42:32 +01:00
2017-04-08 11:25:38 -06:00
2017-03-24 13:34:16 -07:00
2017-03-06 08:37:53 -08:00
2017-02-17 14:08:19 -07:00
2017-02-21 11:51:42 -08:00
2017-02-22 12:14:01 -08:00
2017-03-26 11:15:54 -07:00
2017-04-08 11:25:38 -06:00
2017-03-31 08:28:58 -06:00
2017-03-22 19:40:52 -07:00
2017-02-27 18:43:47 -08:00
2017-02-16 23:11:26 -05:00
2017-03-01 00:49:42 -08:00
2017-04-19 17:38:33 -06:00
2017-02-22 19:23:14 -08:00
2017-03-02 08:42:40 +01:00
2017-03-03 16:20:06 -08:00
2017-03-16 17:32:21 +09:00
2017-03-07 14:23:30 -06:00
2017-03-02 08:42:27 +01:00
2017-03-09 15:29:57 +05:30
2017-03-23 10:13:15 +01:00
2017-03-13 13:23:43 -07:00
2017-02-27 18:43:47 -08:00
2017-03-02 08:42:29 +01:00
2017-03-20 16:25:06 +01:00
2017-03-01 09:46:02 -08:00
2017-02-27 18:43:45 -08:00
2017-02-20 17:23:57 -08:00
2017-03-20 14:45:44 -07:00
2017-02-23 15:57:04 -08:00
2017-03-02 13:53:13 -08:00
2017-03-02 08:42:32 +01:00
2017-03-03 10:16:38 -08:00
2017-03-28 15:06:58 -06:00
2017-04-08 11:25:38 -06:00
2017-03-02 08:42:32 +01:00
2017-03-02 08:42:27 +01:00
2017-03-14 21:31:23 -07:00
2017-04-08 11:25:38 -06:00
2017-03-13 10:06:55 +08:00
2017-03-26 11:03:42 -07:00
2017-03-02 08:42:32 +01:00
2017-03-23 22:07:22 +01:00
2017-03-14 17:07:31 +08:00
2017-03-24 14:39:36 -07:00
2017-03-21 14:41:46 -07:00
2017-03-03 01:45:16 +01:00
2017-03-28 20:41:28 +03:00
2017-03-02 08:42:29 +01:00
2017-03-01 06:15:10 -08:00
2017-03-23 12:00:02 -04:00
2017-02-10 15:19:48 +01:00
2017-02-23 11:53:22 -08:00