Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9185390pxu; Mon, 28 Dec 2020 08:43:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdnDaldlsXBkCVZz8gkyB/RoTeCXkpjjofgoIYyycNUPCq5om0ZlQ0KYzgD7KmYFfjy3Ne X-Received: by 2002:a50:eb44:: with SMTP id z4mr42018794edp.167.1609173788993; Mon, 28 Dec 2020 08:43:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609173788; cv=none; d=google.com; s=arc-20160816; b=IYJgQxHWV6EXrpIbKF5Jx5p3WW+7XfN6TCjOHwjqwqm/yV5g+sEuMSqyYNCjCxUf0x q5dZyM6xSVjLeWE0B/phQ4j9eJYbjKQ3ktw0J/ehm0WPcA9ogATG9RX00XLLsSd3lpRN GTebkX+qiRP90PyKNhsNUoIMWz+Z7jEtZS9twjhat0VQ1RaDZI8H44vFC3bljMHmO25j Xq8PNxJLvqJQ7M8xmEnh/P3vHlg+3ylRUKSKbNJ+UJNQROzcjKHLJygZDQQch77dDNvC wZfQUm5/JObSmxkez2QbM0op0Ca7YBwOvlUa2mfUACBuxjRga4y0yzxkQO6QCktM+r9k h7pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lOHgQ3W0du22V7VEruuZlIjp+TgTIfqguHefn6t6m4Q=; b=0sbPXeVpXDfL6xermOZh3cs0hJ8Pl8d54Tjx5RLpyMOLkmeEeT58ORu/FL73QDRMPF 8m+q+OutJNSgTG+8yQUdmJMXVSbMKKu3ujpUpHND93SUnqGa+kbrXqofmKX2K/oh5l0h V27L4E0CL1JjLxwMGAjkNMLHVtT4B7KX7l8cknyv8qNv4h4wIOILBTOdo40Vj4pFFX+U 3ImF0KwwiPV1ixaqNgPh1ssIssP0L7AQ7z4L+4hqos50NixIEM1ciFdkYjE1dCorVXUa 3Imy27FfilnwFmuh4DSuES2YDBGwNSO8RZEmXRNOIMJgExoveuOhItQCfQLIw5sK9Kil dtyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oUmJ9wqR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d18si18406114ejd.342.2020.12.28.08.42.41; Mon, 28 Dec 2020 08:43:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oUmJ9wqR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729174AbgL1M7l (ORCPT + 99 others); Mon, 28 Dec 2020 07:59:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:55560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728503AbgL1M7e (ORCPT ); Mon, 28 Dec 2020 07:59:34 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8D34822B45; Mon, 28 Dec 2020 12:59:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160359; bh=V5XK7HyuAyfcsA7ABswim+1ASd/M/u1TgwpVCaBgVqE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oUmJ9wqRBcCP5/u1BmnBun6gkO/Q73ivMpiPHB3sDF+WYrtMj04H9XF1AJddjZKlt 4vHItRyWPs+Ml+91OJd4esE1bcDO7ZQmrAkREfMP+4Tzl//c7+wTs2n4w+eHjcRB5h LBkFp73HawCBviLgW+Y31OmjMjPen5tc4qmOLoEA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Torokhov , syzbot+150f793ac5bc18eee150@syzkaller.appspotmail.com Subject: [PATCH 4.9 007/175] Input: cm109 - do not stomp on control URB Date: Mon, 28 Dec 2020 13:47:40 +0100 Message-Id: <20201228124853.603889601@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124853.216621466@linuxfoundation.org> References: <20201228124853.216621466@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dmitry Torokhov commit 82e06090473289ce63e23fdeb8737aad59b10645 upstream. We need to make sure we are not stomping on the control URB that was issued when opening the device when attempting to toggle buzzer. To do that we need to mark it as pending in cm109_open(). Reported-and-tested-by: syzbot+150f793ac5bc18eee150@syzkaller.appspotmail.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/misc/cm109.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/drivers/input/misc/cm109.c +++ b/drivers/input/misc/cm109.c @@ -571,12 +571,15 @@ static int cm109_input_open(struct input dev->ctl_data->byte[HID_OR2] = dev->keybit; dev->ctl_data->byte[HID_OR3] = 0x00; + dev->ctl_urb_pending = 1; error = usb_submit_urb(dev->urb_ctl, GFP_KERNEL); - if (error) + if (error) { + dev->ctl_urb_pending = 0; dev_err(&dev->intf->dev, "%s: usb_submit_urb (urb_ctl) failed %d\n", __func__, error); - else + } else { dev->open = 1; + } mutex_unlock(&dev->pm_mutex);