From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0B4F4014AD; Thu, 16 Jul 2026 13:51:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784209876; cv=none; b=KMJC1vkEE1jOD18x5zrPJVco+NSTshyhlI9i8op7XM9tKONHvvLEpSkd0qqN6xVLA4j8B+8LjSYCGzp563fIB7eAKUrKzIPQc2rG9w7uZ63iuLS1R3Q1HjIluqrKntVb8dpTTci59bU+CJOh423cXtOZqb2kcJVpveDRVM0Yhvc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784209876; c=relaxed/simple; bh=hsZ1OFHlowWTYewtjhUlgOjcxESDpHJG4WcjaC7jt/w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=H69V0e9vk8RSOSBJG//gMVppmD8aXZO+Gfwp/+ZlmLDGI71nwyEgSxBWUgNlnl3XOI/+3KZV/49IY8wgYiriNrHOrG13xk3eqqsIUDTDQdHQo0U+RABNONKL5ZyRzzEU6AhOkYXgG4lQiT10lEfI4gp52VKju+1v5nUiD6diDtA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QgGlA0n/; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="QgGlA0n/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 312D91F000E9; Thu, 16 Jul 2026 13:51:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784209875; bh=Pwoz+k1Vr4sbTSFJvvZcfUxdY+kzsG4IOYXZ2vtziPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QgGlA0n/qZ2Ct2PfBUKmJiM766CcoAJoqeT/Y4wMIZCIzLKySDpS4guVPQGQqUb5U EislnuIxdU+lqcawJ+aUzfnqIDHNpI+ZvpwS8Dqqg+lMipI5Lz4WasQbrH1ycSoNnQ 6J5EhNRuwxOtljIzQDcJG9sYR5D4GdrleMAo4Mdo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+ad2aac2febc3bedf0962@syzkaller.appspotmail.com, stable , Johan Hovold Subject: [PATCH 7.1 309/518] USB: iowarrior: fix use-after-free on disconnect Date: Thu, 16 Jul 2026 15:29:37 +0200 Message-ID: <20260716133054.584691992@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260716133047.772246337@linuxfoundation.org> References: <20260716133047.772246337@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold commit bc0e4f16c44e50daa0b1ea729934baa3b4815dee upstream. Submitted write URBs are not stopped on close() and therefore need to be stopped unconditionally on disconnect() to avoid use-after-free in the completion handler. Fixes: b5f8d46867ca ("USB: iowarrior: fix use-after-free after driver unbind") Fixes: 946b960d13c1 ("USB: add driver for iowarrior devices.") Reported-by: syzbot+ad2aac2febc3bedf0962@syzkaller.appspotmail.com Link: https://lore.kernel.org/all/6a0ce39b.170a0220.39a13.0007.GAE@google.com/ Cc: stable Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260523170523.1074563-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/iowarrior.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c @@ -905,13 +905,15 @@ static void iowarrior_disconnect(struct /* prevent device read, write and ioctl */ dev->present = 0; + /* write urbs are not stopped on close() so kill unconditionally */ + usb_kill_anchored_urbs(&dev->submitted); + if (dev->opened) { /* There is a process that holds a filedescriptor to the device , so we only shutdown read-/write-ops going on. Deleting the device is postponed until close() was called. */ usb_kill_urb(dev->int_in_urb); - usb_kill_anchored_urbs(&dev->submitted); wake_up_interruptible(&dev->read_wait); wake_up_interruptible(&dev->write_wait); mutex_unlock(&dev->mutex);