public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: "Alvin Šipraga" <alvin@pqrs.dk>, "Andrew Lunn" <andrew@lunn.ch>,
	"Vivien Didelot" <vivien.didelot@gmail.com>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Alvin Šipraga" <alsi@bang-olufsen.dk>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 net] net: dsa: fix panic when removing unoffloaded port from bridge
Date: Mon, 21 Feb 2022 18:56:06 -0800	[thread overview]
Message-ID: <f2dcb930-0b20-8956-14a3-14f8f49f4152@gmail.com> (raw)
In-Reply-To: <20220221203539.310690-1-alvin@pqrs.dk>



On 2/21/2022 12:35 PM, Alvin Šipraga wrote:
> From: Alvin Šipraga <alsi@bang-olufsen.dk>
> 
> If a bridged port is not offloaded to the hardware - either because the
> underlying driver does not implement the port_bridge_{join,leave} ops,
> or because the operation failed - then its dp->bridge pointer will be
> NULL when dsa_port_bridge_leave() is called. Avoid dereferncing NULL.
> 
> This fixes the following splat when removing a port from a bridge:
> 
>   Unable to handle kernel access to user memory outside uaccess routines at virtual address 0000000000000000
>   Internal error: Oops: 96000004 [#1] PREEMPT_RT SMP
>   CPU: 3 PID: 1119 Comm: brctl Tainted: G           O      5.17.0-rc4-rt4 #1
>   Call trace:
>    dsa_port_bridge_leave+0x8c/0x1e4
>    dsa_slave_changeupper+0x40/0x170
>    dsa_slave_netdevice_event+0x494/0x4d4
>    notifier_call_chain+0x80/0xe0
>    raw_notifier_call_chain+0x1c/0x24
>    call_netdevice_notifiers_info+0x5c/0xac
>    __netdev_upper_dev_unlink+0xa4/0x200
>    netdev_upper_dev_unlink+0x38/0x60
>    del_nbp+0x1b0/0x300
>    br_del_if+0x38/0x114
>    add_del_if+0x60/0xa0
>    br_ioctl_stub+0x128/0x2dc
>    br_ioctl_call+0x68/0xb0
>    dev_ifsioc+0x390/0x554
>    dev_ioctl+0x128/0x400
>    sock_do_ioctl+0xb4/0xf4
>    sock_ioctl+0x12c/0x4e0
>    __arm64_sys_ioctl+0xa8/0xf0
>    invoke_syscall+0x4c/0x110
>    el0_svc_common.constprop.0+0x48/0xf0
>    do_el0_svc+0x28/0x84
>    el0_svc+0x1c/0x50
>    el0t_64_sync_handler+0xa8/0xb0
>    el0t_64_sync+0x17c/0x180
>   Code: f9402f00 f0002261 f9401302 913cc021 (a9401404)
>   ---[ end trace 0000000000000000 ]---
> 
> Fixes: d3eed0e57d5d ("net: dsa: keep the bridge_dev and bridge_num as part of the same structure")
> Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

  parent reply	other threads:[~2022-02-22  2:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-21 20:35 [PATCH v2 net] net: dsa: fix panic when removing unoffloaded port from bridge Alvin Šipraga
2022-02-21 20:44 ` Vladimir Oltean
2022-02-22  2:56 ` Florian Fainelli [this message]
2022-02-23  1:10 ` patchwork-bot+netdevbpf

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=f2dcb930-0b20-8956-14a3-14f8f49f4152@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=alsi@bang-olufsen.dk \
    --cc=alvin@pqrs.dk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=vivien.didelot@gmail.com \
    --cc=vladimir.oltean@nxp.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox