Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5585517img; Wed, 27 Mar 2019 11:10:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdWuQfTkdffFgLJFUegh0lStTEOZLIwZWZYuXQy2nfgRH6lDzQzb0pHxYKOi/c2TQvHwK2 X-Received: by 2002:a65:4608:: with SMTP id v8mr36387112pgq.9.1553710227605; Wed, 27 Mar 2019 11:10:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553710227; cv=none; d=google.com; s=arc-20160816; b=FinXTixDwtf2EV2kcZo/WMSZZAsgol9aOLKIigN3/2AAuo+EX2tGiIMVDjpYd2YR+R Zvtj56GUrITy4cSLT+iaZhNHPTU1pbJuFscyvdnGHURzc8dwv49muPiqUudrdnGUbMAs H8Bk/54U2qPv2Zrxbsgb5Zo2/6im548qj20y9jlenh0pZHnneim+KJPRo/eKJdDdRw3p AXHBUXMb5R/t4AUlXCoArMvia7GiTxk5NSWP8Zi2Zc/DggC8s18ofXe/dac86VPlLAmO uxtrqbJGuuHsAQmkZZIlhhvbomKN8vdlasTj4GBi4MpOgIdEDIHN6fNOL+87Zl+WfMGm cNxw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pkOsWCFJGkDNwoNhMOtk8yCRrTnEbxEbUl4C4/3f5lI=; b=TuSRJHPSWEP/B4JjUX0IIiMlPDyRzu+TY7J2BLYapZUYP0jYFQOyzZWPPNVISERPzE p+feY7ShKS+tgZVDqtLqgO/EChufm5AnOKDXC9LmdrJ55lRGKgg+9vLONLG4N/gkhjC9 /VSvjKIHA7ROWKhjE+/KUeA451sDhIFM8faWNXAD/V9BoTmWR8Sp2TtksUUBjnlgbRqL RZ/rfGDjqoWU2ZvxBukdWIJAsdwNq1MU4g7ujkFSK8prtDXF4FJQUDXYrfRnZQjcWXXL SIQXoimdq7nXg1rkEMAVmJ6cWkmIJ9D9VkVnrX95AI+0tToBOtfO/0zdSkdWBXo9YMRA q+dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AcUHQEUF; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l10si18812800pfb.283.2019.03.27.11.10.12; Wed, 27 Mar 2019 11:10:27 -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=AcUHQEUF; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388532AbfC0SJR (ORCPT + 99 others); Wed, 27 Mar 2019 14:09:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:51016 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388514AbfC0SJM (ORCPT ); Wed, 27 Mar 2019 14:09:12 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 58F07217F9; Wed, 27 Mar 2019 18:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710152; bh=6TRaSxgQjJ78zgKBLjuZr9V1KfYyKpvXETRlkqiJE+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AcUHQEUFqydYTArK5WapHMSU+AqcYwfC2oxSjyWgK4azOy4MPHrST+KBerm+iSOGL lJYKymnqoUAr5SMMDqHU4gxJefJxoimIBp4Bbf10b2JRNLuaw2ODgFrAYJSUyhgdm1 3MrWxslyIu63kYDDDplf1Hmdx+pq0uQ2vMSSLNyI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tetsuo Handa , Daniel Vetter , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.0 220/262] drm/vkms: Fix flush_work() without INIT_WORK(). Date: Wed, 27 Mar 2019 14:01:15 -0400 Message-Id: <20190327180158.10245-220-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tetsuo Handa [ Upstream commit b30b61ff6b1dc37f276cf56a8328b80086a3ffca ] syzbot is hitting a lockdep warning [1] because flush_work() is called without INIT_WORK() after kzalloc() at vkms_atomic_crtc_reset(). Commit 6c234fe37c57627a ("drm/vkms: Implement CRC debugfs API") added INIT_WORK() to only vkms_atomic_crtc_duplicate_state() side. Assuming that lifecycle of crc_work is appropriately managed, fix this problem by adding INIT_WORK() to vkms_atomic_crtc_reset() side. [1] https://syzkaller.appspot.com/bug?id=a5954455fcfa51c29ca2ab55b203076337e1c770 Reported-and-tested-by: syzbot Signed-off-by: Tetsuo Handa Reviewed-by: Shayenne Moura Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/1547829823-9877-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp Signed-off-by: Sasha Levin --- drivers/gpu/drm/vkms/vkms_crtc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c index a0bef7de9df7..1054f535178a 100644 --- a/drivers/gpu/drm/vkms/vkms_crtc.c +++ b/drivers/gpu/drm/vkms/vkms_crtc.c @@ -95,6 +95,7 @@ static void vkms_atomic_crtc_reset(struct drm_crtc *crtc) vkms_state = kzalloc(sizeof(*vkms_state), GFP_KERNEL); if (!vkms_state) return; + INIT_WORK(&vkms_state->crc_work, vkms_crc_work_handle); crtc->state = &vkms_state->base; crtc->state->crtc = crtc; -- 2.19.1