Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9615982ybi; Wed, 24 Jul 2019 07:08:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwglzGw0OQBDCZ01TBOH5Vb31cDGOLbNqyPiN6b8Ole4+cSD1PaytshyuhDMWkuZD+zEm+a X-Received: by 2002:a17:902:e011:: with SMTP id ca17mr87712921plb.328.1563977319274; Wed, 24 Jul 2019 07:08:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563977319; cv=none; d=google.com; s=arc-20160816; b=Rkv2LacnHu+sHDxgN8dtJF4JdhSfJPm2Yio8pd65f1R6v0oneHBw6qT2wPALiPEHDA QvcSq5yrx2rvYCIXyX3+gH+3RuXUWzkJMF8jMF2VyTGd6UMqHAqy0AMk2botJlq4+8jK ZSNl3Xea+LxNhI9zYs58/Wh+E95vYmZ4SHJLrvdyKQPis2G8C7BvumfNWOTiElGoCPW8 zU3fZG0WO9N/8vKz/cL87w/BL0K3Oi+C0QtgTZOzhAJ02SbJMXZ8emMXJQTcZajBjtxQ oslX4p5LxJUkcuFtsHv6uPp1lKCM0Tdjc4wDxiC5c7zR0qf22Pso7HK/UGG7mWq11x7z a8cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date; bh=aAP7Y1JKDp5NXZGjLE+AEMhaEvZ6P9laeEues5gih94=; b=Bl0JRipT3y2C0NzKvvAZgF3AnZ/HGNyLs1OE0KRPnnCe8/zcU0OzSEceEffy6aGKPC NltFTBDXJEgqQft6QccMJPrgnJaPucxG9u1KGtacDSaeTrKy3O5x31iZMobZ0D9P6FTX /mOlmPKT4zH6vKOuobWsqmyhW7OIdC4c5CnAVfDdXt91yM07UzA04Aa4VnKXpQNzzLBM YpvsUnNCMRB0jGtndpY/CWah+uGGlD2ubwTgCQaxnV49VnRIc43pqoCbpakA58V6iQuo 9ImBiyl80d7IOPDvrozq85CDw6EoDinBPNyeeOXCSqdOixGtM4gQ/cVaHoAZm6UOib7P 5e7A== 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 145si14436168pfb.262.2019.07.24.07.08.24; Wed, 24 Jul 2019 07:08:39 -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 S1727027AbfGXNpn (ORCPT + 99 others); Wed, 24 Jul 2019 09:45:43 -0400 Received: from mx2.suse.de ([195.135.220.15]:53596 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725851AbfGXNpn (ORCPT ); Wed, 24 Jul 2019 09:45:43 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D5957AF5B; Wed, 24 Jul 2019 13:45:41 +0000 (UTC) Date: Wed, 24 Jul 2019 15:45:41 +0200 Message-ID: From: Takashi Iwai To: Andrey Konovalov Cc: Hillf Danton , Alan Stern , syzbot , Greg Kroah-Hartman , "Gustavo A. R. Silva" , LKML , USB list , syzkaller-bugs Subject: Re: WARNING in snd_usb_motu_microbookii_communicate/usb_submit_urb In-Reply-To: References: <000000000000acb99a058b0d5741@google.com> <000000000000ac8f77058e0d11e9@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") 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 Wed, 24 Jul 2019 15:33:21 +0200, Andrey Konovalov wrote: > > On Wed, Jul 24, 2019 at 3:15 PM Takashi Iwai wrote: > > > > On Tue, 23 Jul 2019 19:03:29 +0200, > > Andrey Konovalov wrote: > > > > > > (Takashi, with your helper check syzkaller now generates a new bug > > > report (not reported by syzbot yet due to breakage during kernel boot > > > on 5.3-rc1, so see below) and I guess this has to do with a missing ep > > > != NULL check). > > > > > > kasan: CONFIG_KASAN_INLINE enabled > > > kasan: GPF could be caused by NULL-ptr deref or user memory access > > > general protection fault: 0000 [#1] SMP KASAN > > > CPU: 1 PID: 74 Comm: kworker/1:1 Not tainted 5.3.0-rc1+ #40 > > > Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 > > > Workqueue: usb_hub_wq hub_event > > > RIP: 0010:snd_usb_pipe_sanity_check+0x80/0x130 sound/usb/helper.c:75 > > > Code: 48 c1 ea 03 80 3c 02 00 0f 85 b3 00 00 00 48 8b 6d 00 c1 eb 1e > > > 48 b8 00 00 00 00 00 fc ff df 48 8d 7d 03 48 89 fa 48 c1 ea 03 <0f> b6 > > > 04 02 48 89 fa 83 e2 07 38 d0 7f 04 84 c0 75 7b 48 b8 00 00 > > > RSP: 0018:ffff88806c33f0a8 EFLAGS: 00010246 > > > RAX: dffffc0000000000 RBX: 0000000000000001 RCX: ffffffff833819c2 > > > RDX: 0000000000000000 RSI: ffffffff833819dc RDI: 0000000000000003 > > > RBP: 0000000000000000 R08: ffff88806c330000 R09: fffffbfff0d1a792 > > > R10: fffffbfff0d1a791 R11: ffffffff868d3c8f R12: 0000000000000000 > > > R13: dffffc0000000000 R14: ffff88806975cc80 R15: ffff88806975c4a0 > > > FS: 0000000000000000(0000) GS:ffff88806d100000(0000) knlGS:0000000000000000 > > > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > > > CR2: 00007fcc3a48c000 CR3: 000000006861c003 CR4: 0000000000160ee0 > > > Call Trace: > > > snd_usb_accessmusic_boot_quirk sound/usb/quirks.c:835 [inline] > > > snd_usb_apply_boot_quirk+0xa19/0xc60 sound/usb/quirks.c:1267 > > > usb_audio_probe+0x2ec/0x1f40 sound/usb/card.c:576 > > (snip) > > > > So it's a NULL pointer returned from usb_pipe_endpoint() with an > > invalid pipe. The fix patch is attached below. > > Thanks for the fix! Do you think it makes sense to reuse the already > existing usb_urb_ep_type_check() function instead of > snd_usb_pipe_sanity_check() as Hillf suggested? They seem to be doing > essentially the same thing. Ah yes, that makes sense. I don't mind either way. If Hillf can submit a fix patch quickly, that's better. I decided to have a small own helper for the ease of backporting, possibly to stable trees later on. Other than that, a common helper is a better choice. thanks, Takashi