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 - 12:31:45 EST


Hello Matthew,

Thanks very much for your prompt response!

For `gup_test_ioctl`, we generate the descriptions for it for
interaction and testing:
```
openat$gup_test(fd const[AT_FDCWD], file ptr[in,
string["/sys/kernel/debug/gup_test"]], flags const[O_RDWR], mode
const[0]) fd_gup_test
ioctl$PIN_FAST_BENCHMARK(fd fd_gup_test, cmd
const[PIN_FAST_BENCHMARK], arg ptr[inout, gup_test])
..
gup_test {
...
gup_flags int32
...
}
```

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 that `gup_test_ioctl` can indeed be exposed in the kernel by
accessing /sys/kernel/debug/gup_test.

Thank you once again for your time and expertise.

Best,
Chenyuan

On Fri, Jan 26, 2024 at 11:11 AM Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:
>
> On Fri, Jan 26, 2024 at 11:04:53AM -0600, Chenyuan Yang wrote:
> > Dear Developers for Linux Memory Management,
> >
> > We encountered 3 warning crashes when testing the memory management
> > with Syzkaller and our generated specifications:
>
> These all come in through gup_test_ioctl(). It's my impression
> that this is something you can enable to wreak havoc on your kernel
> and it's not something which should ever be exposed to fuzzers.
>
>
>
>
>