From: Eric Dumazet Date: Fri, 3 Jan 2025 10:11:48 +0000 (+0000) Subject: net: hsr: remove one synchronize_rcu() from hsr_del_port() X-Git-Tag: v6.14-rc1~162^2~138 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4475d56145f368d065b05da3a5599d5620ca9408;p=thirdparty%2Fkernel%2Flinux.git net: hsr: remove one synchronize_rcu() from hsr_del_port() Use kfree_rcu() instead of synchronize_rcu()+kfree(). This might allow syzbot to fuzz HSR a bit faster... Signed-off-by: Eric Dumazet Reviewed-by: Simon Horman Link: https://patch.msgid.link/20250103101148.3594545-1-edumazet@google.com Signed-off-by: Jakub Kicinski --- diff --git a/net/hsr/hsr_main.h b/net/hsr/hsr_main.h index fcfeb79bb0401..7d7551e6f0b02 100644 --- a/net/hsr/hsr_main.h +++ b/net/hsr/hsr_main.h @@ -163,6 +163,7 @@ struct hsr_port { struct net_device *dev; struct hsr_priv *hsr; enum hsr_port_type type; + struct rcu_head rcu; }; struct hsr_frame_info; diff --git a/net/hsr/hsr_slave.c b/net/hsr/hsr_slave.c index 464f683e016db..006d6ef97e53f 100644 --- a/net/hsr/hsr_slave.c +++ b/net/hsr/hsr_slave.c @@ -235,7 +235,5 @@ void hsr_del_port(struct hsr_port *port) netdev_upper_dev_unlink(port->dev, master->dev); } - synchronize_rcu(); - - kfree(port); + kfree_rcu(port, rcu); }