Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp437600ybl; Thu, 23 Jan 2020 01:18:28 -0800 (PST) X-Google-Smtp-Source: APXvYqywmGV0/2lO96567H61NnXvHsAxngWbjLy7PuEx6Oruk+LGeNC+LPWvCndt0AA2EmhkZVDw X-Received: by 2002:a9d:664a:: with SMTP id q10mr9784882otm.99.1579771107990; Thu, 23 Jan 2020 01:18:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579771107; cv=none; d=google.com; s=arc-20160816; b=hivmDSMW8qlM0NrAEpq/lFeOpK+Jj0+SHYRVRtYfwGj9ni6KTo2NlygyZWiGIswPC6 lStMdxn9O3Odu9B5LwOa9iI5sQZk7ndznPVOfiUnTB/IoWamd/f0JckpskRT88X8IAVC BrKbSjIyDCpDpSG3JbGRyKdcaI4wr6XiLKqWiit2hYALLym2F9Zx8iLB6G5Ruij9hUUZ GcjerEEn4BC5UiP2dbYoQ0Gcpqc+xQhL5CgbIzsmX8tXtVGSXHK8mQULNrhWfjse7tsW g7Mf0zsNZ/mpEO75GqSfRUIUAD6BgQZ7VSxj2ls9K3g6faYQWYmxKfpy+TL995QDS6lk WBWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=C3nKk1oxgmogssepe+3xKmpa6j5BtHsz8pIct9TujtY=; b=l9brR7vBpzHmHsenI8Y0OesKQd08RqOO7KSK38eAQryRUZHnwiZBHck9LLwuDruYrH 45oD9qeihwCccP2xPvJs8NtNxUQ3VYAo3Vv7+ENPM3vINNu2gl50Un2uWgleVHdSfHj6 5WwYD3wVdHtFPA6liYq1OwNgigNw7B7fb0CNYcMkf6vUZpZGg/PITSB3+UjfWJGc0/jn Ap8cpLGh6zFi1Q0tZksqx8znyhTjaDvv9AbnjysAj74Mb4yaLG08G/hWJpmoMZgEbrIy 9ClNd0HP0ip31XPgw6M9oYVO5ppoPr7UjMxHe9r8BgBFCvI4vky10XdqOytbDAU+WTTG MEDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m9si608613oie.148.2020.01.23.01.18.15; Thu, 23 Jan 2020 01:18:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726231AbgAWJRU (ORCPT + 99 others); Thu, 23 Jan 2020 04:17:20 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:36136 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725785AbgAWJRU (ORCPT ); Thu, 23 Jan 2020 04:17:20 -0500 Received: from [154.119.55.242] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iuYc0-00076J-FJ; Thu, 23 Jan 2020 09:17:18 +0000 From: Stefan Bader To: linux-kernel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org Cc: Alasdair Kergon , Mike Snitzer , Jens Axboe , Tyler Hicks Subject: [PATCH 0/1] Handle NULL make_request_fn in generic_make_request() Date: Thu, 23 Jan 2020 11:17:12 +0200 Message-Id: <20200123091713.12623-1-stefan.bader@canonical.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In ff36ab34583a "dm: remove request-based logic from make_request_fn wrapper", device creation became a 2 stage process. In the first stage, the block device is created which has a queue set up but no mapping function set. This is done in the second stage, when the mapping table is supplied. At that stage the device can become either multi-queue/request based or doing the mapping on the bio level. So right now, it is possible to crash the kernel by doing a - dmsetup create --notable - mount /dev/dm- While this may also need to be some fixing up in the device- mapper codebase, it also should be handled from the block core as allocating a queue can potentially be done separate from assigning a mapping function. There is already one check for not having set up a queue for a device, so this just adds an additional check for make_request_fn being unset before trying to further submit the requests. -Stefan Stefan Bader (1): blk/core: Gracefully handle unset make_request_fn block/blk-core.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.17.1