From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14F33C49ED7 for ; Fri, 13 Sep 2019 15:36:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DA1EA20693 for ; Fri, 13 Sep 2019 15:36:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390715AbfIMPgb (ORCPT ); Fri, 13 Sep 2019 11:36:31 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:53686 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1728811AbfIMPga (ORCPT ); Fri, 13 Sep 2019 11:36:30 -0400 Received: (qmail 3387 invoked by uid 2102); 13 Sep 2019 11:36:30 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 13 Sep 2019 11:36:30 -0400 Date: Fri, 13 Sep 2019 11:36:30 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Paolo Bonzini cc: Greg Kroah-Hartman , Vitaly Kuznetsov , , , , , , , , , , , , , , , , , , , , , , , , syzbot , Dmitry Vyukov , USB list Subject: Re: KASAN: slab-out-of-bounds Read in handle_vmptrld In-Reply-To: <6a0ec3a2-2a52-f67a-6140-e0a60874538a@redhat.com> Message-ID: MIME-Version: 1.0 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 Fri, 13 Sep 2019, Paolo Bonzini wrote: > On 13/09/19 15:02, Greg Kroah-Hartman wrote: > > Look at linux-next, we "should" have fixed up hcd_buffer_alloc() now to > > not need this type of thing. If we got it wrong, please let us know and > > then yes, a fix like this would be most appreciated :) > > I still see > > /* some USB hosts just use PIO */ > if (!hcd_uses_dma(hcd)) { > *dma = ~(dma_addr_t) 0; > return kmalloc(size, mem_flags); > } > > in linux-next's hcd_buffer_alloc and also in usb.git's usb-next branch. > I also see the same > > if (remap_pfn_range(vma, vma->vm_start, > virt_to_phys(usbm->mem) >> PAGE_SHIFT, > size, vma->vm_page_prot) < 0) { > ... > } > > in usbdev_mmap. Of course it's possible that I'm looking at the wrong > branch, or just being dense. Have you seen https://marc.info/?l=linux-usb&m=156758511218419&w=2 ? It certainly is relevant, although Greg hasn't replied to it. There have been other messages on the mailing list about this issue, but I haven't tried to keep track of them. Also, just warning about a non-page-aligned allocation doesn't really help. It would be better to fix the misbehaving allocator. Alan Stern