From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f198.google.com (mail-oi1-f198.google.com [209.85.167.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D276270EC1 for ; Sat, 20 Jun 2026 18:38:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.198 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781980731; cv=none; b=K95JQmnJcpUbwiSZYASk+SCgRW6TbYpGZwlTFqxncwyCvfprmsf+TWEmU5meViOz+R8ftuTWSqGo1UaFyrnk2VufzaT/IGgesgO3ODoT6A+x4Q94Mqe0KzDZaKbG5QCJKfKSlLkGrg39usdL66maSMnbk+3DrLgt1BCk54+eHVk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781980731; c=relaxed/simple; bh=ve98z9KKzRsP6LiaDmy3mCd44SCJdQhu50kNS2OY/is=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To:Cc: Content-Type; b=I5ULqHEp6kgkDMsY9y7fqiXAKS/YftTJVSLtp8mzpXJ8TSgAld+uTNMqSfgF5Tk9r0AFf11bQYNCZTT6kgAAk93R5qzzQhRM2SGGE7UgrrmcWrptXakIATch/6E0xkHGeU/IiXW9P0eKB52ldyU7mUq2LIMV93tDppYwF7XKwP8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.167.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oi1-f198.google.com with SMTP id 5614622812f47-486a2a910efso6240277b6e.2 for ; Sat, 20 Jun 2026 11:38:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781980729; x=1782585529; h=cc:to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ms9wRszg/7iAf5qcV0f5w2l76hBnrjvIC/ywIHI6JUc=; b=X6eknAtUXHxmW9HaUCcYcx6OMbf0n65ddhcoa3jQiXj9XWboIwULJ2enmAPJBeQd0I iyuvu+fJ4pwY1NsCMhKkQtZu1fTk78bkeXQ79ZB2GZXxlShZBLLva2izhvJ5ffzrHrO1 kyETfAJ6Cx0CBkIt2qELHAzPLCVrVOLHTuZzAggvUnw9ZDYrRKhBF3t38L7hVnk4AS+N XPpU9R0x+n/6TR3vTnWcsWse2rF7Iu96m4JY/LQ4L6X2BHHoFrDmK/Lu+8JmGJMjHjfe MN1ghsx5BJHggpspgYpMCYsENsWRMZvEkALCSOu8nYVdfmoHk8RDQZnN88AHGSTVvrwM du9A== X-Forwarded-Encrypted: i=1; AFNElJ9tBw0znpb0Bbi9IdPI2Gw/MCE9MT7KhhmsBZAg+qI50N1l5ho/ml8tHUo/+Eqnbg4Elcqd5EwB/aZzWTQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwdVusAHK7Bt95v3CELolNekaHt2gX1FlzdT7CTcdCmYjQUa54u 00UVun0Dc0w/vzr2hPsM4q9N/dV/f2vvnYaPPsWLHQVYZGn8VYD9rpLiQK9af3xG62bS78u1icq a8qfsPc8W5UnaWKP8HddiVwQ5p3+tRNOHUM48KoeLLZVx7/zAee+mCiKwOxw= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6808:50aa:b0:48a:3f80:ee54 with SMTP id 5614622812f47-48a3f80fadcmr5779830b6e.23.1781980729340; Sat, 20 Jun 2026 11:38:49 -0700 (PDT) Date: Sat, 20 Jun 2026 11:38:49 -0700 In-Reply-To: <20260620183844.48655-2-birenpandya@gmail.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a36de39.c19584c1.44bb3.0003.GAE@google.com> Subject: Re: [PATCH] media: cec: cancel delayed work before freeing an interrupted transmit From: syzbot To: birenpandya@gmail.com Cc: birenpandya@gmail.com, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" > If wait_for_completion_killable() is interrupted in cec_transmit_msg_fh(), > the previous cancel_delayed_work_sync() could race with the CEC kthread, > which might re-arm the timeout *after* the cancel completes. This leads > to freeing active delayed_work and an ODEBUG warning. > > Fix this by cancelling the delayed work only after removing the data from > the transmit and wait queues, ensuring the kthread cannot re-arm it. Drop > adap->lock around the synchronous cancel to avoid deadlocking with > cec_wait_timeout(). > > Fixes: 490d84f6d73c ("media: cec: forgot to cancel delayed work") > Reported-by: syzbot+051024d603432b4ab395@syzkaller.appspotmail.com > Closes: https://syzkaller.appspot.com/bug?extid=051024d603432b4ab395 > Cc: stable@vger.kernel.org > Signed-off-by: Biren Pandya > --- > #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master This crash does not have a reproducer. I cannot test it. > drivers/media/cec/core/cec-adap.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/cec/core/cec-adap.c b/drivers/media/cec/core/cec-adap.c > index 8f7244ac1d43..50bd8bbeb5a5 100644 > --- a/drivers/media/cec/core/cec-adap.c > +++ b/drivers/media/cec/core/cec-adap.c > @@ -965,7 +965,6 @@ int cec_transmit_msg_fh(struct cec_adapter *adap, struct cec_msg *msg, > */ > mutex_unlock(&adap->lock); > err = wait_for_completion_killable(&data->c); > - cancel_delayed_work_sync(&data->work); > mutex_lock(&adap->lock); > > if (err) > @@ -985,6 +984,13 @@ int cec_transmit_msg_fh(struct cec_adapter *adap, struct cec_msg *msg, > list_del(&data->list); > if (WARN_ON(!list_empty(&data->xfer_list))) > list_del(&data->xfer_list); > + > + if (!cancel_delayed_work(&data->work)) { > + mutex_unlock(&adap->lock); > + cancel_delayed_work_sync(&data->work); > + mutex_lock(&adap->lock); > + } > + > kfree(data); > return 0; > } > -- > 2.50.1