Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mISDN: Fix a sleep-in-atomic bug

The driver may sleep under a read spin lock, and the function call path is:
send_socklist (acquire the lock by read_lock)
skb_copy(GFP_KERNEL) --> may sleep

To fix it, the "GFP_KERNEL" is replaced with "GFP_ATOMIC".

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jia-Ju Bai and committed by
David S. Miller
93818da5 35cf2845

+1 -1
+1 -1
drivers/isdn/mISDN/stack.c
··· 75 75 if (sk->sk_state != MISDN_BOUND) 76 76 continue; 77 77 if (!cskb) 78 - cskb = skb_copy(skb, GFP_KERNEL); 78 + cskb = skb_copy(skb, GFP_ATOMIC); 79 79 if (!cskb) { 80 80 printk(KERN_WARNING "%s no skb\n", __func__); 81 81 break;