All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Sebastian Ott <sebott@linux.ibm.com>,
	Stefan Haberland <sth@linux.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Sasha Levin <alexander.levin@microsoft.com>
Subject: [PATCH 4.14 48/61] s390/dasd: use blk_mq_rq_from_pdu for per request data
Date: Fri,  6 Jul 2018 07:47:12 +0200	[thread overview]
Message-ID: <20180706054714.184058642@linuxfoundation.org> (raw)
In-Reply-To: <20180706054712.332416244@linuxfoundation.org>

4.14-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sebastian Ott <sebott@linux.ibm.com>

[ Upstream commit f0f59a2fab8e52b9d582b39da39f22230ca80aee ]

Dasd uses completion_data from struct request to store per request
private data - this is problematic since this member is part of a
union which is also used by IO schedulers.
Let the block layer maintain space for per request data behind each
struct request.

Fixes crashes on block layer timeouts like this one:

Unable to handle kernel pointer dereference in virtual kernel address space
Failing address: 0000000000000000 TEID: 0000000000000483
Fault in home space mode while using kernel ASCE.
AS:0000000001308007 R3:00000000fffc8007 S:00000000fffcc000 P:000000000000013d
Oops: 0004 ilc:2 [#1] PREEMPT SMP
Modules linked in: [...]
CPU: 0 PID: 1480 Comm: kworker/0:2H Not tainted 4.17.0-rc4-00046-gaa3bcd43b5af #203
Hardware name: IBM 3906 M02 702 (LPAR)
Workqueue: kblockd blk_mq_timeout_work
Krnl PSW : 0000000067ac406b 00000000b6960308 (do_raw_spin_trylock+0x30/0x78)
           R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:3 CC:2 PM:0 RI:0 EA:3
Krnl GPRS: 0000000000000c00 0000000000000000 0000000000000000 0000000000000001
           0000000000b9d3c8 0000000000000000 0000000000000001 00000000cf9639d8
           0000000000000000 0700000000000000 0000000000000000 000000000099f09e
           0000000000000000 000000000076e9d0 000000006247bb08 000000006247bae0
Krnl Code: 00000000001c159c: b90400c2           lgr     %r12,%r2
           00000000001c15a0: a7180000           lhi     %r1,0
          #00000000001c15a4: 583003a4           l       %r3,932
          >00000000001c15a8: ba132000           cs      %r1,%r3,0(%r2)
           00000000001c15ac: a7180001           lhi     %r1,1
           00000000001c15b0: a784000b           brc     8,1c15c6
           00000000001c15b4: c0e5004e72aa       brasl   %r14,b8fb08
           00000000001c15ba: 1812               lr      %r1,%r2
Call Trace:
([<0700000000000000>] 0x700000000000000)
 [<0000000000b9d3d2>] _raw_spin_lock_irqsave+0x7a/0xb8
 [<000000000099f09e>] dasd_times_out+0x46/0x278
 [<000000000076ea6e>] blk_mq_terminate_expired+0x9e/0x108
 [<000000000077497a>] bt_for_each+0x102/0x130
 [<0000000000774e54>] blk_mq_queue_tag_busy_iter+0x74/0xd8
 [<000000000076fea0>] blk_mq_timeout_work+0x260/0x320
 [<0000000000169dd4>] process_one_work+0x3bc/0x708
 [<000000000016a382>] worker_thread+0x262/0x408
 [<00000000001723a8>] kthread+0x160/0x178
 [<0000000000b9e73a>] kernel_thread_starter+0x6/0xc
 [<0000000000b9e734>] kernel_thread_starter+0x0/0xc
INFO: lockdep is turned off.
Last Breaking-Event-Address:
 [<0000000000b9d3cc>] _raw_spin_lock_irqsave+0x74/0xb8

Kernel panic - not syncing: Fatal exception: panic_on_oops

Signed-off-by: Sebastian Ott <sebott@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/s390/block/dasd.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -3049,7 +3049,8 @@ static blk_status_t do_dasd_request(stru
 	cqr->callback_data = req;
 	cqr->status = DASD_CQR_FILLED;
 	cqr->dq = dq;
-	req->completion_data = cqr;
+	*((struct dasd_ccw_req **) blk_mq_rq_to_pdu(req)) = cqr;
+
 	blk_mq_start_request(req);
 	spin_lock(&block->queue_lock);
 	list_add_tail(&cqr->blocklist, &block->ccw_queue);
@@ -3073,12 +3074,13 @@ out:
  */
 enum blk_eh_timer_return dasd_times_out(struct request *req, bool reserved)
 {
-	struct dasd_ccw_req *cqr = req->completion_data;
 	struct dasd_block *block = req->q->queuedata;
 	struct dasd_device *device;
+	struct dasd_ccw_req *cqr;
 	unsigned long flags;
 	int rc = 0;
 
+	cqr = *((struct dasd_ccw_req **) blk_mq_rq_to_pdu(req));
 	if (!cqr)
 		return BLK_EH_NOT_HANDLED;
 
@@ -3184,6 +3186,7 @@ static int dasd_alloc_queue(struct dasd_
 	int rc;
 
 	block->tag_set.ops = &dasd_mq_ops;
+	block->tag_set.cmd_size = sizeof(struct dasd_ccw_req *);
 	block->tag_set.nr_hw_queues = DASD_NR_HW_QUEUES;
 	block->tag_set.queue_depth = DASD_MAX_LCU_DEV * DASD_REQ_PER_DEV;
 	block->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;



  parent reply	other threads:[~2018-07-06  5:52 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-06  5:46 [PATCH 4.14 00/61] 4.14.54-stable review Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 01/61] usb: cdc_acm: Add quirk for Uniden UBC125 scanner Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 02/61] USB: serial: cp210x: add CESINEL device ids Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 03/61] USB: serial: cp210x: add Silicon Labs IDs for Windows Update Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 04/61] usb: dwc2: fix the incorrect bitmaps for the ports of multi_tt hub Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 05/61] acpi: Add helper for deactivating memory region Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 06/61] usb: typec: ucsi: acpi: Workaround for cache mode issue Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 07/61] usb: typec: ucsi: Fix for incorrect status data issue Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 08/61] xhci: Fix kernel oops in trace_xhci_free_virt_device Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 09/61] n_tty: Fix stall at n_tty_receive_char_special() Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 10/61] n_tty: Access echo_* variables carefully Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 11/61] staging: android: ion: Return an ERR_PTR in ion_map_kernel Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 12/61] serial: 8250_pci: Remove stalled entries in blacklist Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 13/61] serdev: fix memleak on module unload Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 14/61] vt: prevent leaking uninitialized data to userspace via /dev/vcs* Greg Kroah-Hartman
