From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51731C4332F for ; Tue, 7 Dec 2021 09:20:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233766AbhLGJX2 (ORCPT ); Tue, 7 Dec 2021 04:23:28 -0500 Received: from www62.your-server.de ([213.133.104.62]:47646 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233747AbhLGJX1 (ORCPT ); Tue, 7 Dec 2021 04:23:27 -0500 Received: from sslproxy03.your-server.de ([88.198.220.132]) by www62.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1muWde-00082g-Eg; Tue, 07 Dec 2021 10:19:54 +0100 Received: from [85.1.206.226] (helo=linux.home) by sslproxy03.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1muWdd-000SLZ-Uh; Tue, 07 Dec 2021 10:19:53 +0100 Subject: Re: [syzbot] WARNING: kmalloc bug in xdp_umem_create (2) To: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , syzbot Cc: Andrii Nakryiko , Alexei Starovoitov , bpf , David Miller , Jesper Dangaard Brouer , John Fastabend , Jonathan Lemon , Martin KaFai Lau , KP Singh , Jakub Kicinski , LKML , "Karlsson, Magnus" , Netdev , Song Liu , syzkaller-bugs@googlegroups.com, Yonghong Song , akpm@linux-foundation.org References: <000000000000a3571605d27817b5@google.com> From: Daniel Borkmann Message-ID: <3f854ca9-f5d6-4065-c7b1-5e5b25ea742f@iogearbox.net> Date: Tue, 7 Dec 2021 10:19:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.103.3/26375/Mon Dec 6 10:22:56 2021) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ +Andrew ] On 12/7/21 9:49 AM, Björn Töpel wrote: > On Mon, 6 Dec 2021 at 11:55, syzbot > 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/