Thread (5 messages) 5 messages, 2 authors, 2021-06-18

Re: [PATCH] staging: android: ashmem: add size field in procfs fdinfo

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2021-06-18 10:23:27
Also in: lkml

On Fri, Jun 18, 2021 at 05:50:35PM +0800, liuhailong wrote:
quoted hunk ↗ jump to hunk
add this information to help user to find ashmem problem.

ashmem leak scenario:
-000|fd = ashmem_create_region
-001|mmap and pagefault
-002|munmap
-003|forget close(fd) <---- which lead to ashmem leak

Signed-off-by: liuhailong <redacted>
---
 drivers/staging/android/ashmem.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
index d66a64e42273..ee2fd75111d8 100644
--- a/drivers/staging/android/ashmem.c
+++ b/drivers/staging/android/ashmem.c
@@ -894,6 +894,8 @@ static void ashmem_show_fdinfo(struct seq_file *m, struct file *file)
 		seq_printf(m, "name:\t%s\n",
 			   asma->name + ASHMEM_NAME_PREFIX_LEN);
 
+	seq_printf(m, "size:\t%zu\n", asma->size);
+
 	mutex_unlock(&ashmem_mutex);
 }
 #endif
-- 
2.30.2
As you are changing a user-facing proc file, what tools will break now
that you have added a new line?

What tools do you use to look at this file and what has been modified to
handle the change?

thanks,

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