Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: nf_nat: remove obsolete rcu_read_unlock call

hlist walk in find_appropriate_src() is not protected anymore by rcu_read_lock(),
so rcu_read_unlock() is unnecessary if in_range() matches.

This bug was added in (c7232c9 netfilter: add protocol independent NAT core).

Signed-off-by: Ulrich Weber <ulrich.weber@sophos.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Ulrich Weber and committed by
Pablo Neira Ayuso
136251d0 b0cdb1d9

+1 -3
+1 -3
net/netfilter/nf_nat_core.c
··· 201 201 &ct->tuplehash[IP_CT_DIR_REPLY].tuple); 202 202 result->dst = tuple->dst; 203 203 204 - if (in_range(l3proto, l4proto, result, range)) { 205 - rcu_read_unlock(); 204 + if (in_range(l3proto, l4proto, result, range)) 206 205 return 1; 207 - } 208 206 } 209 207 } 210 208 return 0;