Re: [PATCH 0/4] Fix type confusion in page_table_check

From: Greg Kroah-Hartman
Date: Wed May 10 2023 - 18:52:10 EST


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@xxxxxxxxxx/T/

Can you see if you can implement Christoph's proposed change instead:
https://lore.kernel.org/r/ZFuZVDcU81WmqEvJ@xxxxxxxxxxxxx

As it might not actually be as bad as you think to require this type of
churn.

thanks,

greg k-h