Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4220707ybl; Tue, 20 Aug 2019 08:40:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRjTJHsxI4ge5VCF9dpmkoilJYwsiQFjCzcnL+gZfqfqhQoVyPN1qaXELXgArVBifBJxEy X-Received: by 2002:a62:e910:: with SMTP id j16mr31443459pfh.123.1566315625666; Tue, 20 Aug 2019 08:40:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566315625; cv=none; d=google.com; s=arc-20160816; b=RAjLy8yVNViB4XELh6FQJsk1xQ5dEjBCeKeU6e/aDDN9ok5eqzJqzENjbp1fFnd3gw h8RepAXZISjG022f8eJxLQ5TPxrYjBE0U0mHMQ8jTzODP+Q3MK3+GszPG/P0BJVGAdtM +EWueZHN0AVkLDFGmDbpRA+REThO6uV2wjm8dYbhmqJ4Md3Zr5PsrkVete+oJTUZt4Mi cZK0OaA0bYMZuQhlrMdpt2Kco5COJHtax8TpCrw6l+DI4PE5pmu1pw59HxLmlPTeL88o sPH/WhmMHBdFRBEm6seYiByYf+Gfm25LOSc1i7lZCyq0d/5+QGfG8nDVRG5HSHEmyZD9 TSOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=SkYFWQJM3Yu2FiDOIzj3qiyzxJyq20fepYzlLH+rfSk=; b=RaWIZOXP17ZBKEc5W+fruz49rZftl5+YtWkqiTE5U9xzPqn+VPqodyb81cjP3tgeB3 Lqi5DQMa14VB6otosBEk2SHNvzU/9bjM4BdzPPEo/N/uN4Ry0k2UX8kP5TqFd9QTkFi7 VMxcdy2vLseJox7kWxxKX1Y00bEM9iibI/GxFvzK5FseNuq3cZ+ebGxvNTeczfPQuhW3 KBcJhTBTC1gTVz3WEcdBe8BZXb7GAxOUFJuEDCb8Lm6KyoYR+UmXohe7YQ9l8Y+bGhtT ICe2wsgmsXiM6vTp4UxKNAs63JAPbHUsoUHAlPUZxdT78Tq6RZRq1LY7eNJhDmMyUO7K 5hXQ== ARC-Authentication-Results: i=1; mx.google.com; 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 b18si4778516plz.135.2019.08.20.08.40.10; Tue, 20 Aug 2019 08:40:25 -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; 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 S1729847AbfHTPOZ (ORCPT + 99 others); Tue, 20 Aug 2019 11:14:25 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:36292 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1725983AbfHTPOZ (ORCPT ); Tue, 20 Aug 2019 11:14:25 -0400 Received: (qmail 4357 invoked by uid 2102); 20 Aug 2019 11:14:24 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 20 Aug 2019 11:14:24 -0400 Date: Tue, 20 Aug 2019 11:14:24 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Oliver Neukum cc: keescook@chromium.org, , , , , syzbot , , Subject: Re: KASAN: use-after-free Read in iowarrior_disconnect In-Reply-To: <1566311916.11678.26.camel@suse.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 20 Aug 2019, Oliver Neukum wrote: > Am Dienstag, den 20.08.2019, 10:18 -0400 schrieb Alan Stern: > > On Mon, 19 Aug 2019, Oliver Neukum wrote: > > > > > Am Montag, den 19.08.2019, 07:48 -0700 schrieb syzbot: > > > > Hello, > > > > > > > > syzbot found the following crash on: > > > > > > > > HEAD commit: d0847550 usb-fuzzer: main usb gadget fuzzer driver > > > > git tree: https://github.com/google/kasan.git usb-fuzzer > > > > console output: https://syzkaller.appspot.com/x/log.txt?x=139be302600000 > > > > kernel config: https://syzkaller.appspot.com/x/.config?x=dbc9c80cc095da19 > > > > dashboard link: https://syzkaller.appspot.com/bug?extid=cfe6d93e0abab9a0de05 > > > > compiler: gcc (GCC) 9.0.0 20181231 (experimental) > > > > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12fe6b02600000 > > > > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1548189c600000 > > > > > > > > IMPORTANT: if you fix the bug, please add the following tag to the commit: > > > > Reported-by: syzbot+cfe6d93e0abab9a0de05@syzkaller.appspotmail.com > > > > > > > > > > #syz test: https://github.com/google/kasan.git d0847550 > > > > There's no need for us to work at cross purposes on this. We can go > > with your approach. > > > > However, the code is more complicated than your patch accounts for. > > The wait can finish in several different ways: > > > > (1) The control URB succeeds and the interrupt URB gets an > > acknowledgment. > > > > (2) The control URB completes with an error. > > > > (3) The wait times out. > > > > (4) A disconnect occurs. > > I absolutely agree. There is something quite wrong in this driver. > Unfortunately this is likely exploitable by a malicious gadget, > so just ignoring this is a bad option. I will need to go through the > logic. Or do you want to have a shot at it? > > The patch was really only for testing. I wanted to know whether > I was hitting this very issue. This driver will need more surgery. If you would like to work on it, that's fine with me. Alan Stern