Re: [PATCH net-next v3 3/5] macsec: move netdev_upper_dev_link() after macsec_changelink_common()

Sabrina Dubroca <[email protected]>
Newsgroups gmane.linux.network.bridge
Message-ID <ablB_tdLxMPoYtv3__16851.0293866106$1773748983$gmane$org@krikkit>
2026-03-16, 12:26:11 +0800, Hangbin Liu wrote:
> After calling netdev_change_features() in __netdev_upper_dev_link(),
> the call stack looks like:
> 
> - netdev_upper_dev_link
>   - __netdev_upper_dev_link
>     - netdev_change_features
>       - notifier_call_chain
>         - rtnetlink_event
>           - rtmsg_ifinfo_event
>             - rtmsg_ifinfo_build_skb
> 
> In macsec, we call netdev_upper_dev_link() before
> macsec_changelink_common(), which causes the fields of the MACsec
> Security Entity to be uninitialized. Later, macsec_fill_info() returns
> -EMSGSIZE and triggers WARN_ON() in rtmsg_ifinfo_build_skb.
> 
> Fix this by moving netdev_upper_dev_link() after
> macsec_changelink_common(), and return 0 if secy->key_len is not
> initialized yet.
> 
> Suggested-by: Sabrina Dubroca <[email protected]>
> Signed-off-by: Hangbin Liu <[email protected]>
> ---
>  drivers/net/macsec.c | 23 ++++++++++++-----------
>  1 file changed, 12 insertions(+), 11 deletions(-)

I'm not sure I'll manage to look at the rest of the series before it's
applied, but for this patch:

Reviewed-by: Sabrina Dubroca <[email protected]>

Thanks Hangbin.

-- 
Sabrina
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.