Re: [syzbot] [mm?] WARNING in __gup_longterm_locked

From: Linus Torvalds
Date: Tue Jul 04 2023 - 13:13:49 EST


On Tue, 4 Jul 2023 at 10:01, Eric Biggers <ebiggers@xxxxxxxxxx> wrote:
>
> syzkaller just makes system calls.
>
> Unless you want to do the crazy thing of checking if current->comm begins with
> "syz", I don't think there is a way to distinguish.

Yeah, that's what I thought.

> In the past there's been some discussion of adding a kconfig option like
> CONFIG_FUZZ_TESTING that would be expected to be enabled in order to run a
> kernel fuzzer, and changing behavior in certain cases based on that. Changing
> behavior in production vs. test is problematic, though...

Agreed. The whole point of a fuzzer is to check the real thing. This
test for GUP expansion really is a pretty specialized thing.

Maybe the WARN_ON_ONCE() could have been just a "pr_warn_once()", but
at the same time, *if* that condition ever happens in some real
situation, I'd really want to know just exactly *what* the app in
question is doing.

Linus