Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp306309ybl; Tue, 7 Jan 2020 06:29:51 -0800 (PST) X-Google-Smtp-Source: APXvYqx7637dTi5J5p7s0UptikoFpsqObh5EqNr0pH3mh3/KqU2H0TBdrVWvm0rquVGjnjC3EcVr X-Received: by 2002:a9d:60c4:: with SMTP id b4mr33465otk.166.1578407391249; Tue, 07 Jan 2020 06:29:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578407391; cv=none; d=google.com; s=arc-20160816; b=D+EfyHb0zV29Tdt0axZxfg0g+mPsEForIeZ/BstS27TFMCzIR+ptqjFXlT1/iAlF1X fa7F1FDs9W06OCRKSjtPC67kRU/PCTVHOYJ/oGu0osc7DP3kT5Aj2DfxLkBEPN7dTqF1 j/GghvM7N+YjqlCkbJ39L8PgcihZHUsXgDXKFmQyPPdQK6soAzFFDwb0vzWP5s5ewEMa awalel/z9UbpTB0/AM7uhpUAXMR777TcSutzMSW6UYA7GYTfis8PV4FL26/Y5m0hGruL OuycHyOi1KSVzTB9u6aSSuULAwyZhRbWrObvkYxLwiXcGvEQwy6hGXEAypcuPqkKrkwX Lm+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=m5lSdpvKrQdoMNKY33r6vQZFxtEtwTJgacT6S/p15LA=; b=fbCWJx3kqjjcX0o3J43ONXChU2YyRyWREe7mjtfwvp1b6TJDu8MDp5cUyxnY1wFa55 thzCdt81DFioYv81isvNQ0rm/jVgI4xH5KPAr0vdtvV4XZcOAv4ZunY4kxm3B8aAMvBt a2Xy51p47LunfiuSr7t5RwrpQ7O3ck2TfRiKdY2g/5uqXYDgF7AgTmddcNIvXmyauDEU vMg6S2QxTtHTRjSocWuvsNhCj+FZ6K1ieOr/1nlehw6UuqNhVb4SMOFwMGikpMiDC7ZM tJEspioASUyFcIr+SA6VSkDnKYqJdNsm2iQW6Jwjg/WoW6sVm/czIppgDTTmhyJtlYOM K3DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=V29OXUfw; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9si16055019oti.60.2020.01.07.06.29.38; Tue, 07 Jan 2020 06:29:51 -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=@google.com header.s=20161025 header.b=V29OXUfw; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728248AbgAGO2n (ORCPT + 99 others); Tue, 7 Jan 2020 09:28:43 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:35626 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728129AbgAGO2m (ORCPT ); Tue, 7 Jan 2020 09:28:42 -0500 Received: by mail-pg1-f193.google.com with SMTP id l24so28592126pgk.2 for ; Tue, 07 Jan 2020 06:28:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=m5lSdpvKrQdoMNKY33r6vQZFxtEtwTJgacT6S/p15LA=; b=V29OXUfwm4o6nbaaQVxAuVrKbGji3meV4j+OhIqD7BlXBrA2oYC9ni7MOCSdJb9nBr FIR4XXV6k57HZCW4swIB5KLVE+viDHImvGR8BZyhdjbn3X9Y9KJ2OveARgiZu5Ws4oyu pI9QwBt7aqRgr4yDb/ym+/NBbv82apnB2AIzh3RRNNAD+VUd15KC6X+YVeMSi2ejBQIK ifc5TpiLEXgcZuMPZJd9iPpQwSZsEh+k39If7oIt2A7GM7vKRvXuwZjMtCEew37dToe5 PeUNiii9ntNBSYDcmHRIlOSmtHg+eNmXB9NsUhsqhvuVqx9m6ukydwBa64MmfAOoODes C7pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=m5lSdpvKrQdoMNKY33r6vQZFxtEtwTJgacT6S/p15LA=; b=JzI5rPTpTquyFa1xOP0B/8uwhDib4MEcm404m2zriTdAmOWGxa2kMWIomcp+4XoHfX 1AGtSjD6xIKhu9/HjwkQGCmvrCsXzh4l6Zd5gADal+6k++blq9oica5kALAAHIfiA20g RUGVXqSiBPDtAUWrshLc/xwe0BGtfeJLGHRgDyK0tNSa4rz04ZsjQBc89oku8i4rj7Of 0YpzZWe7PVDW07qkUGcqjJaFH0V+JL3VU2Y0IFCToWwWK+SOqkduLZ73QRn1zEZ6WJ0B Bu3CiCBAJCwZ+7H/58tdgL+RuPKDYsB/coWjPPFLtWrzIlVSh2ojt0JESCRfmtT2ALbO d0jw== X-Gm-Message-State: APjAAAViOL5EzJdfJ2KR5mqt4cA+7KdW4SR1Pv36+PDOwn4CYycp7Gw3 aSoPkfR2Ejm+QGbxGbLDSFoFd8x5oU7+Wz1kNcJPFA== X-Received: by 2002:aa7:9629:: with SMTP id r9mr82321097pfg.51.1578407321830; Tue, 07 Jan 2020 06:28:41 -0800 (PST) MIME-Version: 1.0 References: <000000000000d29687059b3f32aa@google.com> In-Reply-To: From: Andrey Konovalov Date: Tue, 7 Jan 2020 15:28:30 +0100 Message-ID: Subject: Re: WARNING in usbhid_raw_request/usb_submit_urb (2) To: Alan Stern Cc: syzbot , Greg Kroah-Hartman , "Gustavo A. R. Silva" , ingrassia@epigenesys.com, Kernel development list , USB list , syzkaller-bugs Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 3, 2020 at 6:01 PM Alan Stern wrote: > > On Fri, 3 Jan 2020, syzbot wrote: > > > Hello, > > > > syzbot has tested the proposed patch and the reproducer did not trigger > > crash: > > > > Reported-and-tested-by: > > syzbot+10e5f68920f13587ab12@syzkaller.appspotmail.com > > > > Tested on: > > > > commit: ecdf2214 usb: gadget: add raw-gadget interface > > git tree: https://github.com/google/kasan.git > > kernel config: https://syzkaller.appspot.com/x/.config?x=b06a019075333661 > > dashboard link: https://syzkaller.appspot.com/bug?extid=10e5f68920f13587ab12 > > compiler: gcc (GCC) 9.0.0 20181231 (experimental) > > patch: https://syzkaller.appspot.com/x/patch.diff?x=177f06e1e00000 > > > > Note: testing is done by a robot and is best-effort only. > > Andrey: > > Clearly something strange is going on here. First, the patch should > not have changed the behavior; all it did was add some log messages. > Second, I don't see how the warning could have been triggered at all -- > it seems to be complaining that 2 != 2. Hi Alan, It looks like some kind of race in involved here. There are a few indications of that: 1. there's no C reproducer generated for this crash (usually happens because of timing differences when executing syz repro vs C repro), 2. syz repro has threaded, collide and repeat flags turned on (which means it gets executed many times with some syscalls scheduled asynchronously). This also explains the weirdness around the 2 != 2 check being failed. First the comparison failed, then another thread updated one of the numbers being compared, and then the printk statement got executed. > > Does the reproducer really work? Yes, it worked for syzbot at the very least. It looks like your patch introduced some delays which made the bug untriggerable by the same reproducer. Since this is a race it might be quite difficult to reproduce this manually (due to timing differences caused by a different environment setup) as well unfortunately. Perhaps giving a less invasive patch (that minimizes timing changes introduced to the code that is suspected of being racy) to syzbot could be used to debug this. Thanks!