* [net-next] Revert "tipc: use consistent GFP flags"
@ 2021-12-17 3:00 Hoang Le
2021-12-18 3:30 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Hoang Le @ 2021-12-17 3:00 UTC (permalink / raw)
To: jmaloy, maloy, ying.xue, kuba, davem, netdev, tipc-discussion,
eric.dumazet
This reverts commit 86c3a3e964d910a62eeb277d60b2a60ebefa9feb.
The tipc_aead_init() function can be calling from an interrupt routine.
This allocation might sleep with GFP_KERNEL flag, hence the following BUG
is reported.
[ 17.657509] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:230
[ 17.660916] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 0, name: swapper/3
[ 17.664093] preempt_count: 302, expected: 0
[ 17.665619] RCU nest depth: 2, expected: 0
[ 17.667163] Preemption disabled at:
[ 17.667165] [<0000000000000000>] 0x0
[ 17.669753] CPU: 3 PID: 0 Comm: swapper/3 Kdump: loaded Tainted: G W 5.16.0-rc4+ #1
[ 17.673006] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
[ 17.675540] Call Trace:
[ 17.676285] <IRQ>
[ 17.676913] dump_stack_lvl+0x34/0x44
[ 17.678033] __might_resched.cold+0xd6/0x10f
[ 17.679311] kmem_cache_alloc_trace+0x14d/0x220
[ 17.680663] tipc_crypto_start+0x4a/0x2b0 [tipc]
[ 17.682146] ? kmem_cache_alloc_trace+0xd3/0x220
[ 17.683545] tipc_node_create+0x2f0/0x790 [tipc]
[ 17.684956] tipc_node_check_dest+0x72/0x680 [tipc]
[ 17.686706] ? ___cache_free+0x31/0x350
[ 17.688008] ? skb_release_data+0x128/0x140
[ 17.689431] tipc_disc_rcv+0x479/0x510 [tipc]
[ 17.690904] tipc_rcv+0x71c/0x730 [tipc]
[ 17.692219] ? __netif_receive_skb_core+0xb7/0xf60
[ 17.693856] tipc_l2_rcv_msg+0x5e/0x90 [tipc]
[ 17.695333] __netif_receive_skb_list_core+0x20b/0x260
[ 17.697072] netif_receive_skb_list_internal+0x1bf/0x2e0
[ 17.698870] ? dev_gro_receive+0x4c2/0x680
[ 17.700255] napi_complete_done+0x6f/0x180
[ 17.701657] virtnet_poll+0x29c/0x42e [virtio_net]
[ 17.703262] __napi_poll+0x2c/0x170
[ 17.704429] net_rx_action+0x22f/0x280
[ 17.705706] __do_softirq+0xfd/0x30a
[ 17.706921] common_interrupt+0xa4/0xc0
[ 17.708206] </IRQ>
[ 17.708922] <TASK>
[ 17.709651] asm_common_interrupt+0x1e/0x40
[ 17.711078] RIP: 0010:default_idle+0x18/0x20
Fixes: 86c3a3e964d9 ("tipc: use consistent GFP flags")
Acked-by: Jon Maloy <jmaloy@redhat.com>
Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au>
---
net/tipc/crypto.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/tipc/crypto.c b/net/tipc/crypto.c
index 81116312b753..9325479295b8 100644
--- a/net/tipc/crypto.c
+++ b/net/tipc/crypto.c
@@ -524,7 +524,7 @@ static int tipc_aead_init(struct tipc_aead **aead, struct tipc_aead_key *ukey,
return -EEXIST;
/* Allocate a new AEAD */
- tmp = kzalloc(sizeof(*tmp), GFP_KERNEL);
+ tmp = kzalloc(sizeof(*tmp), GFP_ATOMIC);
if (unlikely(!tmp))
return -ENOMEM;
@@ -1463,7 +1463,7 @@ int tipc_crypto_start(struct tipc_crypto **crypto, struct net *net,
return -EEXIST;
/* Allocate crypto */
- c = kzalloc(sizeof(*c), GFP_KERNEL);
+ c = kzalloc(sizeof(*c), GFP_ATOMIC);
if (!c)
return -ENOMEM;
@@ -1477,7 +1477,7 @@ int tipc_crypto_start(struct tipc_crypto **crypto, struct net *net,
}
/* Allocate statistic structure */
- c->stats = alloc_percpu(struct tipc_crypto_stats);
+ c->stats = alloc_percpu_gfp(struct tipc_crypto_stats, GFP_ATOMIC);
if (!c->stats) {
if (c->wq)
destroy_workqueue(c->wq);
@@ -2450,7 +2450,7 @@ static void tipc_crypto_work_tx(struct work_struct *work)
}
/* Lets duplicate it first */
- skey = kmemdup(aead->key, tipc_aead_key_size(aead->key), GFP_KERNEL);
+ skey = kmemdup(aead->key, tipc_aead_key_size(aead->key), GFP_ATOMIC);
rcu_read_unlock();
/* Now, generate new key, initiate & distribute it */
--
2.30.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [net-next] Revert "tipc: use consistent GFP flags"
2021-12-17 3:00 [net-next] Revert "tipc: use consistent GFP flags" Hoang Le
@ 2021-12-18 3:30 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-12-18 3:30 UTC (permalink / raw)
To: Hoang Le
Cc: jmaloy, maloy, ying.xue, kuba, davem, netdev, tipc-discussion,
eric.dumazet
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 17 Dec 2021 10:00:59 +0700 you wrote:
> This reverts commit 86c3a3e964d910a62eeb277d60b2a60ebefa9feb.
>
> The tipc_aead_init() function can be calling from an interrupt routine.
> This allocation might sleep with GFP_KERNEL flag, hence the following BUG
> is reported.
>
> [ 17.657509] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:230
> [ 17.660916] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 0, name: swapper/3
> [ 17.664093] preempt_count: 302, expected: 0
> [ 17.665619] RCU nest depth: 2, expected: 0
> [ 17.667163] Preemption disabled at:
> [ 17.667165] [<0000000000000000>] 0x0
> [ 17.669753] CPU: 3 PID: 0 Comm: swapper/3 Kdump: loaded Tainted: G W 5.16.0-rc4+ #1
> [ 17.673006] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
> [ 17.675540] Call Trace:
> [ 17.676285] <IRQ>
> [ 17.676913] dump_stack_lvl+0x34/0x44
> [ 17.678033] __might_resched.cold+0xd6/0x10f
> [ 17.679311] kmem_cache_alloc_trace+0x14d/0x220
> [ 17.680663] tipc_crypto_start+0x4a/0x2b0 [tipc]
> [ 17.682146] ? kmem_cache_alloc_trace+0xd3/0x220
> [ 17.683545] tipc_node_create+0x2f0/0x790 [tipc]
> [ 17.684956] tipc_node_check_dest+0x72/0x680 [tipc]
> [ 17.686706] ? ___cache_free+0x31/0x350
> [ 17.688008] ? skb_release_data+0x128/0x140
> [ 17.689431] tipc_disc_rcv+0x479/0x510 [tipc]
> [ 17.690904] tipc_rcv+0x71c/0x730 [tipc]
> [ 17.692219] ? __netif_receive_skb_core+0xb7/0xf60
> [ 17.693856] tipc_l2_rcv_msg+0x5e/0x90 [tipc]
> [ 17.695333] __netif_receive_skb_list_core+0x20b/0x260
> [ 17.697072] netif_receive_skb_list_internal+0x1bf/0x2e0
> [ 17.698870] ? dev_gro_receive+0x4c2/0x680
> [ 17.700255] napi_complete_done+0x6f/0x180
> [ 17.701657] virtnet_poll+0x29c/0x42e [virtio_net]
> [ 17.703262] __napi_poll+0x2c/0x170
> [ 17.704429] net_rx_action+0x22f/0x280
> [ 17.705706] __do_softirq+0xfd/0x30a
> [ 17.706921] common_interrupt+0xa4/0xc0
> [ 17.708206] </IRQ>
> [ 17.708922] <TASK>
> [ 17.709651] asm_common_interrupt+0x1e/0x40
> [ 17.711078] RIP: 0010:default_idle+0x18/0x20
>
> [...]
Here is the summary with links:
- [net-next] Revert "tipc: use consistent GFP flags"
https://git.kernel.org/netdev/net/c/f845fe5819ef
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:[~2021-12-18 3:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-17 3:00 [net-next] Revert "tipc: use consistent GFP flags" Hoang Le
2021-12-18 3:30 ` patchwork-bot+netdevbpf
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.