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

llc: avoid blocking in llc_sap_close()

llc_sap_close() is called by llc_sap_put() which
could be called in BH context in llc_rcv(). We can't
block in BH.

There is no reason to block it here, kfree_rcu() should
be sufficient.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Cong Wang and committed by
David S. Miller
9708d2b5 15033f04

+2 -3
+1
include/net/llc.h
··· 66 66 int sk_count; 67 67 struct hlist_nulls_head sk_laddr_hash[LLC_SK_LADDR_HASH_ENTRIES]; 68 68 struct hlist_head sk_dev_hash[LLC_SK_DEV_HASH_ENTRIES]; 69 + struct rcu_head rcu; 69 70 }; 70 71 71 72 static inline
+1 -3
net/llc/llc_core.c
··· 127 127 list_del_rcu(&sap->node); 128 128 spin_unlock_bh(&llc_sap_list_lock); 129 129 130 - synchronize_rcu(); 131 - 132 - kfree(sap); 130 + kfree_rcu(sap, rcu); 133 131 } 134 132 135 133 static struct packet_type llc_packet_type __read_mostly = {