Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3471906imu; Sun, 11 Nov 2018 15:53:23 -0800 (PST) X-Google-Smtp-Source: AJdET5cTEyEfJYU7/Oob2TWTUtXVCjIMbaNWi8c7yGRtt5teigXzZf1Y6TOHDPsQuHIp8eR5aYLA X-Received: by 2002:a62:c60a:: with SMTP id m10-v6mr18160597pfg.15.1541980403260; Sun, 11 Nov 2018 15:53:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541980403; cv=none; d=google.com; s=arc-20160816; b=ZvK10pidu1zZvd74WaJEn8tQgGYCOqPIVnNntgCWdPRswMI/OC/N1gFQp3idcDBUXh E4e9IJoo6Ye/cdIkyKdIgS2SLq3tzDiqJtgcp4yATxfZsRSEfCRP4IQ3LIcsl1YFYVPB FX927oqBsQvWdJlwre87u7fV/wXYksRBPeHRIMDlQlmEEGDMDirzi4g/dtajL8BBY/E6 Ec4mq47eKiI5VoCM1Tc0bwjsexWheOhkTZeqlDwE804vXobKt2m+nKAuooLNy9aY/aT7 E1VMFK1aE0DniANVhoBj4CO2qJ3TQo6Lk0HXDrn3R971dK2SGSGVAGpG4bJSdKjUMyFh LFUQ== 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=xGjWIpMDyVqh/knsvMCiRvW/vIZiuruFDlf0okvp470=; b=by6bGUinrlylU0qB0wxdGTNlzL+qB/U7x+pKDckEhgo+DUr09Vzn6lHQCFM+oWem4t vTTFi9ZfXQgXLXtfGbrJ/xi06PWmJdNVOXab2XuSy8EyC4+TjgolxI1QZNZm36yp6Ibl F3X1dLS/5MILdSjPQ7lsNYiToBmXZ01qqfWWrr+RDmZmJvsZVIPDx1mP4Z48cZn5iWTl v8jzLsMyDUKN6LzI7Hz/uNy6kMgStE9WGdo+eNsZMwyOEJKF0+nbDkcPmYv6UumJo+8V xBFIN7p9GPCZzdLR8NMk8REdL0Hmmy/PbId/CpwZXvnZdLWbcW3nfI68ZVip4xOY8pVd iSlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Nj+Q9Ng0; 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 g137-v6si18065537pfb.34.2018.11.11.15.53.08; Sun, 11 Nov 2018 15:53:23 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Nj+Q9Ng0; 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 S1733096AbeKLJl6 (ORCPT + 99 others); Mon, 12 Nov 2018 04:41:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:37518 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732868AbeKLISc (ORCPT ); Mon, 12 Nov 2018 03:18:32 -0500 Received: from localhost (unknown [206.108.79.134]) (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 EEFFC2243E; Sun, 11 Nov 2018 22:28:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975316; bh=PVKfxCesz2ag/ifK4tL2CUSP1Fp939ecLTaDyGErv/s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nj+Q9Ng0nMsHB6qbRJmJB3FeSxAFS/vXSzqyIoQg8NObMwT4r4F+AZSq36zgP9QqO lssFFLPVsSMYJaRuIbqMkZHGAZ+93U8IyW4KqgYOwt+tp2wBXEytYD/a2NyE7HFMvk GrmF3gBFra2AcIKHd1h16MQmN9Qn49qbvOkwJ5dI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans Verkuil , Mauro Carvalho Chehab Subject: [PATCH 4.19 304/361] media: cec: forgot to cancel delayed work Date: Sun, 11 Nov 2018 14:20:51 -0800 Message-Id: <20181111221657.723763203@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans Verkuil commit 490d84f6d73c12f4204241cff8651eed60aae914 upstream. If the wait for completion was interrupted, then make sure to cancel any delayed work. This can only happen if a transmit is waiting for a reply, and you press Ctrl-C or reboot/poweroff or something like that which interrupts the thread waiting for the reply and then proceeds to delete the CEC message. Since the delayed work wasn't canceled, once it would trigger it referred to stale data and resulted in a kernel oops. Fixes: 7ec2b3b941a6 ("cec: add new tx/rx status bits to detect aborts/timeouts") Signed-off-by: Hans Verkuil Cc: # for v4.18 and up Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/cec/cec-adap.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/media/cec/cec-adap.c +++ b/drivers/media/cec/cec-adap.c @@ -831,6 +831,8 @@ int cec_transmit_msg_fh(struct cec_adapt */ mutex_unlock(&adap->lock); wait_for_completion_killable(&data->c); + if (!data->completed) + cancel_delayed_work_sync(&data->work); mutex_lock(&adap->lock); /* Cancel the transmit if it was interrupted */