Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp165997ybl; Tue, 7 Jan 2020 04:11:03 -0800 (PST) X-Google-Smtp-Source: APXvYqzlZJ70Ynvg282pGYm08p5AUmDqoBhGNvtn6YApoBwVuQJKQHMpiRfkVqZn84v6XaG3G5gT X-Received: by 2002:a9d:7d09:: with SMTP id v9mr105305296otn.338.1578399063612; Tue, 07 Jan 2020 04:11:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578399063; cv=none; d=google.com; s=arc-20160816; b=rBsDG8F7AqaNywu9y62wG0iUm+fojsMqZFl7Bisvu+22X/v2AJNPo+xvHmVSPz84nW Teph/vWkxzgnfvN1Ez91oZMCAIyRra8clpEfZSVB2oKHG7nKMP70zHK4qqXSXCsj3Jxs kgVS085lzSkAJWzC4Li67qsUBcFrTO90CTCqg3TcyJhl6rvHiI47ZNAjpoL7PW5mmweD tOAiS4pvMQaAAcE5FdSIb37ESzg960doVvGi0lgjpViX8uxs7TXhj5Owoj8727DrPBsA 1cRpIGG9eEYGfvfnNpz1xZxl8Q2qTzC26hlTOJOaO3Jq4rAwjLoX7t1Qpl9VN1lT+sgF b2QQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=LYwUoxSLo8UQwwqY3Ag7JuvdrOolW12dSnbzPSxXflU=; b=ElALjWrlmH1uhz0Un6depn5aKLMZ2HN5Uo94Lb1R1j6vLtOge+oNCYEanQx/Iwejq6 cVQloxVFa+KrsUakBiVl0vQyOQm0tyNTjbokRwaBssrMF8vPhdC5IwIc8eZBrMk2yL2H 9UF3pVciBTndVii2TMizvAjvf9sRhrPIGrjhAZOjOI6qsG7SiLITJja6aSm+RRNdvnNY Wc68k7aTxtUoVBiDhVYtHg4HfjcyXJyV2FxnnI0drmU6fr7O1UjrhMrL7+B+xse2NmCk 1g1UliVn08FWMGspEz0VUcCO8EzpH5qEW7JRXJQpSCQjTb1Av/W0ml8F8Uj8fXVH5vku YKqQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1si32409424otj.276.2020.01.07.04.10.51; Tue, 07 Jan 2020 04:11:03 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727995AbgAGMHa (ORCPT + 99 others); Tue, 7 Jan 2020 07:07:30 -0500 Received: from mga18.intel.com ([134.134.136.126]:63952 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727834AbgAGMHa (ORCPT ); Tue, 7 Jan 2020 07:07:30 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jan 2020 04:07:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,406,1571727600"; d="scan'208";a="303173288" Received: from mattu-haswell.fi.intel.com (HELO [10.237.72.170]) ([10.237.72.170]) by orsmga001.jf.intel.com with ESMTP; 07 Jan 2020 04:07:27 -0800 Subject: Re: BUG: KASAN: use-after-free in xhci_trb_virt_to_dma.part.24+0x1c/0x80 To: Mika Westerberg , Paul Menzel Cc: Greg KH , Mathias Nyman , linux-usb@vger.kernel.org, LKML References: <95b4bdb2-962f-561e-ac14-79cd44395915@molgen.mpg.de> <20180720095410.GA11904@kroah.com> <107dbdd1-4e45-836f-7f8f-85bc63374e4f@molgen.mpg.de> <30b069b5-63f6-dd9e-b323-668f06bff6cf@molgen.mpg.de> <20200103110451.GJ465886@lahna.fi.intel.com> From: Mathias Nyman Message-ID: <81c6f906-3f5a-729d-f3b4-1ac6ac607c05@linux.intel.com> Date: Tue, 7 Jan 2020 14:09:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20200103110451.GJ465886@lahna.fi.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3.1.2020 13.04, Mika Westerberg wrote: > On Thu, Jan 02, 2020 at 03:10:14PM +0100, Paul Menzel wrote: >> Mika, as you fixed the other leak, any idea, how to continue from the >> kmemleak log below? >> >> ``` >> unreferenced object 0xffff8c207a1e1408 (size 8): >> comm "systemd-udevd", pid 183, jiffies 4294667978 (age 752.292s) >> hex dump (first 8 bytes): >> 34 01 05 00 00 00 00 00 4....... >> backtrace: >> [<00000000aea7b46d>] xhci_mem_init+0xcfa/0xec0 [xhci_hcd] > > There are probably better ways for doing this but you can use objdump > for example: > > $ objdump -l --prefix-addresses -j .text --disassemble=xhci_mem_init drivers/usb/host/xhci-hcd.ko > > then find the offset xhci_mem_init+0xcfa. It should show you the line > numbers as well if you have compiled your kernel with debug info. This > should be close to the line that allocated the memory that was leaked. > Paul, it possible that your xhci controller has several supported protocol extended capabilities for usb 3 ports, each with their own custom protocol speed ID table. xhci driver assumes there is only one custome PSI table per roothub, and we will end up allocating the second PSI table on top of the first, leaking the first. Could you boot with xhci dynamic debug enabled, and show dmesg after boot, add: xhci_hcd.dyndbg=+p to you kernel cmdline. Or as an alternative, show output of: sudo cat /sys/kernel/debug/usb/xhci/*/reg-ext-protocol* -Mathias