]> www.infradead.org Git - users/jedix/linux-maple.git/commit
macsec: RXSAs don't need to hold a reference on RXSCs
authorSabrina Dubroca <sd@queasysnail.net>
Fri, 29 Jul 2016 13:37:54 +0000 (15:37 +0200)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 26 Feb 2017 05:34:31 +0000 (21:34 -0800)
commit2aba208122dacc1392892b2dedc0490223a5a4d4
tree21c6df78f4a2bfb9a42ef72ebc62d5d2bcc70235
parent0297e94a88bd234f1399b6ec93a929e0947cc250
macsec: RXSAs don't need to hold a reference on RXSCs

Orabug: 25243093

Following the previous patch, RXSCs are held and properly refcounted in
the RX path (instead of being implicitly held by their SA), so the SA
doesn't need to hold a reference on its parent RXSC.

This also avoids panics on module unload caused by the double layer of
RCU callbacks (call_rcu frees the RXSA, which puts the final reference
on the RXSC and allows to free it in its own call_rcu) that commit
b196c22af5c3 ("macsec: add rcu_barrier() on module exit") didn't
protect against.
There were also some refcounting bugs in macsec_add_rxsa where I didn't
put the reference on the RXSC on the error paths, which would lead to
memory leaks.

Fixes: c09440f7dcb3 ("macsec: introduce IEEE 802.1AE driver")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 36b232c880c99fc03e135198c7c08d3d4b4f83ab)
Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
drivers/net/macsec.c