Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp4484741rwp; Sun, 16 Jul 2023 04:37:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlFFVmv20pm/8HogxfMSq83Qtz4kRpJQUWygH7ryKEDwXvMxuw3993Wt+Z2x4cEMtebHaadr X-Received: by 2002:a05:6402:110e:b0:51d:acda:2f4a with SMTP id u14-20020a056402110e00b0051dacda2f4amr9892719edv.37.1689507434258; Sun, 16 Jul 2023 04:37:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689507434; cv=none; d=google.com; s=arc-20160816; b=Th2wKcbGF2JXPMdDMQqJvKBvNqzTirZ2aaFLrKQp+d+Lywft4rxb2PKQCe/l+p8qQs leicl8bnxE9AWR1VTx8hkd0i9HbTomNHWatT9FzWNpzz1gXAPgVZTBXSxQEFflvdGh12 pB8sWdaj3/qv9g9rZMUhD2GyDz2gdCKxx2/1nI+/AE5A3DMdDjCcwC1gOxjPjU+MRzrJ CmIi00rS9rS82mo5mLDPPbw0W0f9NxAYk7rXofxdRvhsi0qWj71rRlx8/yvZGr+sRbCU UtA5yblBD85JSe3+MfBrAIXVEOcTsdCzPYBLVk6VwVvpgHatpWaLfT7UoEr69C7sguQO AO4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GOnYVx5YAK+ziErge/1x9HGyqYnguAw6jCerx1KHHb4=; fh=GuOVF23z0STYGZJftc3cqv9n2DFiP8ZHVs4tuJZS4M8=; b=QhfMm5es+wpFwnqkGhPhC+BcuhwwWkRevB6aYQUuSr1TFOaeN1cRGx7MG/5M+lz7w2 WIVRkYMDGaSul4vZYI9HNYFMTtC33z4i9cKr+wPqAdTgvW6JczTw70Ow3ogGAhXgdGXL MNvRHRw+RZc9c3dBVzFCIJrYf8jKuJ7yee2GpQjze7Rc13Drng7SnBT/Nfgz1hsjRA9L BN4iYN4Ul0mUv/M4QQliCVht/6YxWBRT1IfqB8wEy00ovyQdiRnXKIoecg4WPFgbIjY0 lBTrNSEVXcgX3R6XwrrkClbeaC+E2PWyjNHkWPkZzm7JkVyJZsIvsUwWOCUKl+JqmEys 5egQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=lHQYkapW; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u1-20020a05640207c100b0051e04ea21ebsi11876778edy.202.2023.07.16.04.36.54; Sun, 16 Jul 2023 04:37:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=lHQYkapW; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229670AbjGPL3C (ORCPT + 60 others); Sun, 16 Jul 2023 07:29:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjGPL3B (ORCPT ); Sun, 16 Jul 2023 07:29:01 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A7BBE52; Sun, 16 Jul 2023 04:29:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=GOnYVx5YAK+ziErge/1x9HGyqYnguAw6jCerx1KHHb4=; b=lHQYkapWUxpmBZVezHRrXRy+HR pn1BNgG2r6jVTEqLOhK18KRo/D9WG3nPHWJJUhuaHWR1UEdc+maI+AavFMkzfcxfxQQjaZBUxHuLq GLCOKkIR1vYeBxwttP8yMFvjmqeRUnycRgiTXtIqdfVPVdAR+EdHxfk9md6cuwjM5SwdcOKGtan+I +dtzOgPYIRQyjwKNoehOszgu8B8yAz+KV2UdNTjQJFaKw7/ok3MBVm3/e/32AId35uBuoAf/IplkL RVKkjbrrSKBeBjdvhra+giB+TlkPxIf3AbrPi8VgM+Tob9QXq1K7BLnJytzo64UmqyLLwCcFnzPil mIKAGnQw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qKzvS-0032Ta-B6; Sun, 16 Jul 2023 11:28:30 +0000 Date: Sun, 16 Jul 2023 12:28:30 +0100 From: Matthew Wilcox To: Bagas Sanjaya Cc: Vlastimil Babka , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Rudi Heitbaum , Johannes Berg , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Kirill A. Shutemov" , Michael Ellerman , Andrew Morton , Linux Kernel Mailing List , Linux Regressions , Linux Memory Management List , Linux Networking , Linux Wireless Subject: Re: Fwd: mm/page_alloc.c:4453 with cfg80211_wiphy_work [cfg80211] Message-ID: References: <51e53417-cfad-542c-54ee-0fb9e26c4a38@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51e53417-cfad-542c-54ee-0fb9e26c4a38@gmail.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Sun, Jul 16, 2023 at 06:10:44PM +0700, Bagas Sanjaya wrote: > Hi, > > I notice a regression report on Bugzilla [1]. Quoting from it: Maybe you could try doing some work on this bug before just spamming people with it? if (WARN_ON_ONCE_GFP(order > MAX_ORDER, gfp)) return NULL; This is the page allocator telling the caller that they've asked for an unreasonably large allocation. Now, this bug is actually interesting to the MM because the caller called kmalloc() with a ridiculous size. Arguable kmalloc should protect callers from themselves (alloc_pages() is more low level and can presume its users know what they're doing). Vlastimil, what do you think? Something like ... +++ b/mm/slab_common.c @@ -1119,6 +1119,8 @@ static void *__kmalloc_large_node(size_t size, gfp_t flags, int node) void *ptr = NULL; unsigned int order = get_order(size); + if (order > MAX_ORDER) + return NULL; if (unlikely(flags & GFP_SLAB_BUG_MASK)) flags = kmalloc_fix_flags(flags);