From nobody Thu Apr 17 10:28:45 2025 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZdYyj4V2jz5sxr1 for ; Thu, 17 Apr 2025 10:28:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZdYyj3NwQz4K2W for ; Thu, 17 Apr 2025 10:28:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744885725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1KlD7sED080uM5itS85wEM0jS/KMJ1Fpqj1RCXa2OIU=; b=h6wb0aNzZqXPpiVaqhCgXiqfvohm0pyucYtUpcegSg6kePKsXu+cXZLJwyFElZhPPWF44e RgJ6jgdRFieNYShrU29T9u1zcuxpGNEI6VskCK7k7d3Bk8SKAvlThtNJk8a1TiF4eaN61a KmbVxEistIr8uw6AViVRS9MZLu/4TfyOEUcLvthZIgjKV7+/G97F8PxZRwaOaFYGMcxumF uyhkQauBAYxB6eBJHQ/0ZJ/9dc7PeLUvwOKWmckKaid/rdItYnBSvdPt2cmlz+o4EA/Xai mI/XtSj9dUAEs2v3cUZMXWBGtD96AMsiU08geOsoM9UqfPyHxXDfpQuTMWEH1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1744885725; a=rsa-sha256; cv=none; b=ZSQP8zsaIQx8xd0T0wkD95fAIPi5GBrv9nEOw5Oz/BXOjIAm5RtThxD6DfL9SUQ9U19sVK xaLToQgeC9bpIg6v2A/yeObCf320KKX83dyJyMWF6ShBCp5RUbG/n3fpQ3m5iEyJsQv+R1 r5hMoF4jZy/p+YUIu6d/zEr4aMMPcHbgfyTf/tTcCno6v0SLFunzuiQd0hbIQweJYjaXzb pq8GyNzi8FUp0JqHvcPmk85+OUH8WJCMWmr2d3af9sOAKv3knBHPCvoGm1aV1MLneDEiHo vnZojJUSkpkPjEbwPZq+ciIH0ucq7puqp2Ncs+W3fPErdvLdxTAdeQTVDOppSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744885725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1KlD7sED080uM5itS85wEM0jS/KMJ1Fpqj1RCXa2OIU=; b=Ir7j3oIGQs1Qva7mU/tVbXLDSwbcN2r3OssTaHS8B7kpa0eGfj/E8UkvW1/+zhDaKBRXRh 03ccUUx4dSe1t93XLE6xwqE1ZJzWUyMSQaWj3rVHVd6qxM26CMirbCZcGVxb3oX0fOdMGq dnqCDefSf7igUBdnQagdeajcRrYI7BqZH/gWriI6/wqqF2tVruIc/0ImN6iffkHcqFtVOu xqxVpOKSbCu5fWImSxYgWMIS7uMYL83KSM1RtcgBmnE0mwB+22v3vL6HWzPKmM/OcudhVM NTZq53M0WmVFlBKjP59N86HtkdaXluJ1n4tOodBpLcOaxOfqOT/g5Kw5oaXKfQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ZdYyj30b9zkRw for ; Thu, 17 Apr 2025 10:28:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 53HASjs8076776 for ; Thu, 17 Apr 2025 10:28:45 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 53HASjBM076774 for bugs@FreeBSD.org; Thu, 17 Apr 2025 10:28:45 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 286153] kernel malloc should fail (panic) when the allocation obviously can never be made Date: Thu, 17 Apr 2025 10:28:45 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 15.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: avg@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D286153 Bug ID: 286153 Summary: kernel malloc should fail (panic) when the allocation obviously can never be made Product: Base System Version: 15.0-CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: avg@FreeBSD.org If a caller requests to allocate more memory than is physically available (e.g., v_page_count * PAGE_SIZE) and passes M_WAITOK, the current code would just wait forever for that much memory to appear. That's not very helpful. IMO, the mistake should be made obvious by panic-ing. At least, when INVARIANTS are enabled. The check could be added to malloc_large or maybe downstream in kmem_malloc_domainset. --=20 You are receiving this mail because: You are the assignee for the bug.=