Skip to content
Snippets Groups Projects
Forked from drm / msm
Loading
  • Jann Horn's avatar
    7ee47dcf
    fs: use acquire ordering in __fget_light() · 7ee47dcf
    Jann Horn authored and Al Viro's avatar Al Viro committed
    
    We must prevent the CPU from reordering the files->count read with the
    FD table access like this, on architectures where read-read reordering is
    possible:
    
        files_lookup_fd_raw()
                                      close_fd()
                                      put_files_struct()
        atomic_read(&files->count)
    
    I would like to mark this for stable, but the stable rules explicitly say
    "no theoretical races", and given that the FD table pointer and
    files->count are explicitly stored in the same cacheline, this sort of
    reordering seems quite unlikely in practice...
    
    Signed-off-by: default avatarJann Horn <jannh@google.com>
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    7ee47dcf
    History
    fs: use acquire ordering in __fget_light()
    Jann Horn authored and Al Viro's avatar Al Viro committed
    
    We must prevent the CPU from reordering the files->count read with the
    FD table access like this, on architectures where read-read reordering is
    possible:
    
        files_lookup_fd_raw()
                                      close_fd()
                                      put_files_struct()
        atomic_read(&files->count)
    
    I would like to mark this for stable, but the stable rules explicitly say
    "no theoretical races", and given that the FD table pointer and
    files->count are explicitly stored in the same cacheline, this sort of
    reordering seems quite unlikely in practice...
    
    Signed-off-by: default avatarJann Horn <jannh@google.com>
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>