Fix check for a constant 0 argument to BPF_DIV.
BPV_RVAL() is the macro to check the type of the return value of a "ret" instruction; it tests more bits than are appropriate for a "div" instruction, and the test fails.
This commit is contained in:
parent
e25ea10a13
commit
ace1a2c86f
|
@ -608,7 +608,7 @@ bpf_validate(f, len)
|
|||
/*
|
||||
* Check for constant division by 0.
|
||||
*/
|
||||
if (BPF_RVAL(p->code) == BPF_K && p->k == 0)
|
||||
if (BPF_SRC(p->code) == BPF_K && p->k == 0)
|
||||
return 0;
|
||||
break;
|
||||
default:
|
||||
|
|
Reference in New Issue