2018-07-06  5:52   ` syzbot
2018-07-06  5:46 ` [PATCH 4.14 18/61] drm/qxl: Call qxl_bo_unref outside atomic context Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 19/61] drm/atmel-hlcdc: check stride values in the first plane Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 22/61] drm/i915: Enable provoking vertex fix on Gen9 systems Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 23/61] netfilter: nf_tables: nft_compat: fix refcount leak on xt module Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 24/61] netfilter: nft_compat: prepare for indirect info storage Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 25/61] netfilter: nft_compat: fix handling of large matchinfo size Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 26/61] netfilter: nf_tables: dont assume chain stats are set when jumplabel is set Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 27/61] netfilter: nf_tables: bogus EBUSY in chain deletions Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 28/61] netfilter: nft_meta: fix wrong value dereference in nft_meta_set_eval Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 29/61] netfilter: nf_tables: disable preemption in nft_update_chain_stats() Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 30/61] netfilter: nf_tables: increase nft_counters_enabled in nft_chain_stats_replace() Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 31/61] netfilter: nf_tables: fix memory leak on error exit return Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 32/61] netfilter: nf_tables: add missing netlink attrs to policies Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 33/61] netfilter: nf_tables: fix NULL-ptr in nf_tables_dump_obj() Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 34/61] md: always hold reconfig_mutex when calling mddev_suspend() Greg Kroah-Hartman
2018-07-06  5:46 ` [PATCH 4.14 35/61] md: dont call bitmap_create() while array is quiesced Greg Kroah-Hartman
2018-07-06  5:47 ` [PATCH 4.14 36/61] md: move suspend_hi/lo handling into core md code Greg Kroah-Hartman
2018-07-06  5:47 ` [PATCH 4.14 37/61] md: use mddev_suspend/resume instead of ->quiesce() Greg Kroah-Hartman
2018-07-06  5:47 ` [PATCH 4.14 38/61] md: allow metadata update while suspending Greg Kroah-Hartman
2018-07-06  5:47 ` [PATCH 4.14 39/61] md: remove special meaning of ->quiesce(.., 2) Greg Kroah-Hartman
2018-07-06  5:47 ` [PATCH 4.14 40/61] netfilter: dont set F_IFACE on ipv6 fib lookups Greg Kroah-Hartman
2018-07-06  5:47 ` [PATCH 4.14 41/61] netfilter: ip6t_rpfilter: provide input interface for route lookup Greg Kroah-Hartman
2018-07-06  5:47 ` [PATCH 4.14 42/61] netfilter: nf_tables: use WARN_ON_ONCE instead of BUG_ON in nft_do_chain() Greg Kroah-Hartman
2018-07-06  5:47 ` [PATCH 4.14 43/61] ARM: dts: imx6q: Use correct SDMA script for SPI5 core Greg Kroah-Hartman
2018-07-06  5:47 ` [PATCH 4.14 44/61] mtd: rawnand: fix return value check for bad block status Greg Kroah-Hartman
2018-07-06  5:47 ` [PATCH 4.14 46/61] afs: Fix directory permissions check Greg Kroah-Hartman
2018-07-06  5:47 ` [PATCH 4.14 47/61] netfilter: ebtables: handle string from userspace with care Greg Kroah-Hartman
2018-07-06  5:47 ` Greg Kroah-Hartman [this message]
2018-07-06  5:47 ` [PATCH 4.14 49/61] netfilter: nft_limit: fix packet ratelimiting Greg Kroah-Hartman
2018-07-06  5:47 ` [PATCH 4.14 50/61] ipvs: fix buffer overflow with sync daemon and service Greg Kroah-Hartman
2018-07-06  5:47 ` [PATCH 4.14 51/61] iwlwifi: pcie: compare with number of IRQs requested for, not number of CPUs Greg Kroah-Hartman
2018-07-06  5:47 ` [PATCH 4.14 52/61] atm: zatm: fix memcmp casting Greg Kroah-Hartman
2018-07-06  5:47 ` [PATCH 4.14 54/61] perf test: "Session topology" dumps core on s390 Greg Kroah-Hartman
2018-07-06  5:47 ` [PATCH 4.14 55/61] perf bpf: Fix NULL return handling in bpf__prepare_load() Greg Kroah-Hartman
2018-07-06  5:47 ` [PATCH 4.14 56/61] fs: clear writeback errors in inode_init_always Greg Kroah-Hartman
2018-07-06  5:47 ` [PATCH 4.14 57/61] sched/core: Fix rules for running on online && !active CPUs Greg Kroah-Hartman
2018-07-06  5:47 ` [PATCH 4.14 58/61] sched/core: Require cpu_active() in select_task_rq(), for user tasks Greg Kroah-Hartman
2018-07-06  5:47 ` [PATCH 4.14 60/61] net/sonic: Use dma_mapping_error() Greg Kroah-Hartman
2018-07-06 17:54 ` [PATCH 4.14 00/61] 4.14.54-stable review Dan Rue
2018-07-07 21:39 ` Guenter Roeck
2018-07-08 13:29   ` Greg Kroah-Hartman
2018-07-09 13:28     ` Guenter Roeck

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=20180706054714.184058642@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=alexander.levin@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=sebott@linux.ibm.com \
    --cc=stable@vger.kernel.org \
    --cc=sth@linux.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.