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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4894FC7EE22 for ; Wed, 10 May 2023 22:52:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236229AbjEJWwH (ORCPT ); Wed, 10 May 2023 18:52:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229836AbjEJWwG (ORCPT ); Wed, 10 May 2023 18:52:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BD80271F; Wed, 10 May 2023 15:52:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E5EB4640FE; Wed, 10 May 2023 22:52:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75E3DC433D2; Wed, 10 May 2023 22:52:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1683759124; bh=SfC29pkbPFsP7SvqkKQKsejqsVIjIBqmlouYzbhT+ZQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Erg8wLctyK2t2eLGbGIDKzcYMYdynzb6YP0fvPYdtvmRCA0HIUkXiKkOf4F86i4On /gAoGwte4tnDWGWIrYUDuYIg+I9Znik+4KZVnp+lMxH3g2x/3Fe3eDa0iD7K811y6r n4pD/uLiIJGwrvwTzme6mcOYZfRdLIABA20NFbMM= Date: Thu, 11 May 2023 07:51:58 +0900 From: Greg Kroah-Hartman To: Ruihan Li Cc: linux-mm@kvack.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Pasha Tatashin , David Hildenbrand , Matthew Wilcox , Andrew Morton , Christoph Hellwig Subject: Re: [PATCH 0/4] Fix type confusion in page_table_check Message-ID: <2023051108-lens-unsocial-8425@gregkh> References: <20230510085527.57953-1-lrh2000@pku.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230510085527.57953-1-lrh2000@pku.edu.cn> Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Wed, May 10, 2023 at 04:55:23PM +0800, Ruihan Li wrote: > Recently, syzbot reported [1] ("kernel BUG in page_table_check_clear"). > The root cause is that usbdev_mmap calls remap_pfn_range on kmalloc'ed > memory, which leads to type confusion between struct page and slab in > page_table_check. This series of patches fixes the usb side by avoiding > mapping slab pages into userspace, and fixes the mm side by enforcing > that all user-accessible pages are not slab pages. A more detailed > analysis and some discussion of how to fix the problem can also be found > in [1]. > > [1] https://lore.kernel.org/lkml/20230507135844.1231056-1-lrh2000@pku.edu.cn/T/ Can you see if you can implement Christoph's proposed change instead: https://lore.kernel.org/r/ZFuZVDcU81WmqEvJ@infradead.org As it might not actually be as bad as you think to require this type of churn. thanks, greg k-h