lkml.org 
[lkml]   [2022]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] mm,page_owner: Filter out stacks by a threshold counter
On Thu 01-09-22 06:42:49, Oscar Salvador wrote:
[...]
> +static ssize_t read_page_owner_threshold(struct file *file, char __user *buf,
> + size_t count, loff_t *pos)
> +{
> + char *kbuf;
> + int ret = 0;
> +
> + count = min_t(size_t, count, PAGE_SIZE);
> +
> + if (*pos >= count)
> + return 0;
> +
> + kbuf = kmalloc(count, GFP_KERNEL);

No, you do not want to trigger user defined allocation like that. I
would use seq_file.
--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2022-09-01 10:42    [W:0.093 / U:1.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site