ClangBuiltLinux / thread-safety-analysis

A research project into applying Clang's Thread Safety Analysis to the Linux Kernel
Other
6 stars 0 forks source link

kernel/seccomp.c: seccomp_set_mode_filter(): mutex `cred_guard_mutex` conditionally locked and unlocked #158

Open bulwahn opened 5 years ago

bulwahn commented 5 years ago
kernel/seccomp.c:1302:2: warning: mutex 'get_current().signal->cred_guard_mutex' is not held on every path through here [-Wthread-safety-analysis]
        spin_lock_irq(&current->sighand->siglock);
        ^
kernel/seccomp.c:1299:6: note: mutex acquired here
            mutex_lock_killable(&current->signal->cred_guard_mutex))
            ^
kernel/seccomp.c:1317:3: warning: releasing mutex 'get_current().signal->cred_guard_mutex' that was not held [-Wthread-safety-analysis]
                mutex_unlock(&current->signal->cred_guard_mutex);
                ^

seccomp_set_mode_filter() only tries to lock and unlock current->signal->cred_guard_mutex when the SECCOMP_FILTER_FLAG_TSYNC is set.