Thread (2 messages) 2 messages, 2 authors, 2021-06-30

Re: [PATCH] add kernel log when allocate a new virtual mapping failed because of overcommit

From: Matthew Wilcox <willy@infradead.org>
Date: 2021-06-30 13:30:58

On Wed, Jun 30, 2021 at 03:44:33PM +0800, Xu Huijie wrote:
quoted hunk ↗ jump to hunk
From: xuhuijie <redacted>
diff --git a/mm/mmap.c b/mm/mmap.c
index aa9de981b..f019fc6b2 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1758,8 +1758,10 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
 	 */
 	if (accountable_mapping(file, vm_flags)) {
 		charged = len >> PAGE_SHIFT;
-		if (security_vm_enough_memory_mm(mm, charged))
+		if (security_vm_enough_memory_mm(mm, charged)) {
+			pr_err("Unable to allocate a new virtual mapping because of the overcommit\n");
No, we don't let unprivileged processes flood the kernel logs.  If this
is genuinely useful, something like pr_info_ratelimited() might be
appropriate.  It certainly doesn't rise to the level of "error".

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help