From: Daniel Borkmann <daniel@iogearbox.net>
To: "Björn Töpel" <bjorn.topel@gmail.com>,
syzbot <syzbot+11421fbbff99b989670e@syzkaller.appspotmail.com>
Cc: Andrii Nakryiko <andrii@kernel.org>,
Alexei Starovoitov <ast@kernel.org>, bpf <bpf@vger.kernel.org>,
David Miller <davem@davemloft.net>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Jonathan Lemon <jonathan.lemon@gmail.com>,
Martin KaFai Lau <kafai@fb.com>, KP Singh <kpsingh@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
"Karlsson, Magnus" <magnus.karlsson@intel.com>,
Netdev <netdev@vger.kernel.org>, Song Liu <songliubraving@fb.com>,
syzkaller-bugs@googlegroups.com, Yonghong Song <yhs@fb.com>,
akpm@linux-foundation.org
Subject: Re: [syzbot] WARNING: kmalloc bug in xdp_umem_create (2)
Date: Tue, 7 Dec 2021 10:19:53 +0100 [thread overview]
Message-ID: <3f854ca9-f5d6-4065-c7b1-5e5b25ea742f@iogearbox.net> (raw)
In-Reply-To: <CAJ+HfNhyfsT5cS_U9EC213ducHs9k9zNxX9+abqC0kTrPbQ0gg@mail.gmail.com>
[ +Andrew ]
On 12/7/21 9:49 AM, Björn Töpel wrote:
> On Mon, 6 Dec 2021 at 11:55, syzbot
> <syzbot+11421fbbff99b989670e@syzkaller.appspotmail.com> wrote:
>>
>> Hello,
>>
>> syzbot found the following issue on:
>>
>> HEAD commit: a51e3ac43ddb Merge tag 'net-5.16-rc4' of git://git.kernel...
>> git tree: net
>> console output: https://syzkaller.appspot.com/x/log.txt?x=17f04ebeb00000
>> kernel config: https://syzkaller.appspot.com/x/.config?x=5b0eee8ab3ea1839
>> dashboard link: https://syzkaller.appspot.com/bug?extid=11421fbbff99b989670e
>> compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
>>
>> Unfortunately, I don't have any reproducer for this issue yet.
>>
>> IMPORTANT: if you fix the issue, please add the following tag to the commit:
>> Reported-by: syzbot+11421fbbff99b989670e@syzkaller.appspotmail.com
>>
>
> This warning stems from mm/utils.c:
> /* Don't even allow crazy sizes */
> if (WARN_ON_ONCE(size > INT_MAX))
> return NULL;
>
> The structure that is being allocated is the page-pinning accounting.
> AF_XDP has an internal limit of U32_MAX pages, which is *a lot*, but
> still fewer than what memcg allows (PAGE_COUNTER_MAX is a
> LONG_MAX/PAGE_SIZE on 64b systems).
>
> The (imo hacky) workaround to silence the warning is to decrease the
> U32_MAX limit to something that is less than "sizeof householding
> struct".
>
> Note that this is a warning, and not an oops/bug.
>
> Thoughts?
This is coming from 7661809d493b ("mm: don't allow oversized kvmalloc() calls").
There was a recent discussion on this topic here [0]; this adds another instance.
Iff removal would not be an option, could we maybe add a __GFP_LARGE flag to tag
these instances that it is indeed intended that large allocs are allowed (and they
would thus bypass this warning)?
Thanks,
Daniel
[0] https://lore.kernel.org/bpf/20211201202905.b9892171e3f5b9a60f9da251@linux-foundation.org/
next prev parent reply other threads:[~2021-12-07 9:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-06 10:55 [syzbot] WARNING: kmalloc bug in xdp_umem_create (2) syzbot
2021-12-07 8:49 ` Björn Töpel
2021-12-07 9:19 ` Daniel Borkmann [this message]
2022-02-10 2:59 ` syzbot
2022-02-10 6:08 ` syzbot
2022-02-10 8:11 ` Willy Tarreau
2022-02-10 8:35 ` Daniel Borkmann
2022-02-10 16:18 ` Björn Töpel
2022-02-10 17:45 ` Dan Carpenter
2022-02-10 17:56 ` Dan Carpenter
2022-02-10 18:04 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3f854ca9-f5d6-4065-c7b1-5e5b25ea742f@iogearbox.net \
--to=daniel@iogearbox.net \
--cc=akpm@linux-foundation.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bjorn.topel@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=davem@davemloft.net \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=jonathan.lemon@gmail.com \
--cc=kafai@fb.com \
--cc=kpsingh@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=magnus.karlsson@intel.com \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@fb.com \
--cc=syzbot+11421fbbff99b989670e@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).