• peterz@infradead.org's avatar
    perf: Break deadlock involving exec_update_mutex · 78af4dc9
    peterz@infradead.org authored
    Syzbot reported a lock inversion involving perf. The sore point being
    perf holding exec_update_mutex() for a very long time, specifically
    across a whole bunch of filesystem ops in pmu::event_init() (uprobes)
    and anon_inode_getfile().
    
    This then inverts against procfs code trying to take
    exec_update_mutex.
    
    Move the permission checks later, such that we need to hold the mutex
    over less code.
    
    Reported-by: syzbot+db9cdf3dd1f64252c6ef@syzkaller.appspotmail.com
    Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    78af4dc9
core.c 314 KB