All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Stanislav Fomichev <sdf@fomichev.me>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, sd@queasysnail.net,
	andrew+netdev@lunn.ch, shuah@kernel.org,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	Cosmin Ratiu <cratiu@nvidia.com>
Subject: Re: [PATCH net 1/2] macsec: set IFF_UNICAST_FLT priv flag
Date: Tue, 22 Jul 2025 17:36:45 +0100	[thread overview]
Message-ID: <20250722163645.GP2459@horms.kernel.org> (raw)
In-Reply-To: <20250721165423.990313-1-sdf@fomichev.me>

On Mon, Jul 21, 2025 at 09:54:22AM -0700, Stanislav Fomichev wrote:
> Cosmin reports the following locking issue:
> 
>   # BUG: sleeping function called from invalid context at
>   kernel/locking/mutex.c:275
>   #   dump_stack_lvl+0x4f/0x60
>   #   __might_resched+0xeb/0x140
>   #   mutex_lock+0x1a/0x40
>   #   dev_set_promiscuity+0x26/0x90
>   #   __dev_set_promiscuity+0x85/0x170
>   #   __dev_set_rx_mode+0x69/0xa0
>   #   dev_uc_add+0x6d/0x80
>   #   vlan_dev_open+0x5f/0x120 [8021q]
>   #  __dev_open+0x10c/0x2a0
>   #  __dev_change_flags+0x1a4/0x210
>   #  netif_change_flags+0x22/0x60
>   #  do_setlink.isra.0+0xdb0/0x10f0
>   #  rtnl_newlink+0x797/0xb00
>   #  rtnetlink_rcv_msg+0x1cb/0x3f0
>   #  netlink_rcv_skb+0x53/0x100
>   #  netlink_unicast+0x273/0x3b0
>   #  netlink_sendmsg+0x1f2/0x430
> 
> Which is similar to recent syzkaller reports in [0] and [1] and triggers
> because macsec does not advertise IFF_UNICAST_FLT although it has proper
> ndo_set_rx_mode callback that takes care of pushing uc/mc addresses
> down to the real device.
> 
> In general, dev_uc_add call path is problematic for stacking
> non-IFF_UNICAST_FLT because we might grab netdev instance lock under
> addr_list_lock spinlock, so this is not a systemic fix.
> 
> 0: https://lore.kernel.org/netdev/686d55b4.050a0220.1ffab7.0014.GAE@google.com
> 1: https://lore.kernel.org/netdev/68712acf.a00a0220.26a83e.0051.GAE@google.com/
> Link: 2aff4342b0f5b1539c02ffd8df4c7e58dd9746e7.camel@nvidia.com

I think that Link: should be followed by a URL

Link: https://lore.kernel.org/netdev/2aff4342b0f5b1539c02ffd8df4c7e58dd9746e7.camel@nvidia.com

> Fixes: 7e4d784f5810 ("net: hold netdev instance lock during rtnetlink operations")
> Reported-by: Cosmin Ratiu <cratiu@nvidia.com>
> Tested-by: Cosmin Ratiu <cratiu@nvidia.com>
> Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>

Hi Stan,

I ran the test provided by patch 2/2.
When run with with a debug kernel using VNG.

It reliably passes with patch 1/2 applied. And fails without patch 1/2 applied.
Where fails means the kernel panics along the lines of the stack trace in
the commit message.

Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Simon Horman <horms@kernel.org>

...

  parent reply	other threads:[~2025-07-22 16:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-21 16:54 [PATCH net 1/2] macsec: set IFF_UNICAST_FLT priv flag Stanislav Fomichev
2025-07-21 16:54 ` [PATCH net 2/2] selftests: rtnetlink: add macsec and vlan nesting test Stanislav Fomichev
2025-07-22 16:37   ` Simon Horman
2025-07-22 16:36 ` Simon Horman [this message]
2025-07-22 18:28   ` [PATCH net 1/2] macsec: set IFF_UNICAST_FLT priv flag Stanislav Fomichev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250722163645.GP2459@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=cratiu@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sd@queasysnail.net \
    --cc=sdf@fomichev.me \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.