]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_log: don't hold nf_log_mutex during user access
authorJann Horn <jannh@google.com>
Mon, 25 Jun 2018 15:22:00 +0000 (17:22 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 26 Jun 2018 14:48:40 +0000 (16:48 +0200)
commit65af15142ebf35455762131e8151471634203bf6
tree84e98d9b5c39e5655d98abd3fc4e419f89e4969f
parenteede10f5b36e5b5a27700422a22b5726ce1210a6
netfilter: nf_log: don't hold nf_log_mutex during user access

The old code would indefinitely block other users of nf_log_mutex if
a userspace access in proc_dostring() blocked e.g. due to a userfaultfd
region. Fix it by moving proc_dostring() out of the locked region.

This is a followup to commit 19ce36d630f0 ("netfilter: nf_log: fix
sleeping function called from invalid context"), which changed this code
from using rcu_read_lock() to taking nf_log_mutex.

Fixes: 19ce36d630f0 ("netfilter: nf_log: fix sleeping function calle[...]")
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_log.c