lkml.org 
[lkml]   [2018]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [CFT][PATCH] kernfs: Correct kernfs directory seeks.
On Tue, Jun 05, 2018 at 12:47:33PM -0500, Eric W. Biederman wrote:

> Sigh, I have found another issue with kernfs_fop_readdir.
>
> We are not currently protecting file->private_data with the kernfs_mutex
> or any other kind of serialization. Which means if two processes are
> calling readdir on the same file descriptor we might get unpredictable
> behavior.
>
> It doesn't look too bad and easy enough to fix, but definitely something
> to be watchful of.

As discussed off-list - this is not a problem; getdents() et.al. are
serialized on per-struct-file basis by fdget_pos() in relevant syscalls,
since all directories automatically get FMODE_ATOMIC_POS in ->f_mode.

\
 
 \ /
  Last update: 2018-06-07 20:37    [W:0.051 / U:0.852 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site