Re: [Linux Kernel Bug][mm/gup] 3 Warning Crashes: kmalloc bug in gup_test_ioctl, is_valid_gup_args, pin_user_pages_fast

From: Chenyuan Yang
Date: Fri Jan 26 2024 - 14:24:05 EST


Hello John and Matthew,

Thanks a lot for your further explanation of this issue! It really
helps me have a deeper understanding of the testing interface used in
the kernel.

Best,
Chenyuan

On Fri, Jan 26, 2024 at 1:09 PM John Hubbard <jhubbard@xxxxxxxxxx> wrote:
>
> On 1/26/24 10:34, Matthew Wilcox wrote:
> > On Fri, Jan 26, 2024 at 11:31:26AM -0600, Chenyuan Yang wrote:
> >> In this context, I would like to seek your valued opinion. Do you
> >> believe it would be more prudent to avoid fuzz testing the
> >> `gup_test_ioctl`, or are the warnings in `gup_test_ioctl` an
> >> anticipated outcome?
> >
> > It seems like a waste of time. Debian certainly disables it, so
> > unless you can find a distro who enables it, I wouldn't bother.
>
> +1000! The purpose of gup_test_ioctl is to provide a way to invoke,
> from user space, direct testing of some kernel interfaces that are
> not actually exposed to user space for production systems.
>
> Fuzzing this interface is exactly what you should never do. :)
>
> >
> >> It seems that `gup_test_ioctl` can indeed be exposed in the kernel by
> >> accessing /sys/kernel/debug/gup_test.
>
> That's a debug interface.
>
> >
> > If someone wants to fix these things, they can, but it just doesn't
> > seem worth doing. Part of the art of fuzz testing is finding things
> > that are worth testing.
>
> I'll go just slightly further, even: some conceivable "fixes" could end
> up hurting test coverage. Without providing any real benefit.
>
>
> thanks,
> --
> John Hubbard
> NVIDIA
>
>