Skip to contentSkip to conversation

New Coverity defect in BPF verifier

DISCUSSION Stephen Hemminger 2 participants 3 messages May 22, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Date: Mon, 22 May 2017 04:40:24 -0700
From: [email protected]
To: [email protected]
Subject: New Defects reported by Coverity Scan for Linux

Hi,

Please find the latest report on new defect(s) introduced to Linux found with Coverity Scan.

1 new defect(s) introduced to Linux found with Coverity Scan.
17 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)

** CID 1409762: Control flow issues (DEADCODE) /kernel/bpf/verifier.c: 815 in check_pkt_ptr_alignment()

________________________________________________________________________________________________________
*** CID 1409762: Control flow issues (DEADCODE) /kernel/bpf/verifier.c: 815 in check_pkt_ptr_alignment()
809 }
810

811     	/* skb->data is NET_IP_ALIGN-ed, but for strict alignment checking
812     	 * we force this to 2 which is universally what architectures use
813     	 * when they don't set CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS.
814     	 */
>>>     CID 1409762:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach the expression "0" inside this statement: "ip_align = (strict ? 2 : 0);".  
815     	ip_align = strict ? 2 : NET_IP_ALIGN;
816     	if ((ip_align + reg_off + off) % size != 0) {
817     		verbose("misaligned packet access off %d+%d+%d size %d\n",
818     			ip_align, reg_off, off, size);
819     		return -EACCES;
820     	}
maintainer
#1 lore raw

Stephen, if you had even lightly scanned netdev today, you can see that we are discussing this already and there are at least two patches proposed.

Thank you.

#2 lore raw
Quoted 5 lines · On Mon, 22 May 2017 12:16:04 -0400 (EDT) David Miller <[email protected]>…

Stephen, if you had even lightly scanned netdev today, you can see that we are discussing this already and there are at least two patches proposed.

Thank you.

Sorry hadn't gotten that far. Doing full scan of 100's of messages a day is not always possible.