Re: v5.2-rt1: kernel: BUG: assuming atomic context at net/core/ptp_classifier.c:106 current

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2019-07-18 17:46:55 [-0300], Luis Claudio R. Goncalves wrote:
> Hello,
> 
> Sounds like ptp_classify_raw() should be reached with IRQs disabled to
> safely call BPF_PROG_RUN(). I am just unsure where, down the road, the
> proper context should have been set.
> 
> 08:46:58 darkmatter kernel: BUG: assuming atomic context at net/core/ptp_classifier.c:106
> Jul 17 08:46:58 darkmatter kernel: in_atomic(): 0, irqs_disabled(): 0, pid: 1129, name: irq/35-enp4s0
> Jul 17 08:46:58 darkmatter kernel: CPU: 1 PID: 1129 Comm: irq/35-enp4s0 Not tainted 5.2.0-rt1 #1
> Jul 17 08:46:58 darkmatter kernel: Hardware name: Hewlett-Packard p7-1512/2ADA, BIOS 8.15 02/05/2013
> Jul 17 08:46:58 darkmatter kernel: Call Trace:
> Jul 17 08:46:58 darkmatter kernel: dump_stack+0x67/0x90
> Jul 17 08:46:58 darkmatter kernel: __cant_sleep.cold+0x68/0x74
> Jul 17 08:46:58 darkmatter kernel: ptp_classify_raw+0x1f/0xa0
> Jul 17 08:46:58 darkmatter kernel: skb_defer_rx_timestamp+0x5a/0xb0
> Jul 17 08:46:58 darkmatter kernel: netif_receive_skb_internal+0x34/0xe0
> Jul 17 08:46:58 darkmatter kernel: napi_gro_receive+0x66/0x1c0
> Jul 17 08:46:58 darkmatter kernel: rtl8169_poll+0x216/0x610 [r8169]
> Jul 17 08:46:58 darkmatter kernel: net_rx_action+0x208/0x490
> Jul 17 08:46:58 darkmatter kernel: __do_softirq+0x140/0x3c9
> Jul 17 08:46:58 darkmatter kernel: __local_bh_enable_ip+0x13d/0x160
> Jul 17 08:46:58 darkmatter kernel: irq_forced_thread_fn+0x70/0x80
> Jul 17 08:46:58 darkmatter kernel: irq_thread+0xf6/0x1d0
> Jul 17 08:46:58 darkmatter kernel: kthread+0x103/0x140
> Jul 17 08:46:58 darkmatter kernel: ret_from_fork+0x3a/0x50
> Jul 17 08:46:58 darkmatter kernel: bpfilter: Loaded bpfilter_umh pid 1160
> Jul 17 08:46:58 darkmatter kernel: bpfilter: read fail -13

I would argue that this cant_sleep() thingy is nonsense. On !RT you run
in softirq and while this check does not trigger (because the preemption
counter is != 0) you can be preempted by an IRQ.
I have no idea what it intends to protect. The commit does not explain
why it is important to keep preemption disabled while invoking a BPF
program.

> Luis

Sebastian



[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux