Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2155620ybm; Thu, 23 May 2019 12:16:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGgaX5kKfIJ9BL/WfwqQYmFijrBnad9dzGbgOvRuClXiG0+2QX1zW465UXxS6tGiQpPZzw X-Received: by 2002:a62:5306:: with SMTP id h6mr5903279pfb.29.1558638981268; Thu, 23 May 2019 12:16:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558638981; cv=none; d=google.com; s=arc-20160816; b=o6PsWibyT0IFCKiCtlKOZw0aXQh+LIL8ZSJ87836Gu1eyA/HjyRSK69ve4U+G1zGIl nhMhtNX40oxP75Q/hft4fakznXQxQn1Sz9Zeox5by50y3zis9ZlvSsQFJ2R1Sv1Lvh9v +skAAWk3cxJiC1LEeTH1YkyOATcWQtv0kwTAY6amoChc4JcAEhqCEx84LXRiZHGvXBlJ W/xJGGARsqHkDP5Conyd94cyBETFczfGn+/s4DPs5TMnoXY2834C09Vcf1Z0myaYEyKx OFvnlXHZDBDzVd/swmopXyB6yb7EH0B/8Jpv1qlufm9NqEVIGIar0/1ZG5MnacMY+9TH PD9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+aPcotSd5WZNSUp4Qr5iOdQ+/F0kJ6fmepH/bO6xWoY=; b=stAxR6fcGNQVOYsC+XqhL24GvfuHIoPcn8C5uxDVngU0/3h+mnO5aVeWrudad3uX4u M4a9dpNu/JHBJcH+FTMI5pDOOTP8CEHb7B2gbZ+vRrDoN/M6iu/FjrrsXFxzeQY+qqtn 2NSp2NUk83pmwvWeYRKcElq+y2EtcveuMd4EuaAodTuxoaCit9QHRzB0qZki+dpJ0Xvo KxvOvS+1Pxr79faBKObnqS2BkszNG6qRByjO4y0iWZ6RpqX62y4+QzmX9XaoRbVJbqQw XGNbm+No6nmQJNyq0SHcwtoTxbxqRESJequpLDzjOwbbH7ZUbYslbsRwWjAKA3De6zld KhxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1i5FjDXt; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7si563689pgi.38.2019.05.23.12.16.05; Thu, 23 May 2019 12:16:21 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=1i5FjDXt; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388495AbfEWTNE (ORCPT + 99 others); Thu, 23 May 2019 15:13:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:46912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387921AbfEWTND (ORCPT ); Thu, 23 May 2019 15:13:03 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 78F6B2133D; Thu, 23 May 2019 19:13:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558638783; bh=I6u1nRkixkWgd4+KBmT8cNxNPupYXx8ksFuELRXsnq4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1i5FjDXtv/EzKgDD7H+mss6epe0SW2i+JxEFOlD1wglXi8Zly2u5UqF0iRWHJcGbV unNv6wPmOUbOMCOI/yzmKOc9VExJR8BQnE7ztVk6yXlk7zHSO8NdMNu0nPe2yytZ+3 TeJy8twIHWvCiuqe0GiCz0OhHghvO1Mj4QOjWO4c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mikulas Patocka , Mike Snitzer Subject: [PATCH 4.14 55/77] dm delay: fix a crash when invalid device is specified Date: Thu, 23 May 2019 21:06:13 +0200 Message-Id: <20190523181727.590080797@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181719.982121681@linuxfoundation.org> References: <20190523181719.982121681@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mikulas Patocka commit 81bc6d150ace6250503b825d9d0c10f7bbd24095 upstream. When the target line contains an invalid device, delay_ctr() will call delay_dtr() with NULL workqueue. Attempting to destroy the NULL workqueue causes a crash. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-delay.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/md/dm-delay.c +++ b/drivers/md/dm-delay.c @@ -222,7 +222,8 @@ static void delay_dtr(struct dm_target * { struct delay_c *dc = ti->private; - destroy_workqueue(dc->kdelayd_wq); + if (dc->kdelayd_wq) + destroy_workqueue(dc->kdelayd_wq); dm_put_device(ti, dc->dev_read);