Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5209538yba; Mon, 13 May 2019 07:12:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgLRYY2jNLL7yoy2pnsv+xYt8ctj/OQH/Xu+VZ8UXHB4RieLJ9DRXa45hkFCOdtfeaWX7R X-Received: by 2002:a65:62cc:: with SMTP id m12mr31213761pgv.118.1557756736413; Mon, 13 May 2019 07:12:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557756736; cv=none; d=google.com; s=arc-20160816; b=xMRRBj8qb74EAR2/AhaoY+zeQmeOeqwpLjt0EhfjJwBxMl5shiGQ+HuQJR3tOMGOHT Ps9ff3tiC2b8GEfjthMKrm/d7RO2GZfaPcNapPimfuKyLmlj5FsvMW3lQrnzpqUPZdwc FczOtxhv+l/3O1CvofDajGARgJrPyqAL8kJFKj6+Ur40p6GAhCYz8a0jjUCwgmSirOK4 RkfyXvbY7qQoNsEkJ7KsihHQbV1I+WToA7hzyUL2KWKd185Ko7g/sV4R9ZFREgaqxmDB AXtDVPSxLOxj0qSUkR8e1Z76RdIiExY6P//VMyWfQ9h+hHO1kK40C5aXGXbgHmyiXhl4 QRtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=MbRZDaat8fLs4n0kt95oTb/Mzq4qXp11zPtn/9EQxOk=; b=dgzo5RB6Tvj00C1kXd1jbO1laCoLrE+T3qLKLyL+3UfSqkJFcBVuTlfvKlYO0GxD2W y9RHQl3ELRQJgcWEc1FuvzZW3QtEB7n7IeM4BYGRPwXMvo2jvC9zI9AkQYc/ZDgJocZK tYhV2HGoHEoIUct8aY8DTI6xuzb7D2dz4xk62WOmEtXMrHHOvk31HdCa0+LX1oP662D4 p7DxP2IcYqL0wyHRu3i0v4G0fCfwR0+32CQExwTFTLsKSrMZ3nOTqCX7Ttf8jAXPI1bt IcQLEpA8J7+CSTOk5TfEADrmlLXH7SE9x7qGIEOk9v80XBnyo0zStf2MsEhK3EVnxtHK 8cbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-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 f3si11343383pln.263.2019.05.13.07.12.01; Mon, 13 May 2019 07:12:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728613AbfEMNlZ (ORCPT + 99 others); Mon, 13 May 2019 09:41:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:50576 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727413AbfEMNlZ (ORCPT ); Mon, 13 May 2019 09:41:25 -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 76755AC38; Mon, 13 May 2019 13:41:23 +0000 (UTC) Message-ID: <1557754110.2793.7.camel@suse.com> Subject: Re: KASAN: use-after-free Read in p54u_load_firmware_cb From: Oliver Neukum To: syzbot , kvalo@codeaurora.org, davem@davemloft.net, andreyknvl@google.com, syzkaller-bugs@googlegroups.com, chunkeey@googlemail.com, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Cc: Michael Wu Date: Mon, 13 May 2019 15:28:30 +0200 In-Reply-To: <00000000000073512b0588c24d09@google.com> References: <00000000000073512b0588c24d09@google.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Mo, 2019-05-13 at 03:23 -0700, syzbot wrote: > syzbot has found a reproducer for the following crash on: > > HEAD commit: 43151d6c 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=16b64110a00000 > kernel config: https://syzkaller.appspot.com/x/.config?x=4183eeef650d1234 > dashboard link: https://syzkaller.appspot.com/bug?extid=200d4bb11b23d929335f > compiler: gcc (GCC) 9.0.0 20181231 (experimental) > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1634c900a00000 > > IMPORTANT: if you fix the bug, please add the following tag to the commit: > Reported-by: syzbot+200d4bb11b23d929335f@syzkaller.appspotmail.com > > usb 1-1: config 0 descriptor?? > usb 1-1: reset high-speed USB device number 2 using dummy_hcd > usb 1-1: device descriptor read/64, error -71 > usb 1-1: Using ep0 maxpacket: 8 > usb 1-1: Loading firmware file isl3887usb > usb 1-1: Direct firmware load for isl3887usb failed with error -2 > usb 1-1: Firmware not found. > ================================================================== > BUG: KASAN: use-after-free in p54u_load_firmware_cb.cold+0x97/0x13a > drivers/net/wireless/intersil/p54/p54usb.c:936 > Read of size 8 at addr ffff88809803f588 by task kworker/1:0/17 Hi, it looks to me as if refcounting is broken. You should have a usb_put_dev() in p54u_load_firmware_cb() or in p54u_disconnect(), but not both. Regards Oliver