Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp2056235ybj; Wed, 6 May 2020 09:49:32 -0700 (PDT) X-Google-Smtp-Source: APiQypKvEGLKcDT5EywcgOC0p/+i7TiEZjxDSf8JgwyyMlS4L6CBipMsJUD0GNVRYtw3GJwZKZsV X-Received: by 2002:a17:906:ef2:: with SMTP id x18mr8059590eji.234.1588783771942; Wed, 06 May 2020 09:49:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588783771; cv=none; d=google.com; s=arc-20160816; b=HCMb0FL+jxQLPtwDlmg/IrAEMITwYUuK3DHKuWrWPoyuwK4SkTSZLrA+THm4b8b36n 5WlIJPhZTtCAYfh0iImp7UsvFNx51SB4dnspsTEfhdqFDOS5+iCijhKqWCvPTyiR98zu lNwhTh8bRXIR8c3tpf/8Tze+CM6xiMDJoccq/VoX+GNPRxna1z4MSvWJFzVoN8WTc04O aXl3xWZkuzpaEBsVonWq+hW5q/BpZBZjI3XK8swhBjSzDkf1VpNIDd+46LBVut+ORrTT QR2YqF9McaShZpdsvb/ZA4qNmTDPXnmOazy0nbqpB3gjHxMPDEJLub0Kh7YpRRZkUEpb 9yAg== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=D5gcsjRW/Y6Yf/Wf7cSY/UTAOCmTv3dfJwfJ5p0w6mY=; b=ElyB5TtI5WjD/0Dm1oMD9qLK95sKuFOvRKJUrInuja8pOE7Y34QK6EoECAtvNrRfYB fVLkTfSiqwCNfGtMKekRcxfjJXVhgh2BXBO2k8g19TPKQkJczF9vEtcpGxcpb8xc7v36 mbCdoKUokbEgUxrqX4F2hfimFNB11CBtN1tczvAMV5CwI3JpHYd93QOjvDx2CPnE4waU oOW89oFV3vMn0POmNS0gKW44KY4YQA0xKsjFdqHKzNr46MJ5pUxJnBPHcsfDgtTHGNn/ Wptay46KwzGi9ydSMbVelXJYcAQTMhm+7soFsHBen55zTFwZj+c0ss9Fz27qjHKJpegV JhsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZYzs9CyU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q12si1494444edc.303.2020.05.06.09.49.08; Wed, 06 May 2020 09:49:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZYzs9CyU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729789AbgEFQro (ORCPT + 99 others); Wed, 6 May 2020 12:47:44 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:53638 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729414AbgEFQro (ORCPT ); Wed, 6 May 2020 12:47:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588783663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D5gcsjRW/Y6Yf/Wf7cSY/UTAOCmTv3dfJwfJ5p0w6mY=; b=ZYzs9CyU3x1ZeyNiqhdbBYFBkDV1uFKMlgU9yQdCwZthYblEWJT5H5g04rEbtLTWyCfvRF pcz+YYAcmUoHPrSLU/6LQFCKaqiEeLad5ccJQ8WmNGWqmhtv4mvtzvOW0yabpTbIix2yqm CjP8XsXyxJP6h1ysyfBTVFyN5P4mWpg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-286-SSyRdXdjPeWrRvNKHd7Qyg-1; Wed, 06 May 2020 12:47:35 -0400 X-MC-Unique: SSyRdXdjPeWrRvNKHd7Qyg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7B72F107ACF8; Wed, 6 May 2020 16:47:33 +0000 (UTC) Received: from suzdal.zaitcev.lan (ovpn-113-96.phx2.redhat.com [10.3.113.96]) by smtp.corp.redhat.com (Postfix) with ESMTP id C39B96298F; Wed, 6 May 2020 16:47:32 +0000 (UTC) Date: Wed, 6 May 2020 11:47:32 -0500 From: Pete Zaitcev To: Oliver Neukum Cc: Alan Stern , syzbot , andreyknvl@google.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, syzkaller-bugs@googlegroups.com, zaitcev@redhat.com Subject: Re: KASAN: use-after-free Read in usblp_bulk_read Message-ID: <20200506114732.5f81c8c5@suzdal.zaitcev.lan> In-Reply-To: <1588756482.13662.20.camel@suse.com> References: <1588756482.13662.20.camel@suse.com> Organization: Red Hat, Inc. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 06 May 2020 11:14:42 +0200 Oliver Neukum wrote: > Very well. We are not going to find it without exceptional luck. Yet > there may be a real issue, too. We simply do not know. How about the > attached patch? > usblp_unlink_urbs(usblp); > mutex_unlock(&usblp->mut); > + usb_poison_anchored_urbs(&usblp->urbs); > > if (!usblp->used) > usblp_cleanup(usblp); This can't be right. Our URBs are freed by the callback, and this technique is not compatible with poisoning, at least with how the usb/core.c implements it. The usb_poison_urb() waits for URB to complete, and if the callback frees it, it's a problem. -- Pete