Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7984297rwr; Wed, 10 May 2023 16:02:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5fKZyM7oKntnQpeEt7WcPslKcUFsTDfxVWsHvokKGEFLE3iI9a3OjOt+FJX24eZJmUBb/3 X-Received: by 2002:a05:6a00:990:b0:638:edbc:74ca with SMTP id u16-20020a056a00099000b00638edbc74camr26584748pfg.0.1683759764734; Wed, 10 May 2023 16:02:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683759764; cv=none; d=google.com; s=arc-20160816; b=ARAu93UtzKOBSVh96e5gFu5i/U94HFQMVlokY21DN1JS2JIPUt2eOLAOSUXu4c9n/d 4ULZUC6m0C+AZUVcIw0IrCVs2lKR/v9RV8YY7KvJQh5asir/gEUBjezemqskUOkS5SJW itZ/di6twqfu27jU2x93CbzcacM+H5zkHJfR/H0rR3ddRaPFmkY2qD1/IlpmEKlPOS2S JwbuWOXsOCYlZ73G7wsCJrO+rSUoa8fnLuUA9Er49qLlg5q0gzi4yZ/eXYAcSDXE0B7g H0CbwA4rq2F5DTCBJPhtploEDIPPfCNggUKaTm73K5QJBzhwnmGy/hEp4vCK5wxv+346 kNMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3KYw6EP/jsQ2HwAD57HvkcL5uEoSTGGpm3noezkYaPk=; b=T6OSj+1nLk1YJG5nTjyqauwTJ0Pbc5qeB5DHTN7pWp4uu+fZqZyluKQJfD9bfdf7NY tBwxTxHCPI3R+sGRRkbEHKueresguGwu/Cj8/0URR+uUF2JKewBbwJ9WFKXXGbgqhLiX WYuozmAioX29aTA8LbygnR5AAh6PhXSQtdrUfdyC8VHp960SPJaqfnHoRYYU/WOPUcQl hNbhAY9Igx1Y//FIQXydbAbVkXpys6okcv8jwqFepUogNcVXD1WA2XgzMIQn8HIbdo/X afeiyNs1AePO5zoQxoBYcio6Z0UPIS7qsvYh0BxQxXndHv68u4hiKt5Wug7Ey1bVE0It M3Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Erg8wLct; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k20-20020aa79734000000b006438e35303csi5945522pfg.260.2023.05.10.16.02.31; Wed, 10 May 2023 16:02:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Erg8wLct; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236375AbjEJWwH (ORCPT + 99 others); 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> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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