Date: Thu, 17 Apr 2025 10:28:45 +0000 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 Message-ID: <bug-286153-227@https.bugs.freebsd.org/bugzilla/>
index | next in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=286153 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. -- You are receiving this mail because: You are the assignee for the bug.home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-286153-227>
