* [PATCH net] net: lapbether: fix issue of invalid opcode in lapbeth_open()
@ 2022-11-07 1:14 Zhengchao Shao
2022-11-08 12:30 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Zhengchao Shao @ 2022-11-07 1:14 UTC (permalink / raw)
To: linux-x25, netdev, ms, davem, edumazet, kuba, pabeni
Cc: xie.he.0141, weiyongjun1, yuehaibing, shaozhengchao
If lapb_register() failed when lapb device goes to up for the first time,
the NAPI is not disabled. As a result, the invalid opcode issue is
reported when the lapb device goes to up for the second time.
The stack info is as follows:
[ 1958.311422][T11356] kernel BUG at net/core/dev.c:6442!
[ 1958.312206][T11356] invalid opcode: 0000 [#1] PREEMPT SMP KASAN
[ 1958.315979][T11356] RIP: 0010:napi_enable+0x16a/0x1f0
[ 1958.332310][T11356] Call Trace:
[ 1958.332817][T11356] <TASK>
[ 1958.336135][T11356] lapbeth_open+0x18/0x90
[ 1958.337446][T11356] __dev_open+0x258/0x490
[ 1958.341672][T11356] __dev_change_flags+0x4d4/0x6a0
[ 1958.345325][T11356] dev_change_flags+0x93/0x160
[ 1958.346027][T11356] devinet_ioctl+0x1276/0x1bf0
[ 1958.346738][T11356] inet_ioctl+0x1c8/0x2d0
[ 1958.349638][T11356] sock_ioctl+0x5d1/0x750
[ 1958.356059][T11356] __x64_sys_ioctl+0x3ec/0x1790
[ 1958.365594][T11356] do_syscall_64+0x35/0x80
[ 1958.366239][T11356] entry_SYSCALL_64_after_hwframe+0x46/0xb0
[ 1958.377381][T11356] </TASK>
Fixes: 514e1150da9c ("net: x25: Queue received packets in the drivers instead of per-CPU queues")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
drivers/net/wan/lapbether.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
index 960f1393595c..c485b371e844 100644
--- a/drivers/net/wan/lapbether.c
+++ b/drivers/net/wan/lapbether.c
@@ -325,6 +325,7 @@ static int lapbeth_open(struct net_device *dev)
err = lapb_register(dev, &lapbeth_callbacks);
if (err != LAPB_OK) {
+ napi_disable(&lapbeth->napi);
pr_err("lapb_register error: %d\n", err);
return -ENODEV;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: lapbether: fix issue of invalid opcode in lapbeth_open()
2022-11-07 1:14 [PATCH net] net: lapbether: fix issue of invalid opcode in lapbeth_open() Zhengchao Shao
@ 2022-11-08 12:30 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-11-08 12:30 UTC (permalink / raw)
To: Zhengchao Shao
Cc: linux-x25, netdev, ms, davem, edumazet, kuba, pabeni, xie.he.0141,
weiyongjun1, yuehaibing
Hello:
This patch was applied to netdev/net.git (master)
by Paolo Abeni <pabeni@redhat.com>:
On Mon, 7 Nov 2022 09:14:45 +0800 you wrote:
> If lapb_register() failed when lapb device goes to up for the first time,
> the NAPI is not disabled. As a result, the invalid opcode issue is
> reported when the lapb device goes to up for the second time.
>
> The stack info is as follows:
> [ 1958.311422][T11356] kernel BUG at net/core/dev.c:6442!
> [ 1958.312206][T11356] invalid opcode: 0000 [#1] PREEMPT SMP KASAN
> [ 1958.315979][T11356] RIP: 0010:napi_enable+0x16a/0x1f0
> [ 1958.332310][T11356] Call Trace:
> [ 1958.332817][T11356] <TASK>
> [ 1958.336135][T11356] lapbeth_open+0x18/0x90
> [ 1958.337446][T11356] __dev_open+0x258/0x490
> [ 1958.341672][T11356] __dev_change_flags+0x4d4/0x6a0
> [ 1958.345325][T11356] dev_change_flags+0x93/0x160
> [ 1958.346027][T11356] devinet_ioctl+0x1276/0x1bf0
> [ 1958.346738][T11356] inet_ioctl+0x1c8/0x2d0
> [ 1958.349638][T11356] sock_ioctl+0x5d1/0x750
> [ 1958.356059][T11356] __x64_sys_ioctl+0x3ec/0x1790
> [ 1958.365594][T11356] do_syscall_64+0x35/0x80
> [ 1958.366239][T11356] entry_SYSCALL_64_after_hwframe+0x46/0xb0
> [ 1958.377381][T11356] </TASK>
>
> [...]
Here is the summary with links:
- [net] net: lapbether: fix issue of invalid opcode in lapbeth_open()
https://git.kernel.org/netdev/net/c/3faf7e14ec0c
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-11-08 12:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-07 1:14 [PATCH net] net: lapbether: fix issue of invalid opcode in lapbeth_open() Zhengchao Shao
2022-11-08 12:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).