lkml.org 
[lkml]   [2021]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: code style: Re: [PATCH v4] printk: Userspace format enumeration support
Chris Down writes:
>open(f);
> debugfs_file_get(f);
> fops->open();
> inode->private = ps;
> debugfs_file_put(f);
>
>remove_printk_fmt_sec(); /* kfree ps */
>
>read(f);
> debugfs_file_get(f);
> fops->read();
> ps = inode->private; /* invalid */
> debugfs_file_put(f);

Er, sorry, inode->private is populated at creation time, not at open(). The
same general concern applies though -- as far as I can tell there's some period
where we may be able to _read() and `ps` has already been freed.

\
 
 \ /
  Last update: 2021-02-17 17:34    [W:0.096 / U:0.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site